below I have run a Monte Carlo simulation in order to obtain CI's which I can use to infer wether or not the indirect effect of my mediation analysis is significant. However, I would prefer doing the same with bootstrapped CI's. Could anyone be so kind to provide a code / hint how I can code it for the same procedure:
The coefficients b4 and b5 are the coefficients from the two regressions conducted "along the indirect path" for the mediation. Standard errors are marked in red and coefficients in blue, to make it clearer to understand what I have coded:
Code:
. set obs 5000 number of observations (_N) was 2,651, now 5,000 . gen b4 = (invnorm(uniform())*.0329509)+-.0263693 . gen b5 = (invnorm(uniform())*.1144345)+-.0705507 . gen CI_1D = b4*b5 . centile CI_1D, centile(2.5 97.5) -- Binom. Interp. -- Variable | Obs Percentile Centile [95% Conf. Interval] -------------+------------------------------------------------------------- CI_1D | 5,000 2.5 -.0072381 -.0077505 -.0067966 | 97.5 .015011 .0142704 .0158532
0 Response to Code for bootstrapped CI for inference about mediation
Post a Comment