What Are the Steps for Calculating Residuals in a Regression Model?

  • Level: Undergrad 
  • Thread starter Thread starter joe007
  • Start date Start date
Join the discussion
Registration is free. Start your own thread to ask a follow-up.
4 replies · 4K views
joe007
Messages
23
Reaction score
0
calculating residuals help!

Along 14 separate sections of highway measurements of trac volume (x) and rate of
accidents (y) were taken.

x; 303, 294, 242, 236 ,267, 213, 233, 292 ,287 ,215 ,231 ,195 ,255 ,298
y; 30, 27, 23, 20, 26, 20, 22, 29, 27, 20, 23, 20, 26 ,27

(a)Calculate the coefficient of correlation between trac volume and acci-
dent rate.
Sxy=1566.57
Sxx=16759.214
Syy=164.857
well i used the formula: r=Sxy/sqrt(Sxx*Syy)=0.94247

(b)Obtain residuals and sketch a residual plot (residuals against trac
volume). Explain what the plot tells us about the t of the regression

i know the general formula f(x)=a+bx, where i found a=0.509 and b=0.0934

but how do i obtain individual residuals
 
Physics news on Phys.org


anyone have any idea on residuals well i tried this for the first residual at x=303 and
y=30 f(x)=303-(0.509+0.09(30)) =2.2 but R tells me it it 1.67

can u tell me what's wrong with this cheers :)
 


A "residual" is a differences between the predicted y value and the actual y value. You have subtracted something from "303", which is an x value. Perhaps you wrote an equation that predicts x in terms of y instead of vice-versa.
 


yep sorry it shud be 30-(0.509+0.09(303)) but i get a weird answer
 


I didn't check your arithmetic, but 164.857 looks too small for Syy. Maybe you made arithmetical errors.