Bootstrapping using binary outcomes

38 views
Skip to first unread message

hanmin htetaung

unread,
Sep 23, 2024, 1:39:22 PM9/23/24
to lavaan
Hello!
I am a new user of R and I encounter problem in bootstrapping with my model.
All exogenous and endogenous and mediator variables are binary outcomes. I tried according to the solution by adding "se = "bootstrap", estimator = "DWLS", verbose = TRUE" but it still does not work.
Kindly request your suggestions and advice on it. Thank you for your time.
Here is my code
model19 <-'ls ~ a1*participation1 + health_status
        health_status ~ a2*participation1
        hsu~ d1*ls + d2*health_status +c1*participation1 +e1*rural + e2*female +
        e3*middle+e4*oldest+e5*primary+e6*secondary+e7*higher+e8*married+
        e9*all+e10*employ+e11*support+e12*pension
        indirect1:=a1*d1
        indirect2:=a2*d2
        overallindirect:= indirect1+ indirect2
        total:=overallindirect +c1+e1+e2+e3+e4+e5+e6+e7+e8+e9+e10+e11+e12'
fit19 <- sem(model19, data = old_main, ordered = c("hsu", "ls", "health_status"),
             se = "bootstrap", estimator = "DWLS", verbose = TRUE)
summary(fit19, standardized=TRUE, ci=TRUE, fit.measures=TRUE)

Terrence Jorgensen

unread,
Oct 2, 2024, 6:19:08 AM10/2/24
to lavaan
I tried according to the solution by adding "se = "bootstrap"

Your example calculates indirect effects.  If you are trying to use bootstrapping for inference, then you should be aware that setting se="bootstrap" still assumes a normal sampling distribution.  Only the SE estimate itself is calculated from the empirical bootstrap distribution.  You can use this package to obtain bootstrap CI, which is the usual recommendation.  Alternatively, a parametric bootstrap is available in the semTools package (see the ?monteCarloCI help page for examples and a reference to read).

it still does not work.

What do you mean "does not work"?  Please provide your output, or ideally a reprex so someone is able to try tracking down the issue.

Terrence D. Jorgensen    (he, him, his)
Assistant Professor, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam
http://www.uva.nl/profile/t.d.jorgensen


Reply all
Reply to author
Forward
0 new messages