Announcement

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

  • Exporting boottest output

    I am using the boottest command for wild cluster standard errors. I am running a foreach loop with multiple dependent variables and exporting with outreg 2 for the coefficients and it'd be great to export the confidence intervals and p-values from the boottest to the same table.
    How do I export these? outreg2 seems to ignore the boottest after my regressions. Is there some sort of macro I could run, or something with estout?

    Here is the boottest command I am running: boottest post_treated , cluster (istate) bootclust (istate) boottype(wild) nograph seed(991)
    Here is what the output looks like:

    Wild bootstrap-t, null imposed, 999 replications, Wald test, clustering by istate, bootstrap clustering by istate, Rademacher weights:
    post_treated

    t(13) = 2.0053
    Prob>|t| = 0.1281

    95% confidence set for null hypothesis expression: [-.01332, .1545]


    First time poster so let me know if there is anything that I need to include that I did not. Thank you!

  • #2
    Have you looked at Ben Jann's -estadd- command? If you've installed -estout-, you should have this as well. As you'll see from -help estadd-, you can use -estadd- to add saved results to what is already stored from the model ... and then use -estout-

    Here follows the output from running the first few lines of code in the -boottest- help file Examples. Notice the saved results in r() at the end ...

    Code:
    . webuse nlsw88, clear
    (NLSW, 1988 extract)
    
    . use http://web.archive.org/web/20150802214527/http://faculty.econ.ucdavis.edu/~dlmiller/statafiles/collapsed
    
    . regress hasinsurance selfemployed post post_self, cluster(year)
    
    Linear regression                               Number of obs     =         16
                                                    F(3, 7)           =     531.32
                                                    Prob > F          =     0.0000
                                                    R-squared         =     0.9863
                                                    Root MSE          =     .00945
    
                                       (Std. Err. adjusted for 8 clusters in year)
    ------------------------------------------------------------------------------
                 |               Robust
    hasinsurance |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    selfemployed |  -.1567677   .0046412   -33.78   0.000    -.1677423   -.1457931
            post |  -.0206586   .0037009    -5.58   0.001    -.0294098   -.0119075
       post_self |   .0548578   .0073574     7.46   0.000     .0374602    .0722553
           _cons |   .8740288    .001679   520.55   0.000     .8700585    .8779991
    ------------------------------------------------------------------------------
    
    . boottest post_self=.04
    
    Warning: with 8 Clusters, the number of replications, 999, exceeds the universe of Rademacher draws, 2^8 = 256. Sampling each once. 
    Consider Webb weights instead, using weight(webb).
    ..........................
    
    Wild bootstrap-t, null imposed, 256 replications, Wald test, bootstrap clustering by year, Rademacher weights:
      post_self=.04
    
                                            t(7) =     2.0194
                                        Prob>|t| =     0.0703
    
    95% confidence set for null hypothesis expression: [.03821, .07128]
    
    . return list
    
    scalars:
                   r(reps) =  256
                   r(null) =  1
                  r(level) =  95
                      r(p) =  .0703125
                     r(df) =  1
                   r(df_r) =  7
                      r(F) =  4.078059774419948
                      r(t) =  2.019420653162671
    
    macros:
              r(clustvars) : "year"
               r(boottype) : "wild"
             r(weighttype) : "rademacher"
              r(statistic) : "t"
                 r(robust) : "robust"
                   r(seed) : "XAA000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.."
    
    matrices:
                     r(CI) :  1 x 2
                   r(peak) :  1 x 2
                   r(plot) :  25 x 2
                      r(V) :  1 x 1
                      r(b) :  1 x 1
    Welcome to Statalist. Please take a moment to look at the Forum FAQ (hit the black bar at top of page) and note the recommendation to use -dataex- to post code and output.

    Comment


    • #3
      Thank you! Is there a way to also get the confidence interval that boottest shows? I am not seeing it in the saved results when I enter return list.

      Comment


      • #4
        From Stephen's example in #2

        Code:
        mat l r(CI)

        Comment


        • #5
          Dear all,

          Apologies for reviving this thread. Is there a way to save the lower and upper bound of the CI generated by boottest as separate scalars?

          Thanks!

          Comment


          • #6
            Sorry, just found the answer here: https://www.statalist.org/forums/for...-with-booteset

            Comment

            Working...
            X