Answer IN R CODE to get the following. Using the data below,
- Create a scatterplot of y vs x
- Fit a simple linear regression model using y as the responseand plot the regression line (with the data)
- Test whether x is a significant predictor and create a 95% CIaround the slope coefficient.
- Report and interpret the coefficient of determination.
- For x=20, create a CI for E(Y|X=20).
- For x=150, can you use the model to estimate E(Y|X=150)?Discuss.
- Does the model appear to be linear with respect to x? Discuss,and if not, provide alternative model and repeat steps 1-6.
| y | x | |
1 | 311.8481 | 30.77326 | |
2 | 440.9428 | 32.40036 | |
3 | 41.6744 | 13.89724 | |
4 | 417.7435 | 30.82836 | |
5 | 177.3642 | 21.17247 | |
6 | 639.0727 | 41.70052 | |
7 | 179.9235 | 20.52949 | |
8 | 19.64963 | 16.78782 | |
9 | 1030.218 | 47.05621 | |
10 | 211.6078 | 24.73312 | |
11 | 468.797 | 33.30568 | |
12 | 281.9641 | 27.20706 | |
13 | 360.4149 | 28.98507 | |
14 | 626.3254 | 33.98696 | |
15 | 692.872 | 40.61913 | |
16 | 840.8116 | 44.14024 | |
17 | 71.51774 | 14.71966 | |
18 | 97.75643 | 18.69047 | |
19 | 251.0697 | 26.53534 | |
20 | 81.51288 | 19.51529 | |
21 | 270.3445 | 28.00065 | |
22 | 1221.873 | 49.81578 | |
23 | 110.3152 | 20.3347 | |
24 | 595.4412 | 38.29436 | |
25 | 126.2188 | 13.26268 | |
26 | 11.15999 | 16.73084 | |
27 | 230.5542 | 24.64804 | |
28 | 77.3025 | 15.99319 | |
29 | 1117.463 | 48.8532 | |
30 | 122.5684 | 18.10108 | |
31 | 932.665 | 44.75007 | |
32 | 911.0599 | 44.23208 | |
33 | 255.6625 | 24.33537 | |
34 | 810.0097 | 41.18667 | |
35 | 210.4745 | 20.06741 | |
36 | 9.884425 | 11.10681 | |
37 | 75.98362 | 11.67823 | |
38 | 153.6595 | 20.20392 | |
39 | 578.7254 | 38.05732 | |
40 | 93.28379 | 12.89079 | |
41 | 378.1102 | 27.82776 | |
42 | 203.9408 | 25.8318 | |
43 | 837.9018 | 43.87759 | |
44 | 44.45671 | 11.49288 | |
45 | 1145.79 | 48.94833 | |
46 | 1073.485 | 47.3091 | |
47 | 431.1394 | 30.53461 | |
48 | 343.5504 | 28.65658 | |
49 | 810.0665 | 41.25828 | |
Please provide all relevant work in R code. The commands, theoutput and any interpretations/conclusions that are necessary.