Announcement

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

  • All Cooks D values are all over 1 after running rreg-- do I need to divide values by 100?

    I am running Stata/IC 14.2.

    I ran a robust regression "rreg" on a dataset with 133 observations. When I went to examine Cooks D using "predict cooksd", I noticed that all the values were over 1. 1 is the cutoff that many websites give for considering an observation an outlier. Should I assume all of the Cooks D values need to be divided by 100?

    Kind regards,

    Kristen

  • #2
    I don't think so. That's a bit like imagining that your income should be multiplied by 100 because it looks a bit low.

    Less facetiously, and very seriously, I would abandon rreg completely and use modern robust regression. Searching the forum for mentions of rreg will give a bundle of good reasons.

    Comment


    • #3
      Kristen, here's a relevant Stata Journal article: Type findit mmregress in the Command window to find and install mmregress.
      --
      Bruce Weaver
      Email: [email protected]
      Version: Stata/MP 18.5 (Windows)

      Comment


      • #4
        Thank you both for suggesting alternative robust regression models. I will try these.

        Comment


        • #5
          I was able to run mmregress, and similar to rreg the cooksD values are very high---ranging from 7-19. Is there a reason why robust regression would lead to large cooksD values?

          Comment


          • #6
            How did you calculate Cook's D after mmregress? I am getting that it's not supported. (I am not sure that it's even defined.)

            Comment


            • #7
              After running the "mmregress" command, my next command was "predict cooksd". I did not get an error message. I tried it again just now and it produced the same high cooks d values. I am running Stata 14.2.

              Comment


              • #8
                Thank you for your responses.

                Comment


                • #9
                  I guess that the predict Cooks D output is not for rreg or mmregress but rather for a command you did not mention: regress. Per FAQ 12.1: Say exactly what you typed and exactly what Stata typed (or did) in response.

                  Comment


                  • #10
                    Kristen said in #7 that she issued the predict cooksd command immediately after mmregress. The problem is that predict cooksd is not the command to save Cook's D. It is saving the fitted values to a variable called cooksd. The command to save Cook's D is predict varname, cooksd. And apparently, it does not work following mmregress. Try the following.

                    Code:
                    clear
                    sysuse auto
                    regress mpg price weight displacement
                    predict yhat1a
                    predict yhat1b, xb // Should be identical to yhat1a
                    predict c1, cooksd
                    
                    generate abdiff1 = yhat1a-yhat1b
                    summarize abdiff1
                    
                    mmregress mpg price weight displacement
                    predict yhat2a
                    predict yhat2b, xb
                    *predict c2, cooksd // This line causes an error--uncomment it to see.
                    * option cooksd not allowed
                    * r(198);
                    
                    generate abdiff2 = yhat2a-yhat2b
                    summarize abdiff2
                    
                    generate diff12 = yhat1a-yhat2a
                    summarize diff12
                    Output:
                    Code:
                    . clear
                    . sysuse auto
                    (1978 Automobile Data)
                    
                    . regress mpg price weight displacement
                    
                          Source |       SS           df       MS      Number of obs   =        74
                    -------------+----------------------------------   F(3, 70)        =     44.23
                           Model |  1599.61376         3  533.204588   Prob > F        =    0.0000
                        Residual |  843.845694        70  12.0549385   R-squared       =    0.6547
                    -------------+----------------------------------   Adj R-squared   =    0.6399
                           Total |  2443.45946        73  33.4720474   Root MSE        =     3.472
                    
                    ------------------------------------------------------------------------------
                             mpg |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
                    -------------+----------------------------------------------------------------
                           price |  -.0000966   .0001636    -0.59   0.557     -.000423    .0002297
                          weight |  -.0063909    .001209    -5.29   0.000    -.0088022   -.0039796
                    displacement |   .0054824    .009921     0.55   0.582    -.0143044    .0252693
                           _cons |   40.10848   2.029845    19.76   0.000     36.06008    44.15687
                    ------------------------------------------------------------------------------
                    
                    . predict yhat1a
                    (option xb assumed; fitted values)
                    
                    . predict yhat1b, xb // Should be identical to yhat1a
                    
                    . predict c1, cooksd
                    
                    .
                    . generate abdiff1 = yhat1a-yhat1b
                    
                    . summarize abdiff1
                    
                        Variable |        Obs        Mean    Std. Dev.       Min        Max
                    -------------+---------------------------------------------------------
                         abdiff1 |         74           0           0          0          0
                    
                    .
                    . mmregress mpg price weight displacement
                    The total number of p-subsets to check is 20
                    ------------------------------------------------------------------------------
                             mpg |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
                    -------------+----------------------------------------------------------------
                           price |  -.0002712   .0000859    -3.16   0.002    -.0004425   -.0000999
                          weight |  -.0055033   .0005589    -9.85   0.000     -.006618   -.0043885
                    displacement |   .0080406    .005265     1.53   0.131    -.0024601    .0185413
                           _cons |   36.93385   1.147421    32.19   0.000     34.64539    39.22231
                    ------------------------------------------------------------------------------
                    Scale parameter=  1.815232
                    
                    . predict yhat2a
                    
                    . predict yhat2b, xb
                    
                    . *predict c2, cooksd // This line causes an error.
                    . * option cooksd not allowed
                    . * r(198);
                    .
                    . generate abdiff2 = yhat2a-yhat2b
                    
                    . summarize abdiff2
                    
                        Variable |        Obs        Mean    Std. Dev.       Min        Max
                    -------------+---------------------------------------------------------
                         abdiff2 |         74           0           0          0          0
                    
                    .
                    . generate diff12 = yhat1a-yhat2a
                    
                    . summarize diff12
                    
                        Variable |        Obs        Mean    Std. Dev.       Min        Max
                    -------------+---------------------------------------------------------
                          diff12 |         74    1.066002    .7641633  -.2627583   2.355932
                    
                    * The yhat values from -regress- and -mmregress- are not the same.

                    HTH.
                    --
                    Bruce Weaver
                    Email: [email protected]
                    Version: Stata/MP 18.5 (Windows)

                    Comment


                    • #11
                      Thank you for the clarification!

                      Comment

                      Working...
                      X