Hello,
I have a cross-lagged model that I have run using the code below:
CrossLaggedModel<-mxModel("cross_lagged_model", type="RAM", manifestVars=c("f7_bmi","tf4_bmi","f7_cpg","tf4_cpg"), mxData(observed=children_data, type="raw"), mxPath(from=c("f7_bmi"), to=c("tf4_cpg"), arrows=1, free=TRUE, values=c(.5), labels="AtoB"), mxPath(from=c("f7_cpg"), to=c("tf4_bmi"), arrows=1, free=TRUE, values=c(1.5), labels="BtoA"), mxPath(from=c("f7_bmi"), to=c("tf4_bmi"), arrows=1, free=TRUE, values=c(.1), labels="AtoA"), mxPath(from=c("f7_cpg"), to=c("tf4_cpg"), arrows=1, free=TRUE, values=c(0), labels="BtoB"), mxPath(from=c("f7_bmi","tf4_bmi"), arrows=2, free=TRUE, values=c(1, 1), labels=c("residualA1", "residualA2")), mxPath(from=c("f7_cpg","tf4_cpg"), arrows=2, free=TRUE, values=c(.5, .5), labels=c("residualB1", "residualB2")), mxPath(from=c("f7_bmi","tf4_bmi"), to=c("f7_cpg","tf4_cpg"), arrows=2, free=TRUE, values=c(.05,.05), labels=c("residCovAB1", "residCovAB2")), mxPath(from="one", to=c("f7_bmi","tf4_bmi","f7_cpg","tf4_cpg"), free=TRUE, values=0, labels="m") ) model1<-mxModel(CrossLaggedModel, mxCI(c("cross_lagged_model.A","cross_lagged_model.S"))) model<-mxTryHard(model1, intervals=T)
Here, f7 is one time point and tf4 is a later timepoint and BMI and CpG are the two variables at different timepoints. When I run this model I'm concerned about the results I get (shown below) as these are suggesting opposite effects to linear regression models, but also because the residuals/variance for residual B1 is very large and not near what the actual variance of the data is. I've tried specifying different starting values for the model, but I still get these large values. I have also tried adding in a latent variable for BMI and CpG but this just makes the numbers even larger. So I just wondered if there was anything wrong with the code I am using or whether this is perhaps just not working well for some reason.
free parameters:
name matrix row col Estimate Std.Error A
1 AtoA A tf4_bmi f7_bmi 0.09102847 0.10034782
2 AtoB A tf4_cpg f7_bmi 0.47616253 0.03039210
3 BtoA A tf4_bmi f7_cpg 1.34019586 0.01243257
4 BtoB A tf4_cpg f7_cpg -0.05465275 0.01098387
5 residualA1 S f7_bmi f7_bmi 1.82067088 0.33356059
6 residualA2 S tf4_bmi tf4_bmi 7.49071007 0.38457389
7 residCovAB1 S f7_bmi f7_cpg -13.60428618 2.70038904
8 residualB1 S f7_cpg f7_cpg 238.60375066 12.54453274
9 residCovAB2 S tf4_bmi tf4_cpg 0.26706472 0.09050008
10 residualB2 S tf4_cpg tf4_cpg 0.82379525 0.04027825
11 m M 1 f7_bmi 0.91112011 0.17838277
Thank you!