0

I am trying to perform a dominance analysis (calc.yhat) with the package yhat.

calc.yhat(lm.out, prec=3)

Error in ds[, i + 1] <- dataMatrix[, ivlist[i]] : incorrect number of subscripts on matrix

lm.out is defined as

Call:
lm(formula = oWE ~ T1DF + T1DC + FA + PI + JC, data = Final_Dataset_mplus)

> Coefficients: 
(Intercept)         T1DF         T1DC           FA  
    2.52380      0.12704      0.15321      0.04018  
         PI           JC  
    0.08618     -0.00488  
user20650
  • 24,654
  • 5
  • 56
  • 91
  • Hi. Can you try to make a reproducible example please (https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). This will make it easier for you to get hep. Thanks – user20650 Sep 10 '21 at 16:28
  • On a first glance, there are a few bugs in `yhat`. Can you rerun your regression on like fifteen rows and then post the output `dput(lm.out)`? – nograpes Sep 10 '21 at 17:07
  • Hey! Thanks for the help :-) It turned out I had to install the package 'boot' – I R Beginner Sep 10 '21 at 19:24
  • good you got it working. Bit weird though as `boot` is a recommended package so it should arrive with R e.g. there shouldn't be a need to install it. – user20650 Sep 10 '21 at 19:42
  • Please trim your code to make it easier to find your problem. Follow these guidelines to create a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example). – Community Sep 10 '21 at 21:49

0 Answers0