Coding in R: There are two options of working in R: • install R on your personal
ID: 3375034 • Letter: C
Question
Coding in R: There are two options of working in R: • install R on your personal computer from: https://www.r-project.org/ and you can do the assignment at home or wherever your computer is.
Question 1
The airquality data set contains daily air quality measurements in New York, from May to September 1973. Use the following lines of code to load in the data, and re-write the “Solar.R” variable with your name: data(‘airquality’) airquality$your_name = airquality$Solar.R Answer the following questions about the airquality data set:
A) Use the command: head(airquality) to print the first 6 lines of the data set.
B) Assuming the data is normal, create a 99% confidence interval for the mean temperature. Interpret this interval.
C) Assuming the data is normal, use a 5% significance level to test if the mean temperature exceeds 77?F using a p-value approach. (Your solution should include H0, HA, test statistic, p-value and a concluding sentence in nonstatistical language.)
D) Plot a scatterplot of the ozone concentration (X) against the temperature (Y). Identify if the correlation looks positive or negative; and strong, weak or moderate.
E) Find the regression line to model temperature as a function of ozone concentration (using simple linear regression). Give an interpretation of the estimates with respect to ozone concentration and temperature.
F) Plot the regression line on top of the scatterplot in part E.
G) Based off the plot in part F, does the line appear to fit the data?
H) Test if there is a linear relationship between ozone concentration and temperature. (Use ? = 0.05) I) If the next month’s ozone concentration is 40 ppb, what do you estimate the temperature to be? (slide 31 - Ch 10) (Note: You do not need to do a prediction interval!)
1 Question 2 The Seatbelts data set contains the monthly totals of car
Explanation / Answer
(D)(F)
Answer : here p-value corresponding to airquality4ozone is 2e-16 < 0.05 , Hence we reject null hypothesis that H0 ;there is no correlation between temp and ozone (beta_1 =0) .
If ozone level =40 then estimated temperature wil be
est_temp=69.4107+0.2008*40=77.4427