Dear statalisters,
I am trying to run a mediation analysis with 2 indepvars, 5 mediators and 1 depvar using SEM. I would like to extract the bootstrapped indirect effects of each indepvar through each mediator.
my syntax sofar is:
sem (indepvar1 indepvar2 mv1-mv5 -> depvar) (indepvar1-> mv1-mv5 depvar) (indepvar2 -> mv1-mv5 depvar), nocapslatent vce(bootstrap, reps(5000))
estat teffects
here I get the bootstrapped teffects, indireffect and direffects, but I would like to decompose the indireffects.
I tried using nlcom as follows
nlcom _b[mv1:indepvar1] *_b[depvar:mv1]
..and so forth for each coefficient pair.
I understood that nlcom uses coefficients as constants, in fact the products I get have 95%ci rather than normal-based ci.
I have read previous posts addressing similar questions, but since I am not familiar with matrices nor programming, I could not adapt some syntax I found to my case, for example the following syntax using sureg
capture program drop bootmm
program bootmm, rclass
syntax [if] [in]
sureg (read math)(write math)(science read write math) `if' `in'
return scalar indread = [read]_b[math]*[science]_b[read]
return scalar indwrite = [write]_b[math]*[science]_b[write]
return scalar indtotal = [read]_b[math]*[science]_b[read]+[write]_b[math]*[science]_b[write]
end
bootstrap r(indread) r(indwrite) r(indtotal), bca reps(5000): bootmm
So my question is: should I write a program, and in this case could anyone help please? or is there a different strategy I am missing?
thank you in advance,
Rudy
Related Posts with bootstrapped indirect effects through multiple mediators using sem
Error uninstalling a package: Criterion matches more than one packageDavid Roodman posted yesterday a discussion of xtabond2, contributed by him I installed the package …
Exporting shapefiles with nonconsecutive, multipart polygons using GeotoolsI am using the -geotools- command to export polygon features to an ESRI shapefile. The input geograp…
Minimize under a restriction (in each individual)I wanna to find individual values to minimize an outcome in a restriction. *variables - fac1, ..., …
Coefplot with multiple models to show change over time horizontallyHello, I'm trying to plot concertation indices for 5 variables obtained from separate linear regres…
Deriving ISEI from ISCO-08 and ISCO-88 with 2 digits. Is it possible?Hi there! I have a dataset covering 14 years, and I have isco88 and isco08 with only 2 digits for t…
Subscribe to:
Post Comments (Atom)
0 Response to bootstrapped indirect effects through multiple mediators using sem
Post a Comment