Announcement

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

  • Exporting/displaying boottest results

    Hi everyone,

    I am running a difference in differences regression with Panel data on Stata version 14.2.

    I have state-level clustered standard errors, but since there are only 32 states in my data I want to use bootstrapping to correct for bias in the standard errors.
    Since I am using survey data I need to include weights [pweight]. These are, however, incompatible with the bootstraps option after reg.

    I was recommended the boottest command, but I have trouble getting the results out of Stata into a table.

    I run the following code:

    Code:
     reg violence treat i.state i.year [pweight=factor] if year>2003, cluster(ent)      
    
    matrix v = e(V)    
    matrix b = e(b)      
    
    boottest treat=0, boottype(wild) seed(22)    
    matrix v[1,1] = (_b[treat]/r(t))^2          
    
    eststo: ereturn post b v    
    sum violence if year>2003    
    local N    = r(N)    
    local mean = r(mean)      
    estadd scalar m  = `mean'    
    estadd scalar obs     = `N'      
    
    #delimit ;
    esttab, b(%-9.3f) se(%-9.3f) noobs keep(treat) nonotes nogaps
    mlabels(, none) nonumbers style(tex) fragment replace noline
    label stats(obs m, fmt(%9.0gc %5.3f)
    label("\\ Observations" "Mean of Dependent Variable"));
    
    #delimit cr
    I get the following error message after the line
    Code:
       eststo: ereturn post b v
    last estimation results not found, nothing to store r(301);
    .


    Any idea how to fix this? I have been trying around with eststo and naming my estimation but all I get Stata to display is the coefficient&standard error from the OLS regression.


    Any help is greatly appreciated.

    Mia
    Last edited by Mia Hoffmann; 14 May 2019, 08:22. Reason: Edited for formating reasons & legibility

  • #2
    boottest is from SSC, authored by David Roodman. Two points:

    1. Present a data example using dataex where we can run your code.
    2. Specify what results you need to retrieve.

    Comment


    • #3
      Hi Andrew, thank you for your advice.

      It turns out I won't need to use bootstrapping for my standard errors after all, so my problem solved itself!

      Comment

      Working...
      X