Page 106 - Applied Statistics with R
P. 106

106                      CHAPTER 7. SIMPLE LINEAR REGRESSION


                                 SSE / (n - 2)


                                 ## [1] 236.5317

                                                                                              2
                                 We can use R to verify that this matches our previous calculation of    .
                                                                                                
                                 s2_e == SSE / (n - 2)


                                 ## [1] TRUE

                                 These three measures also do not have an important practical interpretation in-
                                 dividually. But together, they’re about to reveal a new statistic to help measure
                                 the strength of a SLR model.


                                 7.3.1   Coefficient of Determination

                                                                   2
                                 The coefficient of determination,    , is defined as
                                                                 
                                                                     
                                                                         
                                                     SSReg   ∑    ( ̂ − ̄) 2
                                                                      
                                                 2
                                                  =        =     =1
                                                                 
                                                      SST    ∑    (   − ̄) 2
                                                                         
                                                                 =1    
                                                     SST − SSE       SSE
                                                  =            = 1 −
                                                        SST          SST
                                                                    2               2
                                                        ∑    (   − ̂ )        ∑      
                                                                   
                                                                
                                                                    
                                                  = 1 −     =1        = 1 −        =1   
                                                            
                                                                                       
                                                                    
                                                        ∑    (   − ̄) 2    ∑    (   − ̄) 2
                                                            =1                 =1    
                                 The coefficient of determination is interpreted as the proportion of observed
                                 variation in    that can be explained by the simple linear regression model.
                                 R2 = SSReg / SST
                                 R2
                                 ## [1] 0.6510794
                                                                   2
                                 For the cars example, we calculate    = 0.65. We then say that 65% of the
                                 observed variability in stopping distance is explained by the linear relationship
                                 with speed.
                                 The following plots visually demonstrate the three “sums of squares” for a sim-
                                                          2
                                 ulated dataset which has    = 0.92 which is a somewhat high value. Notice
                                 in the final plot, that the orange arrows account for a larger proportion of the
                                 total arrow.
   101   102   103   104   105   106   107   108   109   110   111