library(tidycensus)
library(tidyverse)
library(tigris)
library(sf)Children Eligible for Medicaid, CHIP, and SNAP But Not Enrolled
Calculating Number of Children Eligible for Medicaid, Chip, and Snap but Who Are Not Enrolled, by State House and Senate Districts
Sources, Methods, and Data Notes
This analysis calculates an estimate of the number of children in Texas who are eligible for Medicaid, CHIP, and SNAP but are not enrolled. The data is available by state house and senate district. I first calculate for total kids eligible for SNAP, and then total kids eligible for Medicaid or CHIP.
For these estimate, I am utilizing 2023 American Community Survey (ACS) 5-Year estimates via tidycensus. This code is based of of Coda Rayo-Garza’s initial draft analysis.
Note that for the SNAP estimates, the best variable I could find for child counts was B09010_002, which is the total estimate of kids living in households receiving Supplemental Security Income (SSI), cash public assistance income, or Food Stamps/SNAP in the past 12 months. There is not a similar variable for just SNAP unfortunately. Alternatively, there is the variable B19058_002, but that also just gives the count of people on SNAP or other cash public assistance. So we are unable to get a total for just SNAP.
Data Prep
# define texas house and sentate districts
tx_house_districts <- state_legislative_districts(state = "TX", house = "lower", year = 2023, cb = TRUE)
|
| | 0%
|
|= | 2%
|
|=== | 4%
|
|==== | 5%
|
|===== | 7%
|
|====== | 8%
|
|======= | 10%
|
|======== | 12%
|
|========= | 13%
|
|========== | 14%
|
|=========== | 16%
|
|============ | 18%
|
|============= | 18%
|
|================ | 23%
|
|================= | 25%
|
|=================== | 27%
|
|==================== | 28%
|
|===================== | 30%
|
|====================== | 32%
|
|======================= | 33%
|
|======================== | 35%
|
|========================== | 37%
|
|=========================== | 39%
|
|================================== | 49%
|
|==================================== | 52%
|
|======================================== | 57%
|
|========================================= | 59%
|
|================================================== | 71%
|
|=================================================== | 73%
|
|===================================================== | 76%
|
|====================================================== | 77%
|
|========================================================= | 82%
|
|=========================================================== | 84%
|
|================================================================ | 92%
|
|======================================================================| 100%
tx_senate_districts <- state_legislative_districts(state = "TX", house = "upper", year = 2023, cb = TRUE)
|
| | 0%
|
|==== | 5%
|
|========= | 13%
|
|=========== | 16%
|
|==================== | 29%
|
|======================== | 34%
|
|================================== | 49%
|
|===================================== | 53%
|
|============================================== | 66%
|
|=================================================== | 73%
|
|========================================================== | 82%
|
|================================================================= | 93%
|
|================================================================== | 95%
|
|======================================================================| 100%
# view variable options
v23 <- load_variables(2023, "acs5", cache = TRUE)
View(v23)SNAP by House District
child_snap_vars <- c(
total_children = "B17006_001", # Total kids for whom poverty status is determined
children_below_poverty = "B17006_002", # Total kids below 100% FPL
children_receiving_snap = "B09010_002" # Total kids living in households with Supplemental Security Income (SSI), cash public assistance income, or Food Stamps/SNAP in the past 12 months
)
tx_child_snap_house <- get_acs(
geography = "state legislative district (lower chamber)",
state = "TX",
variables = child_snap_vars,
year = 2023,
survey = "acs5"
)Getting data from the 2019-2023 5-year ACS
head(tx_child_snap_house)# A tibble: 6 × 5
GEOID NAME variable estimate moe
<chr> <chr> <chr> <dbl> <dbl>
1 48001 State House District 1 (2022); Texas children_receiving_… 12345 1260
2 48001 State House District 1 (2022); Texas total_children 45247 219
3 48001 State House District 1 (2022); Texas children_below_pove… 10507 1184
4 48002 State House District 2 (2022); Texas children_receiving_… 12107 1228
5 48002 State House District 2 (2022); Texas total_children 47755 292
6 48002 State House District 2 (2022); Texas children_below_pove… 7512 1069
snap_summary_house <- tx_child_snap_house |>
group_by(NAME) |>
summarise(
total_children = sum(estimate[variable == "total_children"]),
snap_eligible_children = sum(estimate[variable %in% c("children_below_poverty")]),
snap_enrolled_children = sum(estimate[variable == "children_receiving_snap"])
) %>%
mutate(
snap_elig_but_not_enrolled = snap_eligible_children - snap_enrolled_children,
percent_elig_but_not_enrolled = (snap_elig_but_not_enrolled / snap_eligible_children) * 100
)
head(snap_summary_house)# A tibble: 6 × 6
NAME total_children snap_eligible_children snap_enrolled_children
<chr> <dbl> <dbl> <dbl>
1 State House Dist… 45247 10507 12345
2 State House Dist… 53195 5867 9707
3 State House Dist… 48628 15975 19591
4 State House Dist… 58819 8032 14641
5 State House Dist… 46681 11054 12218
6 State House Dist… 41938 10040 10230
# ℹ 2 more variables: snap_elig_but_not_enrolled <dbl>,
# percent_elig_but_not_enrolled <dbl>
# (from Coda's code: had to do the same fix because gpt code did not catch this same error from previous analysis). Basixally these steps extract a number from the NAME column and then store it as a character string.
snap_summary_house <- snap_summary_house|>
mutate(NAME = str_extract(NAME, "\\d+")) |>
mutate(NAME = as.character(NAME))
tx_house_districts <- tx_house_districts |>
mutate(NAME = as.character(NAME))
tx_child_map_house <- left_join(tx_house_districts, snap_summary_house, by = "NAME")
# Plot the % of children eligible but not enrolled
ggplot(tx_child_map_house) +
geom_sf(aes(fill = percent_elig_but_not_enrolled)) +
scale_fill_viridis_c(option = "inferno", na.value = "white") +
theme_minimal() +
labs(title = "Children Eligible but Not Enrolled in SNAP (TX House Districts)",
fill = "% Eligible but Not Enrolled")SNAP by Senate District
child_snap_vars <- c(
total_children = "B17006_001",
children_below_poverty = "B17006_002",
children_below_poverty = "B17006_003",
children_receiving_snap = "B09010_002" # Total kids living in households with Supplemental Security Income (SSI), cash public assistance income, or Food Stamps/SNAP in the past 12 months
)
tx_child_snap_senate <- get_acs(
geography = "state legislative district (upper chamber)",
state = "TX",
variables = child_snap_vars,
year = 2023,
survey = "acs5"
)Getting data from the 2019-2023 5-year ACS
head(tx_child_snap_senate)# A tibble: 6 × 5
GEOID NAME variable estimate moe
<chr> <chr> <chr> <dbl> <dbl>
1 48001 State Senate District 1 (2022); Texas children_receiving… 56726 2706
2 48001 State Senate District 1 (2022); Texas total_children 219134 716
3 48001 State Senate District 1 (2022); Texas children_below_pov… 44049 2464
4 48001 State Senate District 1 (2022); Texas children_below_pov… 15111 1691
5 48002 State Senate District 2 (2022); Texas children_receiving… 47942 3238
6 48002 State Senate District 2 (2022); Texas total_children 246320 2757
snap_summary_senate <- tx_child_snap_senate |>
group_by(NAME) |>
summarise(
total_children = sum(estimate[variable == "total_children"]),
snap_eligible_children = sum(estimate[variable %in% c("children_below_poverty")]),
snap_enrolled_children = sum(estimate[variable == "children_receiving_snap"])
) %>%
mutate(
snap_elig_but_not_enrolled = snap_eligible_children - snap_enrolled_children,
percent_elig_but_not_enrolled = (snap_elig_but_not_enrolled / snap_eligible_children) * 100
)
head(snap_summary_senate)# A tibble: 6 × 6
NAME total_children snap_eligible_children snap_enrolled_children
<chr> <dbl> <dbl> <dbl>
1 State Senate Dis… 219134 59160 56726
2 State Senate Dis… 245480 61136 65008
3 State Senate Dis… 227544 32944 45305
4 State Senate Dis… 221761 25389 26001
5 State Senate Dis… 218330 98467 92737
6 State Senate Dis… 194216 35112 35149
# ℹ 2 more variables: snap_elig_but_not_enrolled <dbl>,
# percent_elig_but_not_enrolled <dbl>
snap_summary_senate <- snap_summary_senate|>
mutate(NAME = str_extract(NAME, "\\d+")) |>
mutate(NAME = as.character(NAME))
tx_senate_districts <- tx_senate_districts |>
mutate(NAME = as.character(NAME))
tx_child_map_senate <- left_join(tx_senate_districts, snap_summary_senate, by = "NAME")
# Plot the % of children eligible but not enrolled
ggplot(tx_child_map_senate) +
geom_sf(aes(fill = percent_elig_but_not_enrolled)) +
scale_fill_viridis_c(option = "inferno", na.value = "white") +
theme_minimal() +
labs(title = "Children Eligible but Not Enrolled in SNAP (TX Senate Districts)",
fill = "% Eligible but Not Enrolled")Medicaid and CHIP by House District
child_medicaid_chip_vars <- c(
total_children = "B17006_001",
children_below_poverty = "B17006_002",
children_medicaid_chip_male = "C27007_004", # Estimate!!Total:!!Male:!!Under 19 years:!!With Medicaid/means-tested public coverage
children_medicaid_chip_female = "C27007_014" #Estimate!!Total:!!Female:!!Under 19 years:!!With Medicaid/means-tested public coverage
)
tx_child_medicaid_chip_house <- get_acs(
geography = "state legislative district (lower chamber)",
state = "TX",
variables = child_medicaid_chip_vars,
year = 2023,
survey = "acs5"
)Getting data from the 2019-2023 5-year ACS
head(tx_child_medicaid_chip_house)# A tibble: 6 × 5
GEOID NAME variable estimate moe
<chr> <chr> <chr> <dbl> <dbl>
1 48001 State House District 1 (2022); Texas total_children 45247 219
2 48001 State House District 1 (2022); Texas children_below_pove… 10507 1184
3 48001 State House District 1 (2022); Texas children_medicaid_c… 11630 808
4 48001 State House District 1 (2022); Texas children_medicaid_c… 10160 716
5 48002 State House District 2 (2022); Texas total_children 47755 292
6 48002 State House District 2 (2022); Texas children_below_pove… 7512 1069
medicaid_summary_house <- tx_child_medicaid_chip_house |>
group_by(NAME) |>
summarise(
total_children = sum(estimate[variable == "total_children"]),
eligible_children = sum(estimate[variable %in% c("children_below_poverty")]),
enrolled_children = sum(estimate[variable %in% c("children_medicaid_chip_male", "children_medicaid_chip_female")])
) %>%
mutate(
elig_but_not_enrolled = eligible_children - enrolled_children,
percent_elig_but_not_enrolled = (elig_but_not_enrolled / eligible_children) * 100
)
head(medicaid_summary_house)# A tibble: 6 × 6
NAME total_children eligible_children enrolled_children elig_but_not_enrolled
<chr> <dbl> <dbl> <dbl> <dbl>
1 Stat… 45247 10507 21790 -11283
2 Stat… 53195 5867 15452 -9585
3 Stat… 48628 15975 31325 -15350
4 Stat… 58819 8032 22645 -14613
5 Stat… 46681 11054 22351 -11297
6 Stat… 41938 10040 21297 -11257
# ℹ 1 more variable: percent_elig_but_not_enrolled <dbl>
medicaid_summary_house <- medicaid_summary_house|>
mutate(NAME = str_extract(NAME, "\\d+")) |>
mutate(NAME = as.character(NAME))
tx_house_districts <- tx_house_districts |>
mutate(NAME = as.character(NAME))
tx_child_map_house <- left_join(tx_house_districts, medicaid_summary_house, by = "NAME")
# Plot the % of children eligible but not enrolled
ggplot(tx_child_map_house) +
geom_sf(aes(fill = percent_elig_but_not_enrolled)) +
scale_fill_viridis_c(option = "inferno", na.value = "white") +
theme_minimal() +
labs(title = "Children Eligible but Not Enrolled in Medicaid or CHIP (TX House Districts)",
fill = "% Eligible but Not Enrolled")Medicaid and CHIP by Senate District
child_medicaid_chip_vars <- c(
total_children = "B17006_001",
children_below_poverty = "B17006_002",
children_medicaid_chip_male = "C27007_004", # Estimate!!Total:!!Male:!!Under 19 years:!!With Medicaid/means-tested public coverage
children_medicaid_chip_female = "C27007_014" #Estimate!!Total:!!Female:!!Under 19 years:!!With Medicaid/means-tested public coverage
)
tx_child_medicaid_chip_senate <- get_acs(
geography = "state legislative district (upper chamber)",
state = "TX",
variables = child_medicaid_chip_vars,
year = 2023,
survey = "acs5"
)Getting data from the 2019-2023 5-year ACS
head(tx_child_medicaid_chip_senate)# A tibble: 6 × 5
GEOID NAME variable estimate moe
<chr> <chr> <chr> <dbl> <dbl>
1 48001 State Senate District 1 (2022); Texas total_children 219134 716
2 48001 State Senate District 1 (2022); Texas children_below_pov… 44049 2464
3 48001 State Senate District 1 (2022); Texas children_medicaid_… 53267 1895
4 48001 State Senate District 1 (2022); Texas children_medicaid_… 48081 1694
5 48002 State Senate District 2 (2022); Texas total_children 246320 2757
6 48002 State Senate District 2 (2022); Texas children_below_pov… 33068 2586
medicaid_summary_senate <- tx_child_medicaid_chip_senate |>
group_by(NAME) |>
summarise(
total_children = sum(estimate[variable == "total_children"]),
eligible_children = sum(estimate[variable %in% c("children_below_poverty")]),
enrolled_children = sum(estimate[variable %in% c("children_medicaid_chip_male", "children_medicaid_chip_female")])
) %>%
mutate(
elig_but_not_enrolled = eligible_children - enrolled_children,
percent_elig_but_not_enrolled = (elig_but_not_enrolled / eligible_children) * 100
)
head(medicaid_summary_senate)# A tibble: 6 × 6
NAME total_children eligible_children enrolled_children elig_but_not_enrolled
<chr> <dbl> <dbl> <dbl> <dbl>
1 Stat… 219134 44049 101348 -57299
2 Stat… 245480 45035 102931 -57896
3 Stat… 227544 24470 63554 -39084
4 Stat… 221761 17168 43667 -26499
5 Stat… 218330 73616 132136 -58520
6 Stat… 194216 25932 53818 -27886
# ℹ 1 more variable: percent_elig_but_not_enrolled <dbl>
medicaid_summary_senate <- medicaid_summary_senate|>
mutate(NAME = str_extract(NAME, "\\d+")) |>
mutate(NAME = as.character(NAME))
tx_senate_districts <- tx_senate_districts |>
mutate(NAME = as.character(NAME))
tx_child_map_house <- left_join(tx_senate_districts, medicaid_summary_senate, by = "NAME")
# Plot the % of children eligible but not enrolled
ggplot(tx_child_map_house) +
geom_sf(aes(fill = percent_elig_but_not_enrolled)) +
scale_fill_viridis_c(option = "inferno", na.value = "white") +
theme_minimal() +
labs(title = "Children Eligible but Not Enrolled in Medicaid or CHIP (TX Senate Districts)",
fill = "% Eligible but Not Enrolled")