Hello
I am trying to test for a mediation effect using the gsem and boostrapping.
I am consistently running into a problem where the bootstrapping returns a series of 'x's with the message:
insufficient observations to compute bootstrap standard errors
no results will be saved
Looking at related posts, I think there must be something with my code, but I cannot figure out what the problem is.
Below are my codes.
If anyone can provide wisdom on this matter, it would be greatly appreciated.
Many thanks in advance.
I am trying to test for a mediation effect using the gsem and boostrapping.
I am consistently running into a problem where the bootstrapping returns a series of 'x's with the message:
insufficient observations to compute bootstrap standard errors
no results will be saved
Looking at related posts, I think there must be something with my code, but I cannot figure out what the problem is.
Below are my codes.
If anyone can provide wisdom on this matter, it would be greatly appreciated.
Many thanks in advance.
Code:
global key_control2 "L2.ln_at L2.ln_firmage L2.tobinq L2.sgrowth L2.unabsorbedslack L2.exploratoryratio L2.comp2_w L2.ln_total_env_viol_amount L2.toxic" capture program drop boot1 program boot1, rclass gsem (L1.ln_invest2 <- L2.tran_risk_pro_w_std $key_control2 i.gvkey i.year)(tobinq <- L1.ln_invest2 L2.tran_risk_pro_w_std $key_control2 i.gvkey i.year) if sample==1 return scalar IV_indirect = (_b[tobinq:L1.ln_invest2]*_b[L1.ln_invest2:L2.tran_risk_pro_w_std]) return scalar IV_direct = (_b[tobinq:L2.tran_risk_pro_w_std]) return scalar IV_total = (_b[tobinq:L2.tran_risk_pro_w_std]+_b[tobinq:L1.ln_invest2]*_b[L1.ln_invest2:L2.tran_risk_pro_w_std]) return scalar Mediator_direct = (_b[tobinq:L1.ln_invest2]) end bootstrap r(IV_indirect) r(IV_direct) r(IV_total) r(Mediator_direct), seed(12345) reps(500) nodrop: boot1 estat boot, bc percentile
Comment