Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bootstrap post-estimation Craggit model

    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
Working...
X