Hi, I’ve a question regarding an error I got when adding ‘age at time 1’ (T1_ Age) to my model. Before I included age, the model worked perfectly. When adding age at time 1 as covariance to prosocial behaviour and cortical thickness at time one, in order to account for age related differences in baseline levels, I got the following error:
Error in lav_model_estimate(lavmodel = lavmodel, lavpartable = lavpartable, : lavaan ERROR: initial model-implied matrix (Sigma) is not positive definite;check your model and/or starting parameters in group 1.
In addition: Warning message In lav_partable_check(lavpartable, categorical = lavoptions$categorical, :lavaan WARNING: automatically added intercepts are set to zero: [T1_Age]
Below you will find my model. I hope someone can explain what is going wrong and how to solve this.
BLCS_PB_mPFC_CT<-'
T2_PB ~ 1*T1_PB
dPB1 =~ 1*T2_PB
dPB1 ~ c(IC_dPB_b, IC_dPB_g)*1
T1_PB ~ c(IC_PB_b, IC_PB_g)*1
T2_PB ~ 0*1
T2_mPFC_CT ~ 1*T1_mPFC_CT
dmPFC_CT1 =~ 1*T2_mPFC_CT
T2_mPFC_CT ~ 0*1
T2_mPFC_CT ~~ 0*T2_mPFC_CT
dPB1 ~~ dPB1
T1_PB ~~ T1_PB
T2_PB ~~ 0*T2_PB
dmPFC_CT1 ~ c(IC_dCT_b, IC_dCT_g)*1
T1_mPFC_CT ~ c(IC_CT_b, IC_CT_g)*1 dmPFC_CT1 ~~ dmPFC_CT1
T1_mPFC_CT ~~ T1_mPFC_CT
dmPFC_CT1 ~ c(G1_b, G1_g)* T1_PB +c(B2_b, B2_g)* T1_mPFC_CT
dPB1 ~ c(G2_b, G2_g)* T1_mPFC_CT +c(B1_b,B1_g)* T1_PB
T1_PB ~~ T1_mPFC_CT
dPB1~~dmPFC_CT1
T1_Age ~~ T1_mPFC_CT + T1_PB
dr_PB_boys := IC_dPB_b
idr_PB_boys := (IC_PB_b * B1_b) + (IC_CT_b * G2_b)
t_PB_boys := IC_dPB_b + (IC_PB_b * B1_b)+ (IC_CT_b * G2_b)
dr_CT_boys := IC_dCT_b
idr_CT_boys := (IC_CT_b * B2_b) + (IC_PB_b * G1_b)
t_CT_boys := IC_dCT_b + (IC_CT_b * B2_b) + (IC_PB_b *G1_b)
dr_PB_girls := IC_dPB_g
idr_PB_girls := (IC_PB_g * B1_g) + (IC_CT_g * G2_g)
t_PB_girls := IC_dPB_g + (IC_PB_g * B1_g) + (IC_CT_g * G2_g)
dr_CT_girls := IC_dCT_g
idr_CT_girls := (IC_CT_g * B2_g) + (IC_PB_g * G1_g)
t_CT_girls := IC_dCT_g + (IC_CT_g * B2_g) + (IC_PB_g *G1_g)’
T1_Age ~~ T1_mPFC_CT + T1_PB
T1_Age ~~ T1_Age