Sheet1
Price (X) Quantity demanded (Y)
56 637
23 967
43 908
56 797
76 728
76 891
92 884
91 615
32 876
85 824
74 678
32 925
50 878
96 612
55 905
85 710
32 891
86 734
96 894
69 922
11 908
82 644
65 798
94 940
94 741
54 828
82 560
91 660
59 766
89 730
63 903
59 506
90 618
50 847
86 816
85 805
12 659
12 777
77 777
73 899
65 553
85 553
75 767
76 720
74 849
71 551
90 627
63 967
65 528
89 829
86 553
74 774
96 655
54 602
84 756
91 720
60 725
87 532
63 932
65 591
OpenIntro
Here is OpenIntro’s RLab for Chapter 8:
http:
htmlpreview.github.io/?https:
github.com/andrewp
ay/oiLabs-base-R
lo
maste
simple_regression/simple_regression.html
Record and turn in your answers for the On Your Own section.
· In questions that ask for a number, give the numerical answer along with what that number describes. Be specific.
· In questions that ask for your code input, give the code and also describe what R returns.
· In questions that ask for explanation or analysis, provide a reasonably detailed response with evidence supporting your claims.
Supplemental Questions
The idea of these supplemental questions is for you to run through the mechanics of the above lab with the data sets you chose for WH08. Repeat these steps for each data set.
To import your data set into R, save your data sets as .csv files on your desktop or documents folder. Use the file
owser in the bottom right corner to locate your file and import it. If you are in RStudio Cloud, you can upload the csv file. Once it is imported you can give a short-hand name to your data set if it has a long name. ::Click here for pictures of these steps::
1. Create a scatterplot of your two variables with plot(y~x).
2. Generate the line of best fit with model
3. Add a this line to your scatterplot with abline(model).
4. Create a new data set that measures the residuals with residuals
5. Investigate the linearity of your data set:
e. Create a scatterplot of your residuals with plot(model$residuals ~ data$x).
e. Create a histogram of your residuals with hist(model$residuals).
e. Create a qqplot of your residuals with qqnorm(model$residuals).
e. Comment on what these graphics tell you about the linearity of your data.
1. Compute the co
elation of your data with cor(data$y$, data$x).
1. How do these computations relate to your estimates from WH08?