# Load the lavaan package
library(lavaan)
# Define the path model
Pathanalysis <- '
# direct effects
Personal_social_score ~ a1*Parental_Stress + b1*Income + c1*(round=0)
Personal_social_score1 ~ a2*Parental_Stress1 + b2*Income1 + c2*(round=1)
Personal_social_score2 ~ a3*Parental_Stress2 + b3*Income2 + c3*(round=2)
# indirect effect
Personal_social_score ~ d1*Emotional_Practices_total
Personal_social_score1 ~ d2*Emotional_Practices_total1
Personal_social_score2 ~ d3*Emotional_Practices_total2
Personal_social_score -> Emotional_Practices_total
Personal_social_score -> Emotional_Practices_total1
Personal_social_score -> Emotional_Practices_total2
'
# Fit the model to the data
fit <- sem(Pathanalysis, data=Comb_KEN_ZMB_SB_06_01)
# Summarize the fit of the model
summary(fit)
This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.
If you have a query related to it or one of the replies, start a new topic and refer back with a link.