Error in lavaan, "row names contain missing values", when using summary() , requesting rsquare

241 views Asked by At

I'm using a large-ish, somewhat messy dataset, and using lavaan to run a regression. I'm able to get parameter estimates through parameterEstimates() and standardizedSolution(), which I have cross-checked with SPSS and lm() and know the values are correct. I'm using lavaan because I am doing one version of my analysis with FIML for missing data.

But summary() consistently returns the error code:

error in data.frame(lhs = NAMES, op = rep("r2", nel(, rhs = NAMES, block = block, : row names contain missing values.

When I try to check for missing values in row names, R tells me there are no missing row names. but maybe yall have a better way to check. I have the newest version of R and lavaan. I have gotten around this by using parameterEstimates, fitMeasures, and standardizedSolution. And while parameterEstimates() works, when I add rsquare = TRUE it returns the same missing row names error code.

I have had no problem with summary() in lavaan in the past, it worked fine in all of my statistics homework assignments and textbook examples , and it worked fine with my random subsample of this data (N=500) that I was using for EFA.

I would appreciate any help anybody can give me with this, I am a grad student trying to get better at R and even though I can get rsquared from regular lm() I want to know why I keep getting this error code and how to fix it.

1

There are 1 answers

0
Terrence On

This bug occurred for single-outcome regression models, and it has been resolved:

https://github.com/yrosseel/lavaan/issues/290

You can install the development version until the next CRAN release:

https://lavaan.ugent.be/about/development.html