Following up on my previous post, Obstetrical care in Iowa, I was curious what percentage of Iowans are in a county with an OB Unit.
We can get this pretty easily using the handy usdata R package in combination with the data we extracted previously.
library(usdata)
ob_unit <- read.csv(url("https://raw.githubusercontent.com/fadend/iowa_ob_unit_2023_report/refs/heads/main/iowa_ob_unit_2023_report/generated/ob_unit.csv"), stringsAsFactors=FALSE)
# ob_unit doesn't include a "County" prefix in
# the county names. Create a column matching this
# to join on.
county_complete$county <- gsub(" County", "", county_complete$name)
iowa_data <- county_complete[county_complete$state == "Iowa", ]
ob_unit_iowa_data <- merge(iowa_data, ob_unit, by="county")
With this preamble, now we can take a weighted mean of whether a county has an OB unit or not, weighing by the 2017 population.
> weighted.mean(ob_unit_iowa_data$ob_unit_status == "OB Unit", ob_unit_iowa_data$pop2017)
[1] 0.7670441
So, it looks like around 77% of Iowans are in a county with an OB unit. This doesn’t contradict the message of Kalen McCain’s excellent “HARD TO DELIVER” three part series: Part 1, Part 2, Part 3; that’s focusing on care in more rural areas.
> weighted.mean(ob_unit_iowa_data$rurality == "Metropolitan", ob_unit_iowa_data$pop2017)
[1] 0.6081639
> mean(ob_unit_iowa_data$rurality == "Metropolitan")
[1] 0.2222222
“Metropolitan” counties hold around 61% of the population but make up just around 22% of the 99 counties.
library(dplyr)
> ob_unit_iowa_data |> group_by(rurality) |> summarise(ob_unit_pop_frac=weighted.mean(ob_unit_status == "OB Unit", pop2017)) |> as.data.frame()
rurality ob_unit_pop_frac
1 Metropolitan 0.9023359
2 Micropolitan 0.7697112
3 Rural 0.4243809
Around 90% of the population in “Metropolitan” counties is in a county with an OB unit vs 42% in “Rural” counties.
Leave a Reply