Using R and the data in the table below, perform the regression of D on C (i.e., report the regression equation).
Hint: The code to enter the vectors C and D into R is: C <- c(3, 6, 8, 9, 1, 3) D <- c(2, 7, 5, 4, 0, 4)
C |
D |
3 |
2 |
6 |
7 |
8 |
5 |
9 |
4 |
1 |
0 |
3 |
4 |
You must figure out how to obtain the regression equation from R. Enter the code below and write the regression equation using the output provided by R.
Code:
Regression equation (remember to use a hat when it is appropriate):
2. Plot the data and line of best fit in R and paste it into this document
Code:
Plot:
3. Using the predict function in R, find each of the following predicted values of D, for the given value of C regardless of whether or not it is appropriate to do so. In real life you should not calculate for predictions when it is not appropriate, but this is just for practice.
Find when C = 6 Find when C = 4 Find when C = 15
Code:
Predicted values:
R code along with output is attached herewith.
Get Answers For Free
Most questions answered within 1 hours.