In: Statistics and Probability
I am working through this solution in rstudio and am having trouble fitting this table into a linear regression analysis. an answer with corrosponding r code used would be greatly appreciated
A study was conducted to determine whether the final grade of a student in an introductory psychology course is linearly related to his or her performance on the verbal ability test administered before college entrance. The verbal scores and final grades for all 1010 students in the class are shown in the table below.
Student | Verbal Score (x) | Final Grade (y) |
---|---|---|
1 | 51 | 62 |
2 | 37 | 61 |
3 | 57 | 71 |
4 | 67 | 89 |
5 | 29 | 78 |
6 | 27 | 87 |
7 | 53 | 76 |
8 | 35 | 88 |
9 | 66 | 87 |
10 | 57 | 94 |
The correlation coefficient: r=
(b) The least squares line. NOTE:[for negitive β1, for example
β1 = -2.4 write in form β0+(−2.4)x ]:
y^=
(c) Calculate the residual for the tenth student:
ΣX | ΣY | Σ(x-x̅)² | Σ(y-ȳ)² | Σ(x-x̅)(y-ȳ) | |
total sum | 479.00 | 793.00 | 1972.90 | 1220.10 | 263.30 |
mean | 47.90 | 79.30 | SSxx | SSyy | SSxy |
a) correlation coefficient , r = SSxy/√(SSx.SSy) = 0.16971
b) estimated slope , ß1 = SSxy/SSxx =
263.3 / 1972.900 =
0.13346
intercept, ß0 = y̅-ß1* x̄ =
72.90734
so, regression line is Ŷ =
72.9073 + 0.1335
*x
c)
Predicted Y at X= 57
is
Ŷ = 72.9073 +
0.1335 *57= 80.51
residual=y-Y^=94- 80.51 = 13.49