Marios
2013-Feb-21 14:59 UTC
[R] total indirect effects in structural equation modeling using lavaan
Hi all,
I am using package lavaan and have created a structural equation model with
two exogenous and seven endogenous variables with the following
relationships
#specify the model
m1 = ' # regressions
D ~ ma + hs + b4 + b5 + b15 + b16
ma ~ hs + b4 + b5 + b15 + b16
hs ~ b4 + b5 + b15 + b16
b4 ~ el + la
b5 ~ el + la
b15 ~ el + la
b16 ~ el + la
#(residual) variances and covariances
b4 ~~ b5
b4 ~~ b15
b4 ~~ b16
b5 ~~ b15
b5 ~~ b16
b15 ~~ b16
'
# fit the model
fit.m1 = sem(m1, data=x)
# summary result with standardised coefficients and r^2
summary(fit.m1, standardized = TRUE, rsq=TRUE)
#
My question.......I would like to calculate the total indirect effects of
all variables on the right-hand-side of the regression eqn's so that i can
work out the total effect (indirect effects + direct effect)
I know the direct effect and i can calculate the total indirect effects by
hand but i was wondering if there is a function that can calculate this?
Many thanks
[[alternative HTML version deleted]]
yrosseel
2013-Feb-22 08:02 UTC
[R] total indirect effects in structural equation modeling using lavaan
On 02/21/2013 03:59 PM, Marios wrote:> My question.......I would like to calculate the total indirect effects of > all variables on the right-hand-side of the regression eqn's so that i can > work out the total effect (indirect effects + direct effect) > > I know the direct effect and i can calculate the total indirect effects by > hand but i was wondering if there is a function that can calculate this?In the current version of lavaan (0.5-11), there is no function that will compute all possible indirect/total effects automatically. What you can do is to label the coefficients, and then use the ':=' operator to define the total/indirect effects that you are interested in. Next, you could use se="boot" to get a bootstrap based SE. See the lavaan paper (http://www.jstatsoft.org/v48/i02/) section 7.4 for an example. Yves.
Apparently Analagous Threads
- Structural equation modeling in R(lavaan,sem)
- [R-pkgs] New package: `lavaan' for latent variable analysis (including structural equation modeling)
- Bug in as.character? (PR#14206)
- New package: `lavaan' for latent variable analysis (including structural equation modeling)
- New package: `lavaan' for latent variable analysis (including structural equation modeling)