Announcement

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

  • Linearity/ non-linearity using residual plot

    Click image for larger version

Name:	KitchenSink_ResidualsVsFitted.png
Views:	2
Size:	7.4 KB
ID:	1496598
    How can I predict linearity or non-linearity of my regression model using this residuals Vs fitted plot?


  • #2
    For those who may want to address this question, note that there is a description of the data and the model being fit at

    https://www.statalist.org/forums/for...ssion-on-stata

    Comment


    • #3
      Rochan:
      you can also consider fitted vs predictor graph to have a more comprehensive picture of non-linearity:

      Code:
      use "http://www.stata-press.com/data/r15/nlswork.dta"
      . xtreg ln_wage i.race c.age##c.age
      
      Random-effects GLS regression                   Number of obs     =     28,510
      Group variable: idcode                          Number of groups  =      4,710
      
      R-sq:                                           Obs per group:
           within  = 0.1087                                         min =          1
           between = 0.1175                                         avg =        6.1
           overall = 0.1048                                         max =         15
      
                                                      Wald chi2(4)      =    3498.50
      corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000
      
      ------------------------------------------------------------------------------
           ln_wage |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
              race |
            black  |  -.1237269   .0127651    -9.69   0.000    -.1487461   -.0987077
            other  |   .0965773   .0532529     1.81   0.070    -.0077965    .2009511
                   |
               age |   .0594573   .0027157    21.89   0.000     .0541346      .06478
                   |
       c.age#c.age |  -.0006835    .000045   -15.18   0.000    -.0007717   -.0005952
                   |
             _cons |   .5761164   .0398472    14.46   0.000     .4980173    .6542155
      -------------+----------------------------------------------------------------
           sigma_u |  .36094993
           sigma_e |  .30245467
               rho |   .5874941   (fraction of variance due to u_i)
      ------------------------------------------------------------------------------
      
      . predict fitted, xb
      (24 missing values generated)
      
      . twoway (scatter fitted age)
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment

      Working...
      X