Problem 8. We are interested in fitting a straight line to the following data:
x=c(1, 1, 2, 2, 4, 4, 7, 8, 8, 9, 9, 9, 11, 11, 12, 12, 12, 13, 15, 20)
y=c(-1.5, -2.2, 6.5, 2.2, 7.4, 0.3, 10.7, 11.9, 9.4, 16.1, 16.1, 16.0, 19.6, 18.5, 22.0, 22.8, 15.5, 31.2, 27.6, 33.1)
(a)
Following is the r script to get regression and coefficient:
Folloiwng is the output generated by R:
Answers: slope = 1.940, constant = -2.326
(b)
Following is the output to generate the scatter plot and regression line:
Following is the output:
Get Answers For Free
Most questions answered within 1 hours.