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:
β ̂_0 = -147.6461
The least-square regression model is:
c. What would be the estimated Ozone level if the temperature is 101
based on your regression model?
Ozone = -147.6461 + 2.43911 * 101
Part 2
a. Compute the estimates for β ̂_0 and β ̂1
for the
β ̂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
b. State least-square regression model for Ozone level and
Temperature based on the estimations for β ̂_0 and β ̂1 ## [1] -147.6461
Ozone = -147.6461 + 2.43911 *
Temperature
Ozone = 98.70401
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.
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
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.