View source: R/bruceR-stats_5_advance.R
lavaan_summary | R Documentation |
Tidy report of lavaan model.
lavaan_summary(
lavaan,
ci = c("raw", "boot", "bc.boot", "bca.boot"),
nsim = 100,
seed = NULL,
digits = 3,
print = TRUE,
covariance = FALSE,
file = NULL
)
lavaan |
Model object fitted by |
ci |
Method for estimating standard error (SE) and 95% confidence interval (CI). Defaults to
|
nsim |
Number of simulation samples (bootstrap resampling)
for estimating SE and 95% CI.
In formal analyses, |
seed |
Random seed for obtaining reproducible results. Defaults to |
digits |
Number of decimal places of output. Defaults to |
print |
Print results. Defaults to |
covariance |
Print (co)variances. Defaults to |
file |
File name of MS Word ( |
Invisibly return a list of results:
fit
Model fit indices.
measure
Latent variable measures.
regression
Regression paths.
covariance
Variances and/or covariances.
effect
Defined effect estimates.
PROCESS
, CFA
## Simple Mediation:
## Solar.R (X) => Ozone (M) => Temp (Y)
# PROCESS(airquality, y="Temp", x="Solar.R",
# meds="Ozone", ci="boot", nsim=1000, seed=1)
model = "
Ozone ~ a*Solar.R
Temp ~ c.*Solar.R + b*Ozone
Indirect := a*b
Direct := c.
Total := c. + a*b
"
lv = lavaan::sem(model=model, data=airquality)
lavaan::summary(lv, fit.measure=TRUE, ci=TRUE, nd=3) # raw output
lavaan_summary(lv)
# lavaan_summary(lv, ci="boot", nsim=1000, seed=1)
## Serial Multiple Mediation:
## Solar.R (X) => Ozone (M1) => Wind(M2) => Temp (Y)
# PROCESS(airquality, y="Temp", x="Solar.R",
# meds=c("Ozone", "Wind"),
# med.type="serial", ci="boot", nsim=1000, seed=1)
model0 = "
Ozone ~ a1*Solar.R
Wind ~ a2*Solar.R + d12*Ozone
Temp ~ c.*Solar.R + b1*Ozone + b2*Wind
Indirect_All := a1*b1 + a2*b2 + a1*d12*b2
Ind_X_M1_Y := a1*b1
Ind_X_M2_Y := a2*b2
Ind_X_M1_M2_Y := a1*d12*b2
Direct := c.
Total := c. + a1*b1 + a2*b2 + a1*d12*b2
"
lv0 = lavaan::sem(model=model0, data=airquality)
lavaan::summary(lv0, fit.measure=TRUE, ci=TRUE, nd=3) # raw output
lavaan_summary(lv0)
# lavaan_summary(lv0, ci="boot", nsim=1000, seed=1)
model1 = "
Ozone ~ a1*Solar.R
Wind ~ d12*Ozone
Temp ~ c.*Solar.R + b1*Ozone + b2*Wind
Indirect_All := a1*b1 + a1*d12*b2
Ind_X_M1_Y := a1*b1
Ind_X_M1_M2_Y := a1*d12*b2
Direct := c.
Total := c. + a1*b1 + a1*d12*b2
"
lv1 = lavaan::sem(model=model1, data=airquality)
lavaan::summary(lv1, fit.measure=TRUE, ci=TRUE, nd=3) # raw output
lavaan_summary(lv1)
# lavaan_summary(lv1, ci="boot", nsim=1000, seed=1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.