Announcement

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

  • Reporting Wild Bootstrap Standard Errors with Estab

    Hi all, I am running the code below using wildbootstrap but I have noticed that the table that comes out of this code reports the wrong significance level. Let me explain: when I run the wildbootstrap regression some coefficient are not statistically significant, but in the table I get the starts and coefficients I would get if I ran a normal reg. Can someone help me figure this out, please?

    local tablename "Thelist1"
    local table=1
    local col=1
    estimates clear

    quietly wildbootstrap reg birth ib1.Shock_lag##c.lag_TR children_lag i.province i.year if no_child==0, cluster(province) rseed(12345) coefficients(i.Shock_lag lag_TRShock_lag#c.lag_TR)
    quietly estadd local children "Yes", replace
    quietly estadd local fixedy "Yes", replace
    quietly estadd local fixedw "No", replace
    quietly estadd local fixedp "Yes", replace
    quietly estadd local agewoman "No", replace
    quietly estadd local controls "No", replace
    estimates store cT`table'C`col++'

    quietly wildbootstrap reg birth ib1.Shock_lag##c.lag_TR age_woman children_lag i.province i.year i.country if no_child==0, cluster(province) rseed(12345) coefficients(i.Shock_lag lag_TRShock_lag#c.lag_TR)
    quietly estadd local children "Yes", replace
    quietly estadd local fixedy "Yes", replace
    quietly estadd local fixedw "Yes", replace
    quietly estadd local fixedp "Yes", replace
    quietly estadd local agewoman "Yes", replace
    quietly estadd local controls "No", replace
    estimates store cT`table'C`col++'

    quietly wildbootstrap reg birth ib1.Shock_lag##c.lag_TR children_lag age_woman WealthIndex Education age_sq PartnerEdu urban i.province i.year i.country if no_child==0, cluster(province) rseed(12345) coefficients(i.Shock_lag lag_TRShock_lag#c.lag_TR)
    quietly estadd local children "Yes", replace
    quietly estadd local fixedy "Yes", replace
    quietly estadd local fixedw "Yes", replace
    quietly estadd local fixedp "Yes", replace
    quietly estadd local agewoman "Yes", replace
    quietly estadd local controls "Yes", replace
    estimates store cT`table'C`col++'

    quietly wildbootstrap reg birth ib1.Shock_lag##c.lag_TR age_woman WealthIndex Education age_sq PartnerEdu urban i.province i.year i.country if no_child==0, cluster(province) rseed(12345) coefficients(i.Shock_lag lag_TRShock_lag#c.lag_TR)
    quietly estadd local children "No", replace
    quietly estadd local fixedy "Yes", replace
    quietly estadd local fixedw "Yes", replace
    quietly estadd local fixedp "Yes", replace
    quietly estadd local agewoman "Yes", replace
    quietly estadd local controls "Yes", replace
    estimates store cT`table'C`col++'

    #delimit ;
    esttab cT`table'C* using "${path}/standardizedBootstrap.tex",
    se(3) /// SE with 3 Decimal Places
    b(3) /// Coefficients with 2 Decimal Places
    replace label star(* 0.10 ** 0.05 *** 0.01)
    mgroups("Any birth of a child child in t", pattern(1 0 0 0 0)
    prefix(\multicolumn{@span}{c}{) suffix(})
    span erepeat(\cmidrule(lr){@span}))
    nomtitles
    keep(0.Shock_lag 2.Shock_lag 3.Shock_lag lag_TR0.Shock_lag#c.lag_TR2.Shock_lag#c.lag_TR3.Sh ock_lag#c.lag_TR
    interaction(" $\times$ ")style(tex)
    unstack ///Vertical from Stata to Diff Columns
    booktabs ///Top, Mid, Bottom Rule
    obslast nonotes
    scalars("children Children in t-1" "fixedy Year Fixed Effects" "fixedw Wave Fixed Effects" "fixedp Province Fixed Effects" "agewoman Age Woman" "controls Controls" ) sfmt(0 0 3)
    ;

  • #2
    esttab is from SSC (FAQ Advice #12). wildbootstrap does not output standard errors. Consider:

    Code:
    webuse wagework, clear
    wildbootstrap regress wage tenure, cluster(personid) rseed(12345)
    Res.:

    Code:
    . wildbootstrap regress wage tenure, cluster(personid) rseed(12345)
    
    Performing 1,000 replications for p-value for tenure = 0 ...
    Computing confidence interval for tenure
      Lower bound: .........10.........20. done (21)
      Upper bound: .........10....... done (17)
    
    Wild cluster bootstrap                             Number of obs      = 1,928
    Linear regression                                  Number of clusters =   589
                                                       Cluster size:
    Cluster variable: personid                                        min =     1
    Error weight: Rademacher                                          avg =   3.3
                                                                      max =     4
    -----------------------------------------------------------------------------
                        wage |   Estimate      t  p-value    [95% conf. interval]
    -------------------------+---------------------------------------------------
    constraint               |
                  tenure = 0 |   .7807403   27.19   0.000    .7209754    .8368386
    -----------------------------------------------------------------------------
    The reason for using bootstrapping, including the wild bootstrap, is to avoid relying on the assumption that the sampling distribution of the estimator is normally distributed (or follows a t-distribution), which may not hold in small samples or in the presence of heteroskedasticity or other violations of standard assumptions. You therefore can report the wild bootstrap confidence intervals and define a separate matrix of p-values for esttab.

    Comment


    • #3
      Thank you! How can I report the CI for the wild bootstrap using esttab then?

      Comment


      • #4
        You would need to change the highlighted parts to correspond to specific estimates.

        Code:
        webuse wagework, clear
        estimates clear
        eststo m1: wildbootstrap regress wage tenure year, cluster(personid) rseed(12345)
        mat bootp= r(table)["pvalue", 1...], .z
        mat bootll=r(table)["ll", 1...], .z
        mat bootul=r(table)["ul", 1...], .z
        mat bootend= J(rowsof(e(b)), colsof(e(b)), 1)
        foreach stat in p ll ul end{
            mat colnames boot`stat'= `:colnames e(b)'
            estadd mat boot`stat'= boot`stat': m1
        }
        
        esttab m1, cells(b(star pvalue(bootp) fmt(a3)) bootll(par("["))&bootul&bootend(par("]"))) ///
        substitute (" ]1" "]") label collab(none) nonumb drop(_cons) ///
        starlevels( * 0.10 ** 0.05 *** 0.010) ///
        addnote("Wild bootstrap confidence intervals in brackets" "* p<0.10, ** p<0.05, *** p<0.01")
        Res.:

        Code:
        . eststo m1: wildbootstrap regress wage tenure year, cluster(personid) rseed(12345)
        
        Performing 1,000 replications for p-value for tenure = 0 ...
        Computing confidence interval for tenure
          Lower bound: .........10.........20.. done (22)
          Upper bound: .........10.........20. done (21)
        
        Performing 1,000 replications for p-value for year = 0 ...
        Computing confidence interval for year
          Lower bound: .........10.........20.. done (22)
          Upper bound: .........10.........20. done (21)
        
        Wild cluster bootstrap                             Number of obs      = 1,928
        Linear regression                                  Number of clusters =   589
                                                           Cluster size:
        Cluster variable: personid                                        min =     1
        Error weight: Rademacher                                          avg =   3.3
                                                                          max =     4
        -----------------------------------------------------------------------------
                            wage |   Estimate      t  p-value    [95% conf. interval]
        -------------------------+---------------------------------------------------
        constraints              |
                      tenure = 0 |   .7855733   27.54   0.000    .7249049    .8418721
                        year = 0 |   .2030197    4.14   0.000    .0989685    .3013993
        -----------------------------------------------------------------------------
        
        .
        . esttab m1, cells(b(star pvalue(bootp) fmt(a3)) bootll(par("["))&bootul&bootend(par("]"))) ///
        > substitute (" ]1" "]") label collab(none) nonumb drop(_cons) ///
        > starlevels( * 0.10 ** 0.05 *** 0.010) ///
        > addnote("Wild bootstrap confidence intervals in brackets" "* p<0.10, ** p<0.05, *** p<0.01")
        
        ------------------------------------
                              Hourly wage   
        ------------------------------------
        Job tenure                  0.786***
                             [0.725 0.842]   
        Year                        0.203***
                             [0.0990 0.301]   
        ------------------------------------
        Observations                 1928   
        ------------------------------------
        Wild bootstrap confidence intervals in brackets
        * p<0.10, ** p<0.05, *** p<0.01
        Last edited by Andrew Musau; 30 Jul 2024, 08:15.

        Comment

        Working...
        X