In: Statistics and Probability
Do question E
The following table contains the ACT scores and the GPA (grade point average) for eight college students. Grade point average is based on a four-point scale and has been rounded to one digit after the decimal.
Student 1 2 3 4 5 6 7 8
GPA (y) 2.8 3.4 3.0 3.5 3.6 3.0 2.7 3.7
ACT (x) 21 24 26 27 29 25 25 30
We want to fit a straight-line model to relate GPA y to the ACT. ??? = ?0 + ?1 ??? + ?
a. Compute: ????, ????, ????, ?̂ 0, ?̂ 1 and hence write the equation of the fitted line.
b. Compute the fitted values and residuals for each observation, and verify that the residuals (approximately) sum to zero. (Do not use computer for parts c,d,e).
c. Draw a scatter plot of ACT and GPA
d. On your scatter plot draw the fitted line you have in part (b).
e. On your plot indicate ?3, ?̂3,?̂3
Where ?̂3 ?? ?ℎ? ???????? ??? ?ℎ? ?ℎ??? ???????????.
GPA<-c(2.8,3.4,3.0,3.5,3.6,3.0,2.7,3.7)
ACT<-c(21,24,26,27,29,25,25,30)
p<-lm(GPA~ACT)
summary(p)
Call:
lm(formula = GPA ~ ACT)
Residuals:
Min 1Q Median 3Q Max
-0.42308 -0.14863 0.06703 0.10742 0.37912
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.56813 0.92842 0.612 0.5630
ACT 0.10220 0.03569 2.863 0.0287 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.2692 on 6 degrees of freedom
Multiple R-squared: 0.5774, Adjusted R-squared: 0.507
F-statistic: 8.199 on 1 and 6 DF, p-value: 0.02868
a. Sum of squares of regressors = 0.59402
Error sum of squares = 0.43473
Straight line for the above given data is GPA=0.56813+0.1022 * ACT + 0.2692
b. The predicted or fitted values are given below
predict(p)
1 2 3 4 5 6 7 8
2.714286 3.020879 3.225275 3.327473 3.531868 3.123077 3.123077
3.634066
Residual values are given below
residuals(p)
1 2 3 4 5 6
0.08571429 0.37912088 -0.22527473 0.17252747 0.06813187
-0.12307692
7 8
-0.42307692 0.06593407
The sum of the residuals value is given by -4.163336e-17 which is approximately zero.