# Calculating residuals help

1. Aug 25, 2011

### joe007

calculating residuals help!!

Along 14 separate sections of highway measurements of trac 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 coefficient of correlation between trac 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 trac
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

2. Aug 25, 2011

### joe007

Re: calculating residuals help!!

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 whats wrong with this cheers :)

3. Aug 25, 2011

### Stephen Tashi

Re: calculating residuals help!!

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.

4. Aug 26, 2011

### joe007

Re: calculating residuals help!!

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

5. Aug 26, 2011

### Stephen Tashi

Re: calculating residuals help!!

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