Question 1) The ozone data in the R faraway package contains daily measurements
ID: 3319137 • Letter: Q
Question
Question 1) The ozone data in the R faraway package contains daily measurements of ozone concentrations and eight meteorological variables in the Los Angeles basin for 330 days of 1976. We focus on the relationship of ozone concentrations (03) and day of year (doy). The scatter plot with two smooth curve fits are shown in Figure 1. Suppose a person did not examine the data and the curves. Instead, he tried to use Pearson's correlation and Spearman's rank correlation to test for association between O3 and doy. You were asked to help the person to carry out the analysis. This plot was generated with R command: librarylfaravay) data (ozone): attach (ozone) library (ggplot21 gqplot (ozone, ses (x doy, y-03,11+ geom point 0 geom smooth (method-'gam, formula y'stx, bs'cs')) geom smooth (method-' im', formula - yx+Ix2), col-'re Figure 1: Generalized additive model (blue) and parabola (red) fit to the data. The parabola is y =-0000500275 doy2 + 0.216483699 doy- 6.186163324Explanation / Answer
a. #Test for correlation
> cor.test(O3,doy)
Pearson's product-moment correlation
data: O3 and doy
t = 1.2277, df = 328, p-value = 0.2204
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.0406269 0.1743245
sample estimates:
cor
0.06763357
Since p-value>0.05, we reject null hypothesis of zero correlation and conclude that the correlation is significant.
b.
> cor.test(O3,doy,method='spearman')
Spearman's rank correlation rho
data: O3 and doy
S = 5670600, p-value = 0.3351
alternative hypothesis: true rho is not equal to 0
sample estimates:
rho
0.05322656
Since p-value>0.05, we reject null hypothesis of zero correlation and conclude that the correlation is significant.
c. Significant correlation as proved in part (a) and (b) indicates that there is a significant linear relationship between the two variables which contradicts the trend seen in Figure 1 since the trend in fig 1 is non-linear (quadratic).
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.