2026-11-19
For this assignment, I will be using the County Health Rankings and Roadmaps dataset to examine health insurance coverage and health outcomes across Texas counties.
main_data <- read.csv("analytic_data2025_v3.csv")
texas_data <- subset(main_data, State.Abbreviation == "TX")
texas_data <- subset(texas_data, County.FIPS.Code != "000")
dim(texas_data)## [1] 254 796
Question 2 For my correlation analysis, I selected two variables of interest: poor or fair health as my dependent variable and uninsured adults as my independent variable.
variables <- texas_data[, c("Poor.or.Fair.Health.raw.value",
"Uninsured.Adults.raw.value")]
variables[] <- lapply(variables, as.numeric)
cor(variables, use = "complete.obs")## Poor.or.Fair.Health.raw.value Uninsured.Adults.raw.value
## Poor.or.Fair.Health.raw.value 1.0000000 0.6570203
## Uninsured.Adults.raw.value 0.6570203 1.0000000
Question 3 I used the PAIRS command to visually examine the relationship between the percentage of uninsured adults and the percentage of adults reporting poor or fair health across Texas counties.
pairs(variables)Question 4 After examining the correlation matrix and PAIRS graph, I selected the Pearson correlation method to further examine the relationship between uninsured adults and adults reporting poor or fair health.
cor.test(variables$Uninsured.Adults.raw.value,
variables$Poor.or.Fair.Health.raw.value,
method = "pearson")##
## Pearson's product-moment correlation
##
## data: variables$Uninsured.Adults.raw.value and variables$Poor.or.Fair.Health.raw.value
## t = 13.835, df = 252, p-value < 2.2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.5809137 0.7217385
## sample estimates:
## cor
## 0.6570203
My results showed a moderately strong positive correlation (r = 0.6570, p < 0.001). This means that Texas counties with higher percentages of uninsured adults also tend to have higher percentages of adults reporting poor or fair health. Because the p-value was less than 0.05, the relationship is considered statistically significant, which allows me to reject my null hypothesis. Overall, these findings support my original hypothesis that counties with higher uninsured rates tend to experience poorer health outcomes. However, it is important to understand that correlation does not prove causation, and other factors may also contribute to poorer health outcomes across Texas counties.