Error term for endogenous variables: SEM Mediation

383 views
Skip to first unread message

Emma Mills

unread,
Dec 14, 2016, 3:10:40 AM12/14/16
to lavaan
I am using lavaan to carry out mediation analysis using structural equation modelling. I am new to structural equation modelling and so apologise!!

I have 3 variables,  X (perceived behaviour)  predicts Z (perceived recognition) and in turn Z (perceived recognition)  predicts Y(job satisfaction) and X (perceived behaviour) has also a direct effect on Y (job satisfaction). The behaviour variable has 6 latent factors, whereas the other 2 variables are single items so they do not have latent factors.   (I have attached the model output)

I have read that  ''Since both Z and Y are endogenous variables the error term would also be added before testing the model''.

This is the syntax I have used, but I would be really grateful if someone could help me to understand how I would add the error term, and why this is important?


SCTModel2 <- '

RBehF1=~BF1_RAV+BF2_RAV+BF3_RAV+BF4_RAV+BF6_RAV+BF7_RAV

 

 # direct effect

             RaterJobSat ~ c*RBehF1

           # mediator

            RaterReward ~ a*RBehF1

             RaterJobSat ~ b*RaterReward

           # indirect effect (a*b)

             indirect := a*b

           # total effect

             total := c + (a*b)

RBehF1~~RaterJobSat

RBehF1~~RaterReward

RaterReward~~RaterJobSat

         '

 

SCT1fit2<-sem(SCTModel2, data = SMBI_Alldata, test = "bollen.stine"se="boot", bootstrap = 5000)

 

summary(SCT1fit2, standardized = T, fit.measures = T, rsq = T)


boot.fit2 <- parameterEstimates(SCT1fit2, boot.ci.type="bca.simple",level=0.95, ci=TRUE,standardized = FALSE)

 

boot.fit2

 

semPaths(SCT1fit2, "stand", residuals = FALSE, intercepts = FALSE, fixed = TRUE, what = "paths", unCol = "black", rotation = 2, edge.label.cex = 0.7, asize = 1.1, style = "lisrel", layout = "tree", curveAdjacent = TRUE, nCharNodes=0, sizeMan2=3, sizeMan=14, sizeLat = 12, sizeLat2 = 6, label.prop=1, label.norm = "00000000000000000", curve=3, cardinal = TRUE, layoutSplit = FALSE)


semPaths(SCT1fit2)

Example mediation model.docx

Terrence Jorgensen

unread,
Dec 16, 2016, 5:26:43 AM12/16/16
to lavaan
The behaviour variable has 6 latent factors,

Just to clarify terms, Behavior  is the latent common factor.  It has six observed indicators.  Latent = unobserved.

how I would add the error term, and why this is important?

You are using the sem() function, which adds error terms for endogenous variables by default (see the residual variance estimate in the summary() output).  It is important for the same reason errors are included in regression or ANOVA.  You don't expect predicted values (or group means) to exactly match all observed variables.  In other words, you don't expect a (set of) predictor(s) to explain 100% of the variance in an outcome.

Terrence D. Jorgensen
Postdoctoral Researcher, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam

Reply all
Reply to author
Forward
0 new messages