No SE/z-value/p-value from parameterEstimates with runMI estimated model

121 views
Skip to first unread message

Conor Goold

unread,
Jun 7, 2017, 2:50:42 PM6/7/17
to lavaan
Hi all, 

I have estimated a CFA on imputed data using the runMI(). Last time I checked, I could use: 

parameterEstimates( fit )

...and get the coefficients, SEs, z-values, and p-values. However, now I receive the following error when running: 

parameterEstimates( fit , se = TRUE )
Error in `$<-.data.frame`(`*tmp*`, "z", value = numeric(0)) :
  replacement has
0 rows, data has 70

I loaded in lavaan and semTools using: 

install.packages("lavaan", repos="http://www.da.ugent.be", type="source")
devtools::install_github("simsem/semTools/semTools")

Please let me know if you would like a reproducible example, but I figured this may be a simple fix from the error message. Thanks a lot for your help!

Here is my session info. 

sessionInfo()
R version 3.3.2 (2016-10-31)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X Yosemite 10.10.5

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] rstan_2.15.1         StanHeaders_2.15.0-1 ggplot2_2.2.1        data.table_1.10.4    reshape2_1.4.2       psych_1.7.3.21      
 [7] Amelia_1.7.4         Rcpp_0.12.10         semTools_0.4-15.910  lavaan_0.6-1.1132   

loaded via a namespace (and not attached):
 [1] git2r_0.15.0     plyr_1.8.4       tools_3.3.2      digest_0.6.12    memoise_1.0.0    tibble_1.3.0     nlme_3.1-128    
 [8] gtable_0.2.0     lattice_0.20-34  curl_1.1         parallel_3.3.2   pbivnorm_0.6.0   gridExtra_2.2.1  withr_1.0.2     
[15] httr_1.2.1       stringr_1.2.0    devtools_1.12.0  stats4_3.3.2     grid_3.3.2       inline_0.3.14    R6_2.2.1        
[22] foreign_0.8-67   magrittr_1.5     scales_0.4.1     mnormt_1.5-5     colorspace_1.3-2 quadprog_1.5-5   stringi_1.1.3   
[29] lazyeval_0.2.0   munsell_0.4.3   

Best
Conor

Conor Goold

unread,
Jun 7, 2017, 3:01:21 PM6/7/17
to lavaan
In fact, I can just use summary() to get my relevant information anyway. Thanks!

Terrence Jorgensen

unread,
Jun 14, 2017, 5:11:52 AM6/14/17
to lavaan
In fact, I can just use summary() to get my relevant information anyway.

Correct, old versions of semTools returned a lavaanStar object, that inherited from class?lavaan, but that was problematic.  The developmental version you are using returns a lavaan.mi object, which inherits from class?lavaanList.  I wrote the summary() method to work like either summary() or parameterEstimates() works on a lavaan object, depending on the logical argument add.attributes, which you can read about on the ?parameterEstimates help page or the class?lavaan.mi help page.  In fact, if you play with the summary() arguments described on the class?lavaan help page, you will see summary() is just a way to display output from any combination of parameterEstimates(), fitMeasures(), and modIndices(), with an option header.

Terrence D. Jorgensen
Postdoctoral Researcher, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam

Reply all
Reply to author
Forward
0 new messages