Announcement

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

  • Output Adjusted R-squared using Newey

    Hello,
    I'm running the following regression:


    newey y1 x1 x2 , lag(12)
    estimates store model1
    newey y2 x1 x2 , lag(12)
    estimates store model2

    esttab model1 model2 using C:\Users\...\result.csv, b(2) t(2) ar2 star(* 0.1 ** 0.05 *** 0.01)

    I can't retrieve the adjusted R-square for some reason. How can I get Stata to output R-squared along with the coefficient and t-statistic? Thank you!

  • #2
    esttab is from Stata Journal and is authored by Ben Jann. You are asked to identify the source of user-written commands. newey does not output an R-squared or adjusted R-squared statistic, so you will have to pick these from the equivalent OLS regression. My suggestion is to store the statistic in a local macro and then add it to the newey estimation results.

    Code:
    webuse idle2
    tsset time
    *EQUIVALENT OLS REGRESSION
    qui regress usr idl
    *STORE R2 STATISTIC
    local r2= e(r2)
    *REGRESSION WITH NEWEY-WEST S.E.
    eststo: newey usr idle, lag(3)
    *ADD TO ESTIMATION RESULTS
    estadd scalar r2= `r2'
    esttab, stats(r2 N, fmt(%9.3f %9.0g) labels(R-squared Observations)) label
    Note that adjusted R-squared is stored at e(r2_a) in the regress estimation results.

    Code:
    . esttab, stats(r2 N, fmt(%9.3f %9.0g) labels(R-squared Observations)) label
    
    ------------------------------------
                                  (1)  
                                  usr  
    ------------------------------------
    idle                       -0.228**
                              (-3.30)  
    
    Constant                    23.13**
                               (3.66)  
    ------------------------------------
    R-squared                   0.501  
    Observations                   30  
    ------------------------------------
    t statistics in parentheses
    * p<0.05, ** p<0.01, *** p<0.001
    Last edited by Andrew Musau; 28 Oct 2018, 07:39.

    Comment


    • #3
      Thanks again Dr. Musau!

      Comment

      Working...
      X