SEM with variables with different number of replications.

32 views
Skip to first unread message

Raquel Juan Ovejero

unread,
Jan 23, 2019, 8:56:09 AM1/23/19
to lavaan
Hello,

I am a beginner at using lavaan package and I would like to ask you it is possible to fit a model with variables that have different number of replications. 
According to the tutorial, the package uses the listwise deleition by default. In my case, some variables have 10 replicates and others 3 replicates, and consequently the final total number of observations in the model is reduced and only based on the rows that do not have any missing values. 
When I run the model in R with my whole dataframe, I get an error that says "Could not compute standard errors! The information matrix could not be inverted. This may be a symptom that the model is not identified.", and I guess this is due to the missing values problem. 
I have tried to use the mean values for each variable, but then the total number of observations is too low and it is close to the number of free parameters.  

Is there any possibility to run a model with all the variables despite of having different number of replications between them? 


Thank you very much in advance,
Raquel 

Rönkkö, Mikko

unread,
Jan 23, 2019, 9:09:48 AM1/23/19
to lav...@googlegroups.com
Hi,

Yes.


“Missing values
If the data contain missing values, the default behavior is listwise deletion. If the missing mechanism is MCAR (missing completely at random) or MAR (missing at random), the lavaan package provides case-wise (or 'full information') maximum likelihood estimation. You can turn this feature on, by using the argument missing = "ML" when calling the fitting function. An unrestricted (h1) model will automatically be estimated, so that all common fit indices are available.”


But if I understood your explanation correctly, it seems that you have just ten observations total. That is inadequate for most statistical analyses, and using ML for missing data would probably not do any good in your case.

Mikko

--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
To post to this group, send email to lav...@googlegroups.com.
Visit this group at https://groups.google.com/group/lavaan.
For more options, visit https://groups.google.com/d/optout.

Raquel Juan Ovejero

unread,
Jan 23, 2019, 9:18:14 AM1/23/19
to lavaan
No, I do have 480 observations total. The problem is that for some variables I have 480 observations and for others just 144 observations, due to a different number of replicates for each variable. 
The model only takes into account the rows that are fully complete. I would like to know if it is possible to deal with variables with different number of observations. 

Mikko

To post to this group, send email to la...@googlegroups.com.

Rönkkö, Mikko

unread,
Jan 23, 2019, 10:51:50 AM1/23/19
to lav...@googlegroups.com
Hi,

OK, good. If you have repeated measures of the same individuals, you need to consider whether to take the non-independence of the observations into account. This could be helpful:


Mikko

To post to this group, send email to lav...@googlegroups.com.

Mauricio Garnier-Villarreal

unread,
Jan 23, 2019, 1:24:11 PM1/23/19
to lavaan
Also, you could use FIML. FIML its a model based approach, so if you set a model that accounts for the repeated measures (like a growth curve model), that would help the estimation
Reply all
Reply to author
Forward
0 new messages