STA 032讲解、R Report III辅导、讲解R编程设计、讲解R 解析R语言编程|讲解R语言编程

- 首页 >> 其他
STA 032 Winter 2019
R Report III - Due Friday, March 22nd by 5:00pm.
R Report III
FORMAT
* Use complete sentences and proper grammar to answer all questions.
* Use R Markdown to create an html document.
* Code should not be in the body of the text, so be sure to add echo = FALSE in the preface to your R chunks. All code
should be included at the end of the homework, as an appendix.
I. On Canvas you will find the file crime.csv. It has two columns, one of which is the percentage of individuals in the
county with at least a high-school diploma (column dip), and the other is the crime rate per 100,000 residents for the
counties (column rate). Consider Y to be crime rate, and X to be percentage with high school diploma.
Use R to complete the following tasks:
(a) Plot a scatter plot of Y and X, being sure to label the axes and give a main title.
(b) Calculate the estimated regression line.
(c) Interpret the slope and intercept (if appropriate) in terms of the problem.
(d) Does there appear to be outliers in the plot from (a)? If so, identify them in R (for example, list the pair (X,Y)
that are outliers, or equivalently the row).
(e) Create a QQ plot (normal probability plot) of the residuals. Does it appear that they are normally distributed?
Explain.
(f) Create a plot of the errors vs. the fitted values (Y?
i
’s). Does it appear the variance of the errors is constant? Explain.
(g) Find the 95% confidence interval for the slope, and interpret it in terms of the problem. Does the interval suggest
there is a significant linear relationship? Explain.