statistics with R programming

profilejamesfiona1993
Assignment6.docx

Assignment 6 (Simple Linear Regression), STA 622, Fall 2020

As always, you must show R code and output you use to support your work. Do not use an appendix. Please put the code and output with your answers to each question.

1. In data collection, we often speak of random sampling (selection) and random assignment. Explain very briefly what the difference in the goals of these two uses of randomness are.

2. Use the data in #5 in Aho textbook on page 319 to complete the following. However, you may use R code to do all calculations, providing you show code and output as always.

(a) Make an appropriate plot of the data to examine if using Pearson’s correlation is appropriate (for describing the sample, not for inference).

(b) Calculate and interpret Pearson’s correlation.

(c) Calculate and interpret Spearman’s correlation (do not worry about Kendall’s tau).

(d) Explain very briefly the conceptual difference between Pearson’s and Spearman’s correlations, and when we would use each one.

3. Use the data in #2 in Aho textbook on page 414 to complete the following. You may use R for any of this provided that you show code and output as always. Note the word “given” in the problem statement means that weight.gain is the response variable.

(a) Make a scatterplot of the data, and describe it by addressing the four components discussed in class.

(b) Determine the equation of the best fitting line for the data, and interpret the slope in context.

(c) Determine the coefficient of determination (r2) and interpret it in context.

(d) Determine if there is evidence in this sample that weight gain and lysine eaten have a positive linear relationship in the population (you should know by now that this means you must address and LABEL the 8 steps of hypothesis testing as discussed in class).

(e) Calculate and interpret a 95% confidence interval for the mean value of y for when x=0.14.

(f) Calculate and interpret a 95% prediction interval for an individual value of y for an individual with x=0.14.