sem.mi script (m is missing)

64 views
Skip to first unread message

Kelly Morgan

unread,
Sep 28, 2018, 12:16:29 PM9/28/18
to lavaan
Is anyone able to please help with the following script? I have 15 identical imputed datasets (same variables and number) which I am trying to upload as series of data but it seems to be ignoring the uploaded data:

fit <- sem.mi(DOG, data=c("X_1_sumhol","X_2_sumhol","X_3_sumhol","X_4_sumhol","X_5_sumhol",
                            "X_6_sumhol","X_7_sumhol","X_8_sumhol","X_9_sumhol","X_10_sumhol",
                            "X_11_sumhol","X_12_sumhol","X_13_sumhol","X_14_sumhol","X_15_sumhol"))

Error in runMI(model = model, data = data, m = m, miArgs = miArgs, chi = chi,  : 
  argument "m" is missing, with no default

Esteban Montenegro

unread,
Oct 3, 2018, 5:21:11 PM10/3/18
to lavaan
Hello Kelly,

I don't know if you already fixed your problem. Given that you have 15 multiple imputed data sets, you need to use the function "run.mi" from semTools package. This function needs a list of the data sets. For instance, you need something like this:

fit <- runMI(mod1,
             data = impList,
             fun = "sem",
             std.lv = TRUE,
             meanstructure = TRUE
             ) 

Let me know if this answers your question.

Terrence Jorgensen

unread,
Oct 6, 2018, 4:46:03 PM10/6/18
to lavaan
Your data= argument is a character vector, not a list of imputed data sets.

fit <- sem.mi(DOG, data=c("X_1_sumhol","X_2_sumhol","X_3_sumhol","X_4_sumhol","X_5_sumhol",
                            "X_6_sumhol","X_7_sumhol","X_8_sumhol","X_9_sumhol","X_10_sumhol",
                            "X_11_sumhol","X_12_sumhol","X_13_sumhol","X_14_sumhol","X_15_sumhol"))

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