Dataset

#Load Ozone Dataset
load("Ozone_Drought_Final.RData")
combinedAir.final<-arrange(combinedAir.final,GEOID,Year)

#Load Population Dataset
region<-read.csv("region_code.csv")

## Merging dataset
combinedAir.final$State.Code<-as.numeric(combinedAir.final$State.Code)

combinedAir.final<-left_join(combinedAir.final,region,by="State.Code")

combinedAir.final$USDM.categorical<-factor(combinedAir.final$USDM.categorical,levels=c("NoDrought","SevereDrought","ModerateDrought"))

## Subset Between May 1st to Sep 31st.
combinedAir.final$month<-as.numeric(combinedAir.final$month)

combinedAir.final<-combinedAir.final%>%
  filter(month>=5 & month<=9)

## Sampling 20%
s.combined <- combinedAir.final %>%
  group_by(USDM.categorical, month, Year) %>%
  sample_frac(0.5)

s.combined<-data.frame(s.combined)

Temperature

s.combined%>%
  summarize(mean= mean(tmean),std=sd(tmean))
##       mean      std
## 1 22.06245 5.649174
ggplot(s.combined, aes(x = USDM.categorical, y = tmean)) +
  geom_boxplot(fill = "#69b3a2", color = "black", alpha = 0.8) +
  labs(title = "", x = "Drought Category", y = "Temperature") +
  theme(plot.title = element_text(size = 20, face = "bold", hjust = 0.5),
    axis.title.x = element_text(size = 16, face = "bold"),
    axis.title.y = element_text(size = 16, face = "bold"),
    axis.text.x = element_text(size = 14, color = "#2b2d42"),
    axis.text.y = element_text(size = 14, color = "#2b2d42"),
    panel.grid.major = element_blank(),
    panel.grid.minor = element_blank(),
    panel.background = element_blank(),
    legend.position = "none")

## Dew Point

s.combined%>%
  summarize(mean= mean(tdmean),std=sd(tdmean))
##      mean      std
## 1 13.6467 7.042028
ggplot(s.combined, aes(x = USDM.categorical, y = tdmean)) +
  geom_boxplot(fill = "#69b3a2", color = "black", alpha = 0.8) +
  labs(title = "", x = "Drought Category", y = "Dew Point") +
  theme(plot.title = element_text(size = 20, face = "bold", hjust = 0.5),
    axis.title.x = element_text(size = 16, face = "bold"),
    axis.title.y = element_text(size = 16, face = "bold"),
    axis.text.x = element_text(size = 14, color = "#2b2d42"),
    axis.text.y = element_text(size = 14, color = "#2b2d42"),
    panel.grid.major = element_blank(),
    panel.grid.minor = element_blank(),
    panel.background = element_blank(),
    legend.position = "none")

Precipitation

s.combined%>%
  summarize(mean= mean(ppt),std=sd(ppt))
##       mean      std
## 1 2.774559 8.299493
ggplot(s.combined, aes(x = USDM.categorical, y = ppt)) +
  geom_boxplot(fill = "#69b3a2", color = "black", alpha = 0.8) +
  labs(title = "", x = "Drought Category", y = "Precipitation") +
  theme(plot.title = element_text(size = 20, face = "bold", hjust = 0.5),
    axis.title.x = element_text(size = 16, face = "bold"),
    axis.title.y = element_text(size = 16, face = "bold"),
    axis.text.x = element_text(size = 14, color = "#2b2d42"),
    axis.text.y = element_text(size = 14, color = "#2b2d42"),
    panel.grid.major = element_blank(),
    panel.grid.minor = element_blank(),
    panel.background = element_blank(),
    legend.position = "none")