6/16/2020

Key Questions

Plotting code

library(ggplot2); library(gridExtra)
data <- airquality[complete.cases(airquality),]
data$Month <- as.factor(data$Month)
p1 <- ggplot(data=data, aes(x=Ozone, y=Temp)) +
      geom_point(aes(color=Month)) + xlab("Ozone (ppb)") +
      ylab("Temperature (F)") + ylim(55, 100) +
      xlim(0, 170) + geom_smooth(method='lm')

p2 <- ggplot(data=data, aes(x=Ozone, y=Temp, color=Month)) +
      geom_point() + xlab("Ozone (ppb)") + ylab("Temperature (F)") +
      ylim(55, 100) + xlim(0, 170) + geom_smooth(method='lm')

grid.arrange(p1, p2, ncol=2)

Plots

Conclusions

  • Based on the plots created, it DOES appear that ozone has an impact on the measured temperature.
  • There is a variation in the impact ozone has on temperature based on month.
    • The hottest months (July & August) appear to not be impacted as much by increases in ozone.