Joining Data

combined_data <- left_join(subset_data_asthma, county_level_ces) 
## Joining with `by = join_by(county)`
combined_data <- left_join(combined_data, county_level_pm25)
## Joining with `by = join_by(county)`
#"california" total from asthma data still present without values for the CES summary statistics. will exclude in visualizaton.

str(combined_data)
## tibble [59 × 20] (S3: tbl_df/tbl/data.frame)
##  $ county                               : chr [1:59] "California" "Alameda" "Alpine" "Amador" ...
##  $ year                                 : num [1:59] 2020 2020 2020 2020 2020 2020 2020 2020 2020 2020 ...
##  $ number_of_ed_visits_Total            : num [1:59] 97238 4282 0 103 474 ...
##  $ number_of_ed_visits_White            : num [1:59] 25776 726 0 87 292 ...
##  $ number_of_ed_visits_Black            : num [1:59] 20061 1681 0 NA 53 ...
##  $ number_of_ed_visits_Hispanic         : num [1:59] 39215 915 0 NA 69 ...
##  $ number_of_ed_visits_Asian/PI         : num [1:59] 5724 539 0 0 13 ...
##  $ number_of_ed_visits_AI/AN            : num [1:59] 340 NA 0 0 NA 0 0 NA NA NA ...
##  $ number_of_ed_visits_NHPI             : num [1:59] 763 78 0 0 NA NA 0 50 0 0 ...
##  $ number_of_ed_visits_Multi-race       : num [1:59] 1444 137 0 NA NA ...
##  $ age_adjusted_ed_visit_rate_Total     : num [1:59] 25.1 25.8 0 31.2 24.2 30.4 24 27.5 40.6 20.6 ...
##  $ age_adjusted_ed_visit_rate_White     : num [1:59] 18.3 13.1 0 37.6 21.4 30 30.6 15 50.3 20.6 ...
##  $ age_adjusted_ed_visit_rate_Black     : num [1:59] 89.9 89.8 0 NA 134.4 ...
##  $ age_adjusted_ed_visit_rate_Hispanic  : num [1:59] 24.6 23.4 0 NA 19.7 30.2 15.2 28.9 34.1 19.8 ...
##  $ age_adjusted_ed_visit_rate_Asian/PI  : num [1:59] 10.5 11.7 0 0 15.6 NA 0 11.8 NA NA ...
##  $ age_adjusted_ed_visit_rate_AI/AN     : num [1:59] 20.7 NA 0 0 NA 0 0 NA NA NA ...
##  $ age_adjusted_ed_visit_rate_NHPI      : num [1:59] 53.6 59.8 0 0 NA NA 0 91.5 0 0 ...
##  $ age_adjusted_ed_visit_rate_Multi-race: num [1:59] 14.1 20.7 0 NA NA NA 0 10.7 NA NA ...
##  $ mean_ces                             : num [1:59] NA 22.9 13.6 20.7 21.7 ...
##  $ median_pm25                          : num [1:59] NA 8.71 3.05 8.24 8.45 8.44 7.78 8.78 5.75 7.63 ...

Visualizations

Plot 1: Asthma visits compared to CES scores

Clarissa Sandvik

Plot 1 displays the relationship between county level mean CES score and age-adjusted asthma ED visit rates, with each point representing one county in California. This plot suggests a moderate positive association between a county’s CES score and its age-adjusted asthma-related ED visit rate when the mean CES score is below ~20; increasing mean CES scores above this threshold does not appear to significantly affect asthma ED visit rates.

#asthma visits compared to mean ces score
plot1 <- combined_data %>%
  ggplot(aes(mean_ces, age_adjusted_ed_visit_rate_Total), na.rm=T) + 
  geom_point() +
  geom_smooth() +
  labs(
    title="Plot 1: Age-Adjusted Asthma ED Visit Rates by Mean CES4.0 Score",
    subtitle="at the county level",
    x = "County Mean CES4.0 Score",
    y = "County Age-Adjusted Asthma ED Visit Rate"
  )

plot1

Plot 2: Asthma visits compared to PM2.5 concentrations

Clarissa Sandvik

Plot 2 displays the relationship between county level median PM2.5 concentration and age-adjusted asthma ED visit rates, with each point representing one county in California. This plot does not suggest a clear association between these two variables. It is possible that using the median as the county-level summary statistic for this environmental measure conceals an existing relationship, and/or that a stronger association exists at a more granular, sub-county level or within strata of another variable, such as ethnicity. Because a biological relationship exists between particulate air pollution and asthma, further analysis is recommended before ruling out an epidemiological association.

#asthma visits compared to median PM2.5 value
plot2 <- combined_data %>%
  ggplot(aes(median_pm25, age_adjusted_ed_visit_rate_Total), na.rm=T) + 
  geom_point() +
  geom_smooth() +
  labs(
    title="Plot 2: Age-Adjusted Asthma ED Visit Rates by Median PM2.5 Concentration",
    subtitle="at the county level",
    x = "County Median PM2.5 Concentration",
    y = "County Age-Adjusted Asthma ED Visit Rate"
  )

plot2

Table 1: Correlation between asthma visits and CES scores/PM2.5 concentrations

Olivia West

This table uses Pearson correlation coefficients to assess the strength of the association between asthma-related ED visit rates and CES scores and PM2.5 concentrations. The findings in this table corroborate plots 1 and 2, finding that mean CES score is moderately correlated with asthma ED visits, while median PM2.5 concentration is unlikely to be correlated under these analysis parameters.

#calculating descriptive statistics 

mean_county_level_ces <- round(mean(combined_data$mean_ces, na.rm = TRUE), digits = 2)
mean_county_level_pm25 <- round(mean(combined_data$median_pm25, na.rm = TRUE), digits = 2)

#calculate Pearson correlation coefficient
pearson_mean_ces <- cor(combined_data$age_adjusted_ed_visit_rate_Total, combined_data$mean_ces, use='complete.obs')
pearson_median_pm25 <- cor(combined_data$age_adjusted_ed_visit_rate_Total,combined_data$median_pm25, use='complete.obs')


#creating basic table 
env_meas <- c("Mean CES Score", "Median PM2.5 Concentration")
table_mean  <- c(mean_county_level_ces, mean_county_level_pm25)
table_cor = c(pearson_mean_ces, pearson_median_pm25)
direction <- ifelse(table_cor > 0, "Positive",
             ifelse(table_cor < 0, "Negative", "Neutral"))
interpretation <- dplyr::case_when(
  abs(table_cor) < 0.2 ~ "Weak, unlikely to warrant further study",
  abs(table_cor) < 0.4 ~ "Weak-Moderate, may warrant further study",
  abs(table_cor) < 0.6 ~ "Moderate, may warrant further study",
  abs(table_cor) < 0.8 ~ "Strong, warrants further study",
  TRUE ~ "Very Strong, warrants further study"
)

cor_table <- tibble( 
  Environmental_Measure = env_meas,
  Mean = table_mean,
  Correlation = table_cor,
  Direction = direction,
  Interpretation = interpretation
  )

# using Kable for readability 

kable(cor_table,
      col.names = c("Environmental Measure", "Mean", "Correlation", "Direction", "Interpretation"),
      caption = "Table 1: Associations between Age-Adjusted ED Visit Rates and Environmental Measures at the County Level",
      align = c("lll")) %>%
  kable_styling(full_width = T) %>%
  row_spec(0, bold=TRUE, font_size = 15) %>% 
  footnote("Mean age-adjusted ED rate across counties = 26.60, (SD= 9.66)")
Table 1: Associations between Age-Adjusted ED Visit Rates and Environmental Measures at the County Level
Environmental Measure Mean Correlation Direction Interpretation
Mean CES Score 23.21 0.2637849 Positive Weak-Moderate, may warrant further study
Median PM2.5 Concentration 8.19 -0.0752427 Negative Weak, unlikely to warrant further study
Note:
Mean age-adjusted ED rate across counties = 26.60, (SD= 9.66)