But I get: Error: could not find function ":=" - Does anyone know why this is happening?
Also, in many other examples I have seen residual variances and covariances included in the syntax but I don’t know how you determine/ decide on these?
If anyone has any suggestions of where I can find help with interpreting the output that would be really appreciated :)
SCTModel2 <- 'PF1=~pers2+pers4+pers3+pers8+pers7
BehF1=~BF1+BF2+BF3+BF4+BF6+BF7
EnvF1=~Env1+Env3+Env4+Env5
# direct effect
BehF1 ~ c*PF1
# mediator
EnvF1 ~ a*PF1
BehF1 ~ b*EnvF1
# indirect effect (a*b)
ab := a*b
# total effect
total := c + (a*b)
'
SCT2fit<-sem(SCTModel2, data = SMBI_Alldata, estimator="MLR", bootstrap = 5000)
summary(SCT2fit, standardized = T, fit.measures = T, rsq = T)
As you can see, I have used robust maximum likelihood estimation due to the lack of multivariate normality in my data (this is the approach that was recommended to me when I was doing confirmatory factor analysis using lavaan). However is this correct/ necessary in a mediation analysis, and should it be combined with the bootstrapping command like I've done above or not?
I used another command to perform bias corrected accelerated bootstrapping in order to get the confidence intervals for the indirect effect- as shown in my syntax below, but I'm not really sure what the difference is between the parameter estimates bootstrapping and the bootstrapping command I have used above?
> boot.fit <- parameterEstimates(SCT2fit, boot.ci.type="bca.simple",level=0.95, ci=TRUE,standardized = FALSE)
> boot.fit
I'd be really grateful for any help in trying to understand the approach to bootstrapping a little better.
In addition, are there any resources to help interpret the output of this mediation analysis? I'm not sure what parts I should be focusing on/writing up??
Thanks
Emma
However is this correct/ necessary in a mediation analysis, and should it be combined with the bootstrapping command like I've done above or not?
I'm not really sure what the difference is between the parameter estimates bootstrapping and the bootstrapping command I have used above?
In addition, are there any resources to help interpret the output of this mediation analysis? I'm not sure what parts I should be focusing on/writing up??