Part 1

In assignment 6, we established the linear relationship between Ozone Level and Temperature. Considering these two variables, Using the ordinary least-square coefficient estimates formula:
a. Compute the estimates for β ̂_0 and β ̂1 for the

β ̂_0 = -147.6461
β ̂1 = 2.43911

##correlation coefficient r
r_ozone = cor(ozone$ozone, ozone$temperature)
r_ozone
## [1] 0.6985414
##sample SD of Y and sample SD of X
sy1 = sd(ozone$ozone)
sx1 = sd(ozone$temperature) 

##Mean of Y and X
ybar1 = mean(ozone$ozone)
xbar1 = mean(ozone$temperature)

##Beta 1
B1 = r_ozone * (sy1/sx1)
B1
## [1] 2.43911
##Beta 0
B0 = ybar1 - (B1*xbar1)
B0
## [1] -147.6461
b. State least-square regression model for Ozone level and Temperature based on the estimations for β ̂_0 and β ̂1

The least-square regression model is:
Ozone = -147.6461 + 2.43911 * Temperature

c. What would be the estimated Ozone level if the temperature is 101 based on your regression model?

Ozone = -147.6461 + 2.43911 * 101
Ozone = 98.70401

Part 2

a. Are Wind, Temperature and Solar Radiation Level when taken together predictors of Ozone Level? Formally test if there is a multiple linear relationship at the alpha level 0.01
1. Set up the hypotheses and select the alpha level

H0: 𝛽_wind=𝛽_temperature=𝛽_solar radiation= 0
Null hypotheses: Wind, Temperature, and Solar Radiation levels are not predictors of the Ozone levels.

H1: 𝛽_wind ≠0 and/or 𝛽_temperature and/or 𝛽_solar radiation ≠0
Alternate hypotheses: At least one of the slope coefficients is different than 0; wind and/or temperature and/or solar radiation are predictors/is a predictor of Ozone levels.

  1. Step 2: State the statistical test and alpha:
    We will use F-test statistics to make the statistical inference at a = 0.01

  1. State the decision rule:
    If the p-value is less than a = 0.01, we will reject the null-hypothesis.

  1. Compute the test statistics-
m_ozone = lm(ozone$ozone ~ wind + temperature + radiation)
summary(m_ozone)
## 
## Call:
## lm(formula = ozone$ozone ~ wind + temperature + radiation)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -40.485 -14.210  -3.556  10.124  95.600 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) -64.23208   23.04204  -2.788  0.00628 ** 
## wind         -3.33760    0.65384  -5.105 1.45e-06 ***
## temperature   1.65121    0.25341   6.516 2.43e-09 ***
## radiation     0.05980    0.02318   2.580  0.01124 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 21.17 on 107 degrees of freedom
## Multiple R-squared:  0.6062, Adjusted R-squared:  0.5952 
## F-statistic: 54.91 on 3 and 107 DF,  p-value: < 2.2e-16

P-value = 2.2e-16 < 0.01

  1. Conclusion:
    We can reject the null hypotheses. We have significant evidence at the a =0.01 level that wind, temperature, and radiation when taken together are predictive of ozone levels. There is evidence of a linear association between ozone levels and wind, temperature, and radiation levels

b. If the answer for (a) is yes, check if Wind, Temperate and Solar Radiations are significant individual predictors when the other two factors are controlled? State your inferences with evidence.

Wind
The t-test statistics for wind shows the p-value to be 1.45e-06 which is less than the alpha value of a =0.01. This concludes there is significant evidence that wind is a significant predictor of ozone levels.
Temperature
The t-test statistics for temperature shows the p-value to be 2.43e-09 which is less than the alpha value of a =0.01. This concludes there is significant evidence that temperature is a significant predictor of ozone levels.
Radiation Levels
The t-test statistics for temperature shows the p-value to be 0.01124 which is greater than the alpha value of a =0.01. This concludes there is no significant evidence that radiation levels are a significant predictor of ozone levels.