Multilevel cross lagged panel model

383 views
Skip to first unread message

Dunja Van Der Velde

unread,
Sep 28, 2021, 5:35:01 AM9/28/21
to lavaan
Hi! 
I am new in R and also in Lavaan and got a little stuck unfortunately. 

I want to run a 2-level cross lagged panel model to find out within and between subject cross lagged paths. To specify, i made the following model with the accessory figure. 

We have data from +-80 people and one individual shows multiple data points. One of the variables is a binary variable, which i know is not ideal in Lavaan in R. 

When I run this model I get the error: lavaan WARNING: the optimizer warns that a solution has NOT been found!

I'm not sure about my definition of Level 2. If I remove the AR paths out of level 2, the model runs normally. Could it be correct that the AR paths (residual correlation) do not have to be included in level 2? Or might be another point in my model cause the problem?

Thanks in advance!
Dunja 

CLPM figure.PNG


Model1 <- ' 
          level: 1

#residual correlations (AR paths)
Xt ~~ Xt_1                #a
Yt ~~ Yt_1                #b

#covariances (CS paths)
Xt_1 ~~ Yt_1              #c 
Xt ~~ Yt                  #d

#cross-lagged paths
Yt ~ Xt_1                 #e
Xt ~ Yt_1                 #f

          level: 2

#residual correlations (AR paths)
Xt ~~ Xt_1                #a
Yt ~~ Yt_1                #b

#covariances (CS paths)
Xt_1 ~~ Yt_1              #c 
Xt ~~ Yt                  #d

#cross-lagged paths
Yt ~ Xt_1                 #e
Xt ~ Yt_1                 #f

'

#model fit
fit <- sem(model = Model1, data = d1, std.lv=TRUE, cluster = "subjectid")
summary (fit, fit.measures=TRUE)




Terrence Jorgensen

unread,
Oct 4, 2021, 7:26:17 AM10/4/21
to lavaan
one individual shows multiple data points

Only 1?  Or each individual?  How many time points?
 
One of the variables is a binary variable, which i know is not ideal in Lavaan in R. 

A binary predictor is not a problem.  Binary outcomes cannot currently be modeled with multilevel structure in lavaan.

 
I'm not sure about my definition of Level 2

Neither am I.  I'm not sure what the structure is, but AR-CL panel models are wide-format techniques (Y on separate occasions are separate variables), but you are using subjectid as the clustering variable, which implies long-format (all occasions are in a single column for each Y).  It seems like you might be doing something like a dynamic p-technique (SEM for many observations from a single person), but multilevel because there are several individuals (with only a few individuals, a multiple "group" dynamic-p SEM could be applied separately to each person). 

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