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
Dropping Observations by using if commandI have the daily return datasets for various companies from 1996 to 2021 (example of dataset attache…
Latent Class Model in STATA using lclogit__Error happenedhello? I am a novice to STATA. After conjoint analysis, A problem occurred during Latent Class Anal…
META -ANALYSES negative value of a confidence interval - How to explain???Hi to everybody, I use the command metaprop (My effect size is "Prevalence of a skin disease") S…
Difference between clustering and fixed effects/adding control variables into the regressionI have observational data that was collected within the same year but on different days and in diffe…
Is there a way to export -sum- outputs to a tex file?I tried using the SSC command -estout- but unfortunately this command only seems to work with regres…
Subscribe to:
Post Comments (Atom)
0 Response to Bootstrap post-estimation Craggit model
Post a Comment