Students studying for a state achievement test were asked to keep track of the total number of hours that they spent playing video game during the two weeks before the test. In the following table, x is the number of hours spent playing video games (on any type of device) and y is the student's score on the achievement test (out of 130).
Hours (x) 12 15 14 10 11 13 12 14
Score (y) 99 63 79 115 108 82 98 73
a.) Find the linear regression equation
b.) create a table of residuals
Here we shall use R software to solve the problem.
R command :
y=c(99,63,79,115,108,82,98,73)
x=c(12,15,14,10,11,13,12,14)
reg=lm(y~x)
reg
Output:
Call: lm(formula = y ~ x) Coefficients: (Intercept) x 223.74 -10.62
residuals(reg), this command gives direct residuals vector in R software
Get Answers For Free
Most questions answered within 1 hours.