Hi there, I am needing to use Cragg's Double Hurdle Model, and using the Craggit command. However, I'm using Burke's 2009 treatment of the command (APE boot) to estimate my actual parameters of interest and to bootsrapt standard errors.
But, crucially, I don't know how to access the co-efficients and standard errors from my bootstrapping to create a table for exporting! My code is below. I would love to know how I might get the estimates for tabulation, but also open to other ways to generate the standard errors.
program define APEboot, rclass
preserve
*generating the parameter estimates used to calculate the APE from the overall model for the E(y|y>0) and Pr(y>0)
craggit dum_attend treat, second(prop_attend treat) vce(robust)
predict bsx1g, eq(Tier1)
predict bsx2b, eq(Tier2)
predict bssigma, eq(sigma)
generate bsIMR = normalden(bsx2b/bssigma)/normal(bsx2b/bssigma)
*The estimates for each model below
gen bsdPw1_dtreat = [Tier1]_b[treat]*normalden(bsx1g)
gen bsdEyyx2_dtreat = [Tier2]_b[treat]*(1-bsIMR*(bsx2b/bssigma+bsIMR))
gen bsdEy_dtreat = ///
[Tier1]_b[treat]*normalden(bsx1g)*(bsx2b+bssigma*bsIMR) ///
+[Tier2]_b[treat]*normal(bsx1g)*(1-bsIMR*(bsx2b/bssigma+bsIMR))
*creating the ape matrices for bootstrapping
su bsdPw1_dtreat
return scalar ape_Pw1_dtreat = r(mean)
matrix ape_Pw1_dtreat = r(ape_Pw1_dtreat)
su bsdEyyx2_dtreat
return scalar ape_Eyyx2_dtreat = r(mean)
matrix ape_Eyyx2_dtreat = r(ape_Eyyx2_dtreat)
su bsdEy_dtreat
return scalar ape_dEy_dtreat = r(mean)
matrix ape_dEy_dtreat = r(ape_dEy_dtreat)
restore
end
*generating the ape estimates using bootstrapping
bootstrap ape_Pw1_dtreat = r(ape_Pw1_dtreat), reps(100): APEboot
bootstrap ape_Eyyx2_dtreat = r(ape_Eyyx2_dtreat), reps(100): APEboot
bootstrap ape_dEy_dtreat = r(ape_dEy_dtreat), reps(100): APEboot
program drop APEboot
Related Posts with Bootstrap post-estimation Craggit model
missing pseudo R-squareds using -reghdfe-Hi, Everyone, I met a problem when using -reghdfe- command. in the regression I include three inter…
How to deal with categorical variable (a group of dummy vars) in Multilevel model?Hi there, I'm working on a dataset with individual-level and school-level variables using multileve…
ppml_panel_sg and r(3203)Hello, I am analyzing the impact of tariffs on trade using ppml_panel_sg, and an r(3203) error some…
Dummies on filter events scores and frequency Hello stata users, I am having a panel of groups and need to filter them to positive and not posi…
Can parametric and non-parametric tests lead to different results?This may be a basic econometrics question but I cannot find an answer. I know under what conditions …
Subscribe to:
Post Comments (Atom)
0 Response to Bootstrap post-estimation Craggit model
Post a Comment