Announcement

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

  • R2 and Delta R2.

    Hello!

    When doing a normal robusted linear regression, I get the R-squared value but I would like to get the Delta R-square. Where do I get it?

    Thank you!

  • #2
    "Delta R squared" would be the change in R2 from two different regressions, you can't get that from a single regression. To get it from two regressions:

    Code:
    sysuse auto, clear
    * Regression 1
    reg price mpg, r
    * Store R squared in global
    glo r2_1=e(r2)
    * Same for regression 2
    reg price mpg turn, r
    glo r2_2=e(r2)
    * Calculate delta
    glo delta_r2=$r2_2 - $r2_1
    * Display
    di "Delta R2 = ${delta_r2}"
    Jorge Eduardo Pérez Pérez
    www.jorgeperezperez.com

    Comment


    • #3
      What do you mean by

      [quote]
      a normal robusted linear regression
      [/code]

      Do you mean some technique dealing with "outliers" (see rreg), or do you refer to corrected standard errors? In the latter case, Jorge's example can be replicated with Stata's nestreg prefix.

      Code:
      sysuse auto , clear
      nestreg : reg price mpg turn , vce(robust)
      This approach makes sure you are using the same sample for all models and also provides significance levels for the changes.

      Best
      Daniel

      Comment


      • #4
        Perfect! It works! Thank you very much!

        Comment


        • #5
          Jorge, I used your technique and it works perfectly. Is there a way to get the significance level of the delta R-squared within that same command? Thank you again for your help!

          Comment


          • #6
            Testing for statistical differences in R squared doesn't make sense. See for example:

            http://www.stata.com/statalist/archi.../msg01101.html

            Also remember that R squared always increases when you add a variable to the regression model. A simple alternative is to simply test the variables you added in the second model with a Wald test.

            Jorge Eduardo Pérez Pérez
            www.jorgeperezperez.com

            Comment


            • #7
              Do you mean that the delta R-square doesn't make sense? I will try the Wald test. But I saw in some research papers that authors specify if their Delta is significant or not. The nestreg command seems to give the output but I wanted to know if I could get the same with your recommended command.

              Comment


              • #8
                The output you get from nestreg are precisely Wald tests, testing if the coefficients for the variables you added in the second regression are zero. This is analogous to testing if they add an statistically significant amount of model fit, which is what you're looking at when you look at the differences in R squared.

                You can get Wald test results in my example, by using test after each regression. These are the same results that nestreg returns. I think that nestreg
                is more convenient, as daniel klein pointed out.

                Code:
                sysuse auto, clear
                * Regression 1
                reg price mpg, r
                * Wald test for regressors here
                test mpg
                * Store R squared in global
                glo r2_1=e(r2)
                * Same for regression 2
                reg price mpg turn, r
                * Wald test for added regressor
                test turn
                glo r2_2=e(r2)
                * Calculate delta
                glo delta_r2=$r2_2 - $r2_1
                * Display
                di "Delta R2 = ${delta_r2}"
                * nestreg yields same results
                nestreg: reg price mpg turn, robust


                Strictly speaking, R squared does have a sampling distribution (see for example http://davegiles.blogspot.ca/2013/10...ared.html#more), but doing Wald tests is much easier.
                Jorge Eduardo Pérez Pérez
                www.jorgeperezperez.com

                Comment

                Working...
                X