- Temperature and ozone are positively correlated: as amount of ozone increases, the temperature also increases
- Wind and ozone are negatively correlated: as amount of ozone increases, the wind decreases
- The \(R^{2}\) value for wind is around 0.36
- This indicates that the linear regression model for temperature vs ozone does a better job predicting than it does for wind vs ozone
model <- lm(airquality$Solar.R ~ airquality$Ozone)
model
##
## Call:
## lm(formula = airquality$Solar.R ~ airquality$Ozone)
##
## Coefficients:
## (Intercept) airquality$Ozone
## 144.6306 0.9542
cor.test(airquality$Ozone, airquality$Wind)
##
## Pearson's product-moment correlation
##
## data: airquality$Ozone and airquality$Wind
## t = -8.0401, df = 114, p-value = 9.272e-13
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## -0.7063918 -0.4708713
## sample estimates:
## cor
## -0.6015465
summary(model)
##
## Call:
## lm(formula = airquality$Solar.R ~ airquality$Ozone)
##
## Residuals:
## Min 1Q Median 3Q Max
## -153.577 -65.349 -0.555 68.110 176.011
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 144.6306 13.1749 10.98 < 2e-16 ***
## airquality$Ozone 0.9542 0.2459 3.88 0.000179 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 85.83 on 109 degrees of freedom
## (42 observations deleted due to missingness)
## Multiple R-squared: 0.1213, Adjusted R-squared: 0.1133
## F-statistic: 15.05 on 1 and 109 DF, p-value: 0.0001793