semTools::runMI() - No SE's when calling summary(<lavaan.mi>)

101 views
Skip to first unread message

Jeroen Mulder

unread,
Nov 4, 2022, 6:08:24 AM11/4/22
to lavaan
Dear all,

I am using runMI() from the semTools-package to fit a SEM model on a list of data sets, and pool the results. This results in an object called "out_phaseII_exploratory" of class lavaan.mi. Unfortunately, I can't seem to get the pooled SE estimates, along with the t test statistics and their associated df and p-values when calling summary() on the "out_phaseII_exploratory" object; I only get the "est.ave" per parameter. I've checked if this has to do with the size of the SEM model, whether or not it is saturated, or nonconvergence on some data sets, but that these factors seem to be unrelated. The weird thing is that calling summary() on an lavaan.mi object that I created about a week ago didn't cause any problems then, but now also doesn't give me the SE estimates (as well as the t test statistics, etc.). 

I am using semTools 0.5.6. Attached you can find the "out_phaseII_exploratory" object. Hopefully the problem can be reproduced:

load(<path to out_phaseII_exploratory.Rds>)
class(out_phaseII_exploratory)
summary(out_phaseII_exploratory)

Kind regards,
Jeroen 
out_phaseII_exploratory.Rds

Terrence Jorgensen

unread,
Nov 7, 2022, 5:12:57 AM11/7/22
to lavaan
I only get the "est.ave" per parameter

That means R isn't finding the methods for lavaan.mi-class objects.  So it is using the method for lavaanList-class objects (from which lavaan.mi inherits).  When you import your saved lavaan.mi object into your workspace, remember to load library(semTools).  That does not appear in your (pseudo-)syntax.
 
Attached you can find the "out_phaseII_exploratory" object. Hopefully the problem can be reproduced:

load(<path to out_phaseII_exploratory.Rds>)

You attached a .gz file, not an .rds file.  From the use of load() rather than readRDS(), I wonder whether you are saving an entire workspace (.RData file, made with the save() function) instead of a single object using the saveRDS() function.  It can be problematic to save a workspace because it could preserve the loading of other libraries, which sometimes interfere with R finding the methods provided in semTools for lavaan.mi objects.  You can see all the attached and loaded packages via sessionInfo()

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

Reply all
Reply to author
Forward
0 new messages