Research Question (from Scenario)

Your task is to utilize these datasets to create county-level measures to accomplish two goals.

  1. The first is to compare county asthma ED rates with a county CES measure to assess if there appears to be a correlation. (Sadia)

  2. The second is to compare asthma ED rates with county-level summaries for specific environmental measures to determine if those specific measures may be worth further investigation. (Yijun)

1 Final datasets for creation of visualization

We selected the following columns from each data and joined them together:

# data cleaning for ces_measure: uniform county name & recategorize to county level
ces_measure_prep <- ces_measure %>% 
  rename(county = california_county) %>% 
  group_by(county) %>% 
  summarise(avg_pm2_5 = mean(pm2_5, na.rm = TRUE),
            avg_drinking_water = mean(drinking_water, na.rm = TRUE),
            avg_haz_waste = mean(haz_waste, na.rm = TRUE))

# data cleaning for ces_scores_demog: uniform county name & recategorize to county level
ces_scores_demog_prep <- ces_scores_demog %>% 
  mutate(county = str_remove(county, " County")) %>% 
  group_by(county) %>% 
  summarise(avg_ces_score = weighted.mean(ces_4_0_score, 
                                          w = total_population, 
                                          na.rm = TRUE))
  
# data cleaning for asthma data: used total_population & year = 2020 &
chhs_asthma_prep <- chhs_asthma %>% 
  mutate(county = str_to_title(str_trim(county))) %>% 
  filter(county != "California",
         strata == "Total population",
         year == 2020) %>% 
  select(county, age_adjusted_ed_visit_rate)

# Join 3 data sets
data_joined <- chhs_asthma_prep %>% 
  left_join(y = ces_scores_demog_prep, by = "county") %>% 
  left_join(y = ces_measure_prep, by = "county")

2 Visualizations