Vaginal Delivery Rate

Author

Teresa Do

Goal of this notebook

We want to analyze the Vaginal delivery rate for “uncomplicated” births, using the list of codes that indicate vaginal deliveries. The list of codes originally came from IQI 22 Vaginal Birth After Cesarean (VBAC) Delivery Rate, Uncomplicated but are repurposed to be more general.

This is the definition we will use for vaginal deliveries:

“Vaginal births per 1,000 deliveries identified by VAGDELP out of deliveries identified by DELOCMD. Excludes deliveries with complications (abnormal presentation, preterm delivery, fetal death, multiple gestation, or breech presentation).”

Setup

Loading libraries.

Expand this to see code
library(tidyverse)
library(janitor)
library(DT)

Import Vaginal delivery data

We previously created a data set that flagged vaginal deliveries in the Categorization notebook.. We will need to import that data to this notebook so that we can do some analysis.

Expand this to see code
tx_deliveries_vaginal <- read_rds("../data-processed/vagdel.rds")

Import hospital lists

Additionally, since our breakdown involves breaking down these rates by hospital, we need some of the lists that we created in the Stored Lists notebook.These lists group by brand for the hospital as well as distinguish whether a hospital is in the Texas Medical Center.

Expand this to see code
# list of Texas Medical Center hospitals
tmc_list <- read_rds("../data-published/technical-specs/tmc.rds") |> pull(name)

# brand and unaffiliated lists
harris_health_list <- read_rds("../data-published/technical-specs/harris_health.rds") |> pull(name)
hca_list <- read_rds("../data-published/technical-specs/hca.rds") |> pull(name)
houston_methodist_list <- read_rds("../data-published/technical-specs/houston_methodist.rds") |> pull(name)
memorial_hermann_list <- read_rds("../data-published/technical-specs/memorial_hermann.rds") |> pull(name)
unaffiliated_list <- read_rds("../data-published/technical-specs/unaffiliated.rds") |> pull(name)

Functions

Here I’m going to define some functions that will help us to make some graphs with varying parts of the data.

Adding the vaginal rate

First, we’ll make a function that allows us to add the vaginal delivery rate.

Expand this to see code
add_vagdel_calc <- function(.data, num_del) {
  .data |>
    summarize(CNT = n()) |>
    pivot_wider(names_from = VAGDEL, values_from = CNT) |>
    rename(
      NON_VAGDEL_CNT = "FALSE",
      VAGDEL_CNT = "TRUE"
    ) |>
    mutate(
      TOTAL = NON_VAGDEL_CNT + VAGDEL_CNT
    ) |>
    filter(
      TOTAL > 30
    ) |>
    mutate(
      # this gives us the percentage of total deliveries that are VAGDEL
      VAGDEL_RATE = round_half_up((VAGDEL_CNT / TOTAL) * 100, 1)
    ) |>
    mutate(
      # we want to create a column that will use the rate we previously
      # calculated to give us a number out of how many deliveries would appear
      # as VAGDEL -- use an adjustable value so I don't have to change this
      # if we decide on a different number
      VAGDEL_DEL_PER = round_half_up((VAGDEL_CNT / TOTAL) * num_del, 1)
    )
}

Adding the Medicaid rate

We are also interested in the percentage of mothers that used Medicaid as their payment source for their vaginal delivery. We’ll create a function that adds this rate.

Expand this to see code
add_medicaid <- function(.data, num_del) {
  .data |>
    group_by(YR, VAGDEL_MC_CATEGORY) |>
    summarize(CNT = n()) |>
    pivot_wider(names_from = VAGDEL_MC_CATEGORY, values_from = CNT) |>
    mutate(
      TOTAL_MC = NONVAGDEL_MC + VAGDEL_MC,
      TOTAL_NONMC = NONVAGDEL_NONMC + VAGDEL_NONMC
    ) |>
    filter(TOTAL_MC > 30 | TOTAL_NONMC > 30) |>
    mutate(
      MC_DEL_PER = round_half_up((VAGDEL_MC / TOTAL_MC) * num_del, 1),
      NONMC_DEL_PER = round_half_up((VAGDEL_NONMC / TOTAL_NONMC) * num_del, 1)
    ) |>
    pivot_longer(
      cols = c(MC_DEL_PER, NONMC_DEL_PER),
      names_to = "DEL_PER_TYPE",
      values_to = "DEL_PER"
    )
}

Individual hospital graphs

Let’s also make a function that provides a template for what the individual hospital graphs will look like.

Expand this to see code
create_hosp_graph <- function(.data) {
  .data |>
    ggplot(aes(x = YR, y = VAGDEL_DEL_PER)) +
    geom_col() +
    scale_y_continuous(limits = c(0, 800)) +
    geom_text(aes(label = VAGDEL_DEL_PER), vjust = 1.5, color = "white", size = 3) +
    facet_wrap(~ FAC_NAME, ncol = 2) +
    theme(
      legend.position = "bottom"
    )
}

Individual hospital graphs by race

We can make our lives so much easier by making a function for each individual graph, similar to the one above, that also includes race.

First let’s define some colors that we’ll use for the race graphs. We want these colors to be consistent across all of the plots. We are using colors based on a Washington Post article on the subject.

Expand this to see code
race_colors <- c(
  "Hispanic" = "#ecda5c",
  "American Indian" = "#a4c589",
  "Asian or Pacific Islander" = "#c69cc1",
  "Black" = "#d89d88",
  "White" = "#8eb3be",
  "Other" = "#c8ad68"
)

Now we can build a function to create race graphs using these specified colors.

Expand this to see code
 create_race_graph <- function(.data) {
   .data |>
     ggplot(aes(x = YR, y = VAGDEL_DEL_PER)) +
     geom_point(aes(color = MOD_RACE)) +
     geom_line(aes(color = MOD_RACE, group = MOD_RACE)) +
     scale_y_continuous(limits = c(0, 800)) +
     scale_color_manual(values = race_colors, name = "Race") +
     facet_wrap(~ FAC_NAME, ncol = 2) +
     theme(
       legend.position = "bottom"
     )
 }

Analysis

Vaginal rate by year for state

In order to showcase the data visually, there are some things we have to do to the data set in order to prepare it to be plotted/shown in a table. This includes making a column for the rate per year. We will do this by hospital, but this might not be relevant to certain tables.

Expand this to see code
ahrq_vaginal_rate_tx <- tx_deliveries_vaginal |>
  group_by(YR, VAGDEL) |>
  add_vagdel_calc(1000)

ahrq_vaginal_rate_tx

Now, plot.

Expand this to see code
gavdel_yr_tx <- ahrq_vaginal_rate_tx |>
  ggplot(aes(x = YR, y = VAGDEL_DEL_PER)) +
  geom_col() +
  scale_y_continuous(limits = c(0, 800)) +
  geom_text(aes(label = VAGDEL_DEL_PER), vjust = 1.5, color = "white") +
  labs(
    title = "Rate of vaginal deliveries by year in Texas",
    subtitle = str_wrap("The ratio is calculated using the number of vaginal deliveries in all of Texas. The rate is presented per 1,000 deliveries."),
    x = "Year", y = "Number of vaginal deliveries per 1,000 deliveries",
    caption = "Source: Texas Inpatient Public Use Data File"
  ) +
  theme_minimal()

ggsave("../data-published/figures/vagdel/vagdel-yr-tx.png", width = 6, height = 6, units = "in")

Saved Version:

Rate of vaginal deliveries by year in Texas

Vaginal deliveries paid for with Medicaid for Texas

We are interested in the number of vaginal deliveries that are paid for by Medicaid in all of Texas. We need to add the rate per year and then plot by year. First, let’s add the rate.

Expand this to see code
vaginal_mc_tx <- tx_deliveries_vaginal |>
  add_medicaid(1000)

vaginal_mc_tx

Now, plot by year.

Expand this to see code
vagdel_mc_tx <- vaginal_mc_tx |>
  ggplot(aes(x = YR, y = DEL_PER, group = DEL_PER_TYPE)) +
  geom_point(aes(color = DEL_PER_TYPE)) +
  geom_line(aes(color = DEL_PER_TYPE)) +
  scale_y_continuous(limits = c(0, 800)) +
  scale_color_discrete(labels = c("With Medicaid", "Without Medicaid"), name = "Rate of vaginal deliveries") +
  labs(
    title = str_wrap("Rate of vaginal deliveries for Medicaid cases in Texas"),
    subtitle = str_wrap("The ratio is calculated using the number of vaginal deliveries within a specific insurance payment group (Medicaid vs. Non-Medicaid). The rate is presented per 1,000 deliveries."),
    x = "Year", y = "Number of vaginal deliveries (per 1,000 deliveries)",
    caption = "Source: Texas Inpatient Public Use Data File"
  ) +
  theme_minimal()

ggsave("../data-published/figures/vagdel/vagdel-mc-tx.png", width = 8, height = 6, units = "in")

Saved Version:

Rate of vaginal deliveries for Medicaid cases in Texas

Vaginal rate by year for Harris County

Need to limit the statewide data to just Harris County like we had done in the cleaning notebook.

Expand this to see code
ahrq_vaginal_rate_harris <- tx_deliveries_vaginal |>
  filter(FAC_CNTY == "Harris") |>
  group_by(YR, VAGDEL) |>
  add_vagdel_calc(1000)

ahrq_vaginal_rate_harris

We can now plot it similar to how we did statewide.

Expand this to see code
ahrq_vaginal_rate_harris |>
  ggplot(aes(x = YR, y = VAGDEL_DEL_PER)) +
  geom_col() +
  scale_y_continuous(limits = c(0, 800)) +
  geom_text(aes(label = VAGDEL_DEL_PER), vjust = 1.5, color = "white") +
  labs(
    title = "Rate of vaginal deliveries by year in Harris County",
    subtitle = str_wrap("The ratio is calculated using the number of vaginal deliveries in Harris County. The rate is presented per 1,000 deliveries."),
    x = "Year", y = "Number of vaginal deliveries (per 1,000)",
    caption = "Source: Texas Inpatient Public Use Data File"
  ) +
  theme_minimal()

Expand this to see code
ggsave("../data-published/figures/vagdel/vagdel-yr-harris.png")

Saved Version:

Rate of vaginal deliveries by year in Harris County

Vaginal deliveries with Medicaid for Harris County

We are interested in the same analysis for percentage of mothers that paid with Medicaid for their vaginal delivery but specifically for Harris County. We need to filter for Harris County cases and then apply the same steps.

Expand this to see code
vaginal_mc_harris <- tx_deliveries_vaginal |>
  filter(FAC_CNTY == "Harris") |>
  add_medicaid(1000)

vaginal_mc_harris

Now, plot.

Expand this to see code
vagdel_mc_harris <- vaginal_mc_harris |>
  ggplot(aes(x = YR, y = DEL_PER, group = DEL_PER_TYPE)) +
  geom_point(aes(color = DEL_PER_TYPE)) +
  geom_line(aes(color = DEL_PER_TYPE)) +
  scale_y_continuous(limits = c(0, 800)) +
  scale_color_discrete(labels = c("With Medicaid", "Without Medicaid"), name = "Rate of vaginal deliveries") +
  labs(
    title = str_wrap("Rate of vaginal deliveries for Medicaid cases in Harris County"),
    subtitle = str_wrap("The ratio is calculated using the number of vaginal deliveries within a specific insurance payment group (Medicaid vs. Non-Medicaid). The rate is presented per 1,000 deliveries."),
    x = "Year", y = "Number of vaginal deliveries (per 1,000 deliveries)",
    caption = "Source: Texas Inpatient Public Use Data File"
  ) +
  theme_minimal()

ggsave("../data-published/figures/vagdel/vagdel-mc-harris.png", width = 8, height = 6, units = "in")

Saved Version:

Rate of vaginal deliveries for Medicaid cases in Harris County

Individual hospitals by brand

Let’s compare the Cesarean delivery rate across different hospitals in Harris County. We’ll prep the data so that it includes the facility’s name and ID.

Expand this to see code
ahrq_vaginal_rate_hosp <- tx_deliveries_vaginal |>
  filter(FAC_CNTY == "Harris") |>
  group_by(YR, THCIC_ID, FAC_NAME, VAGDEL) |>
  add_vagdel_calc(1000)
  
ahrq_vaginal_rate_hosp |> datatable()

Now we can plot all of the individual hospitals into separate graphs. We’ll group up individual graphs by brand and by location.

Here are the brands of hospitals found in the Harris County data:

  • Harris Health
  • HCA Houston Healthcare
  • Houston Methodist
  • Memorial Hermann

Harris Health

Let’s take a look at the Harris Health hospitals.

Expand this to see code
vagdel_hosp_harris_health <- ahrq_vaginal_rate_hosp |>
  filter(
    FAC_NAME %in% harris_health_list
    ) |>
  create_hosp_graph() +
  labs(
    title = str_wrap("Rate of vaginal deliveries by year for Harris Health hospitals"),
    subtitle = str_wrap("The ratio is calculated using the number of vaginal deliveries at each Harris Health hospital. The rate is presented per 1,000 deliveries."),
    x = "Year", y = "Number of vaginal deliveries (per 1,000 deliveries)",
    caption = "Source: Texas Inpatient Public Use Data File"
  )

ggsave("../data-published/figures/vagdel/vagdel-hosp-harris-health.png", width = 8, height = 4, units = "in")

Saved Version:

Rate of vaginal deliveries for Harris Health

HCA Houston Healthcare

Same with HCA Houston Healthcare hospitals.

Expand this to see code
vagdel_hosp_hca <- ahrq_vaginal_rate_hosp |>
  filter(
    FAC_NAME %in% hca_list
    ) |>
  create_hosp_graph() +
  labs(
    title = str_wrap("Rate of vaginal deliveries by year for HCA Houston Healthcare hospitals"),
    subtitle = str_wrap("The ratio is calculated using the number of vaginal deliveries at each HCA Houston Healthcare hospital. The rate is presented per 1,000 deliveries."),
    x = "Year", y = "Number of vaginal deliveries (per 1,000 deliveries)",
    caption = "Source: Texas Inpatient Public Use Data File"
  )

ggsave("../data-published/figures/vagdel/vagdel-hosp-hca.png")

Saved Version:

Rate of vaginal deliveries by year for HCA hospitals

Houston Methodist

Houston Methodist hospitals next.

Expand this to see code
vagdel_hosp_houston_methodist <- ahrq_vaginal_rate_hosp |>
  filter(
    FAC_NAME %in% houston_methodist_list
    ) |>
  create_hosp_graph() +
  labs(
    title = str_wrap("Rate of vaginal deliveries by year for Houston Methodist hospitals"),
    subtitle = str_wrap("The ratio is calculated using the number of vaginal deliveries at each Houston Methodist hospital. The rate is presented per 1,000 deliveries."),
    x = "Year", y = "Number of vaginal deliveries (per 1,000 deliveries)",
    caption = "Source: Texas Inpatient Public Use Data File"
  )

ggsave("../data-published/figures/vagdel/vagdel-hosp-houston-methodist.png")

Saved Version:

Rate of vaginal deliveries by year for Houston Methodist

Memorial Hermann

Finally, Memorial Hermann hospitals.

Expand this to see code
vagdel_hosp_memorial_hermann <- ahrq_vaginal_rate_hosp |>
  filter(
    FAC_NAME %in% memorial_hermann_list
    ) |>
  create_hosp_graph() +
  labs(
    title = str_wrap("Rate of vaginal deliveries by year for Memorial Hermann hospitals"),
    subtitle = str_wrap("The ratio is calculated using the number of vaginal deliveries at each Memorial Hermann hospital. The rate is presented per 1,000 deliveries."),
    x = "Year", y = "Number of vaginal deliveries (per 1,000 deliveries)",
    caption = "Source: Texas Inpatient Public Use Data File"
  )

ggsave("../data-published/figures/vagdel/vagdel-hosp-memorial-hermann.png", width = 8, height = 8, units = "in")

Saved Version:

Rate of vaginal deliveries by year for Memorial Hermann

Unaffiliated hospitals

There are some hospitals in Harris County that don’t have other affiliated hospitals across the county. We will put them all into another set of graphs.

Expand this to see code
vagdel_hosp_unaffiliated <- ahrq_vaginal_rate_hosp |>
  filter(
    FAC_NAME %in% unaffiliated_list
  ) |>
  create_hosp_graph() +
  labs(
    title = str_wrap("Rate of vaginal deliveries by year for unaffiliated hospitals"),
    subtitle = str_wrap("The ratio is calculated using the number of vaginal deliveries at each unaffiliated hospital. The rate is presented per 1,000 deliveries."),
    x = "Year", y = "Number of vaginal deliveries (per 1,000 deliveries)",
    caption = "Source: Texas Inpatient Public Use Data File"
  )

ggsave("../data-published/figures/vagdel/vagdel-hosp-unaffiliated.png", width = 8, height = 6, units = "in")

Saved Version:

Rate of vaginal deliveries by year for unaffiliated hospitals

Harris and Texas comparison

If we want to look at the data for Harris and Texas in one graph, we can plot Harris and Texas as two separate lines.

First, we need to put the Texas and Harris data into one data frame.

Expand this to see code
ahrq_vaginal_rate_combined <- ahrq_vaginal_rate_harris |>
  add_column(CATEGORY = "Harris") |>
  bind_rows(ahrq_vaginal_rate_tx) |>
  # at this point, any unfilled category entry is a Texas entry
  mutate(
    CATEGORY = if_else(is.na(CATEGORY), "Texas", CATEGORY)
  )

ahrq_vaginal_rate_combined

Now we can plot with the grouping being determined by the CATEGORY value.

Expand this to see code
vagdel_harris_tx <- ahrq_vaginal_rate_combined |>
  ggplot(aes(x = YR, y = VAGDEL_DEL_PER)) +
  geom_point(aes(color = CATEGORY)) +
  geom_line(aes(color = CATEGORY, group = CATEGORY)) +
  scale_y_continuous(limits = c(0, 800)) +
  scale_color_discrete(name = "Category") +
  labs(
    title = str_wrap("Rate of vaginal deliveries in Harris County and Texas"),
    subtitle = str_wrap("The ratio is calculated using the number of vaginal deliveries in Texas broadly and Harris County specifically. The rate is presented per 1,000 deliveries."),
    x = "Year", y = "Number of vaginal deliveries (per 1,000 deliveries)",
    caption = "Source: Texas Inpatient Public Use Data File"
  ) +
  theme_minimal()

ggsave("../data-published/figures/vagdel/vagdel-harris-tx.png")

Saved Version:

Rate of vaginal deliveries in Harris County and Texas

Harris and Texas Medicaid comparison

Similar to the last section, we want to see how the percentage of vaginal deliveries paid for by Medicaid differs between Texas and Harris County. First, we need to combine the data we had previously for both Texas and Harris County.

Expand this to see code
vaginal_mc_combined <- vaginal_mc_harris |>
  add_column(CATEGORY = "Harris") |>
  bind_rows(vaginal_mc_tx) |>
  # at this point, any unfilled category entry is a Texas entry
  mutate(
    CATEGORY = if_else(is.na(CATEGORY), "Texas", CATEGORY)
  ) |>
  mutate(
    DEL_PER_TYPE = paste(toupper(CATEGORY), DEL_PER_TYPE, sep = "_")
  ) |>
  select(!CATEGORY)

vaginal_mc_combined

Now, plot.

Expand this to see code
vaginal_mc_combined |>
  ggplot(aes(x = YR, y = DEL_PER, group = DEL_PER_TYPE)) +
  geom_point(aes(color = DEL_PER_TYPE)) +
  geom_line(aes(color = DEL_PER_TYPE)) +
  scale_y_continuous(limits = c(0, 800)) +
  scale_color_discrete(labels = c("Harris County with Medicaid", "Harris County without Medicaid", "Texas with Medicaid", "Texas without Medicaid"), name = "Area + With or Without Medicaid?") +
  labs(
    title = str_wrap("Rate of vaginal deliveries by Medicaid in Harris County and Texas"),
    subtitle = str_wrap("The ratio is calculated using the number of vaginal deliveries within a specific insurance payment group (Medicaid vs. Non-Medicaid). The rate is presented per 1,000 deliveries."),
    x = "Year", y = "Number of vaginal deliveries (per 1,000 deliveries)",
    caption = "Source: Texas Inpatient Public Use Data File",
  ) +
  theme_minimal()

Comparisons for Medical Center

One other facet grouping we wanted to look at was Harris County hospitals in the Medical Center area versus outside of the Medical Center area. We imported this list at the top of this notebook.

Let’s create a new data frame that distinguishes whether a hospital is in the Medical Center or not.

Expand this to see code
ahrq_vaginal_rate_tmc <- tx_deliveries_vaginal |>
  mutate(
    TMC = if_else(FAC_NAME %in% tmc_list, T, F)
  ) |>
  group_by(YR, TMC, VAGDEL) |>
  add_vagdel_calc(1000)

ahrq_vaginal_rate_tmc

Now we can plot the comparison for vaginal delivery rate between hospitals in the Medical Center area and not in the Medical Center area.

Expand this to see code
vagdel_tmc <- ahrq_vaginal_rate_tmc |>
  ggplot(aes(x = YR, y = VAGDEL_DEL_PER)) +
  geom_point(aes(color = TMC)) +
  geom_line(aes(color = TMC, group = TMC)) +
  scale_y_continuous(limits = c(0, 800)) +
  scale_color_discrete(name = "In Medical Center?", labels = c("False", "True")) +
  labs(
    title = str_wrap("Rate of vaginal deliveries in the Texas Medical Center"),
    subtitle = str_wrap("The ratio is calculated using the number of vaginal deliveries within the specific area (TMC vs. Non-TMC). The rate is presented per 1,000 deliveries."),
    x = "Year", y = "Number of vaginal deliveries (per 1,000 deliveries)",
    caption = "Source: Texas Inpatient Public Use Data File"
  ) +
  theme_minimal()

ggsave("../data-published/figures/vagdel/vagdel-tmc.png")

Saved Version:

Rate of vaginal deliveries in the TMC

Analysis by Race

We previously redefined the MOD_RACE categories to also include the difference between Hispanic and non-Hispanic individuals. This was done in the Categorization notebook.

VBAC rate by year for state by race

Prep for plotting.

Expand this to see code
ahrq_vaginal_rate_tx_race <- tx_deliveries_vaginal |>
  group_by(YR, MOD_RACE, VAGDEL) |>
  add_vagdel_calc(1000)
  
ahrq_vaginal_rate_tx_race

Now we try to plot this.

Expand this to see code
vagdel_race_yr_tx <- ahrq_vaginal_rate_tx_race |>
  ggplot(aes(x = YR, y = VAGDEL_DEL_PER))+
  geom_point(aes(color = MOD_RACE)) +
  geom_line(aes(color = MOD_RACE, group = MOD_RACE)) +
  scale_color_manual(values = race_colors, name = "Race") +
  scale_y_continuous(limits = c(0, 800)) +
  labs(
    title = "Rate of vaginal deliveries by year and race in Texas",
    subtitle = str_wrap("The ratio is calculated using the number of vaginal deliveries in Texas with respect to race. The rate is presented per 1,000 deliveries."),
    x = "Year", y = "Number of vaginal deliveries (per 1,000 deliveries)",
    caption = "Source: Texas Inpatient Public Use Data File"
  ) +
  theme_minimal()

ggsave("../data-published/figures/vagdel/vagdel-race-yr-tx.png", width = 8, height = 6, units = "in")

Saved Version:

Rate of vaginal deliveries by year and race in Texas

Vaginal delivery rate by year for Harris County by race

We can do a similar plot for just Harris County hospitals. First, prep the data.

Expand this to see code
ahrq_vaginal_rate_harris_race <- tx_deliveries_vaginal |>
  filter(FAC_CNTY == "Harris") |>
  group_by(YR, MOD_RACE, VAGDEL) |>
  add_vagdel_calc(1000)

ahrq_vaginal_rate_harris_race

There are much fewer American Indian cases than other races.

Now, plot.

Expand this to see code
vagdel_race_yr_harris <- ahrq_vaginal_rate_harris_race |>
  ggplot(aes(x = YR, y = VAGDEL_DEL_PER)) +
  geom_point(aes(color = MOD_RACE)) +
  geom_line(aes(color = MOD_RACE, group = MOD_RACE)) +
  scale_y_continuous(limits = c(0, 800)) +
  scale_color_manual(values = race_colors, name = "Race") +
  labs(
    title = "Rate of vaginal deliveries by year and race in Harris County",
    subtitle = str_wrap("The ratio is calculated using the number of vaginal deliveries in Harris County with respect to race. The rate is presented per 1,000 deliveries."),
    x = "Year", y = "Number of vaginal deliveries (per 1,000 deliveries)",
    caption = "Source: Texas Inpatient Public Use Data File"
  ) +
  theme_minimal()

ggsave("../data-published/figures/vagdel/vagdel-race-yr-harris.png")

Saved Version:

Rate of vaginal deliveries by year and race in Harris County

Individual hospitals by brand and race

Look at individual hospitals now also with race. First, prep the data.

Expand this to see code
ahrq_vaginal_rate_hosp_race <- tx_deliveries_vaginal |>
  filter(FAC_CNTY == "Harris") |>
  group_by(YR, THCIC_ID, MOD_RACE, FAC_NAME, VAGDEL) |>
  add_vagdel_calc(1000)

ahrq_vaginal_rate_hosp_race

Harris Health

This section will look at all of the Harris Health hospitals with race data included.

Expand this to see code
vagdel_hosp_race_harris_health <- ahrq_vaginal_rate_hosp_race |>
  filter(FAC_NAME %in% harris_health_list) |>
  create_race_graph() +
  labs(
    title = str_wrap("Rate of vaginal deliveries by year and race for Harris Health hospitals"),
    subtitle = str_wrap("The ratio is calculated using the number of vaginal deliveries in Harris Health hospitals with respect to race. The rate is presented per 1,000 deliveries."),
    x = "Year", y = "Number of vaginal deliveries (per 1,000 deliveries)",
    caption = "Source: Texas Inpatient Public Use Data File"
  )
  
ggsave("../data-published/figures/vagdel/vagdel-hosp-race-harris-health.png", width = 8, height = 6, units = "in")

Saved Version:

Rate of vaginal deliveries by year and race for Harris Health

HCA Houston Healthcare

Now, HCA Houston Healthcare hospitals.

Expand this to see code
vagdel_hosp_race_hca <- ahrq_vaginal_rate_hosp_race |>
  filter(
    FAC_NAME %in% hca_list
  ) |>
  create_race_graph() +
  labs(
    title = str_wrap("Rate of vaginal deliveries by year and race for HCA Houston Healthcare hospitals"),
    subtitle = str_wrap("The ratio is calculated using the number of vaginal deliveries in HCA Houston Healthcare hospitals with respect to race. The rate is presented per 1,000 deliveries."),
    x = "Year", y = "Number of vaginal deliveries (per 1,000 deliveries)",
    caption = "Source: Texas Inpatient Public Use Data File"
  ) 

ggsave("../data-published/figures/vagdel/vagdel-hosp-race-hca.png", height = 8, width = 8, units = "in")

Saved Version:

Rate of vaginal deliveries by year and race for HCA hospitals

Houston Methodist

Houston Methodist hospitals.

Expand this to see code
vagdel_hosp_race_houston_methodist <- ahrq_vaginal_rate_hosp_race |>
  filter(
    FAC_NAME %in% houston_methodist_list
  ) |>
  create_race_graph() +
  labs(
    title = str_wrap("Rate of vaginal deliveries by year and race for Houston Methodist hospitals"),
    subtitle = str_wrap("The ratio is calculated using the number of vaginal deliveries in Houston Methodist hospitals with respect to race. The rate is presented per 1,000 deliveries."),
    x = "Year", y = "Number of vaginal deliveries (per 1,000 deliveries)",
    caption = "Source: Texas Inpatient Public Use Data File"
  ) 

ggsave("../data-published/figures/vagdel/vagdel-hosp-race-houston-methodist.png", height = 8, width = 8, units = "in")

Saved Version:

Rate of vaginal deliveries by year and race for Houston Methodist

Memorial Hermann

Finally, Memorial Hermann hospitals.

Expand this to see code
vagdel_hosp_race_memorial_hermann <- ahrq_vaginal_rate_hosp_race |>
  filter(
    FAC_NAME %in% memorial_hermann_list
  ) |>
  create_race_graph() +
  labs(
    title = str_wrap("Rate of vaginal deliveries by year and race for Memorial Hermann hospitals"),
    subtitle = str_wrap("The ratio is calculated using the number of vaginal deliveries in Memorial Hermann hospitals with respect to race. The rate is presented per 1,000 deliveries."),
    x = "Year", y = "Number of vaginal deliveries (per 1,000 deliveries)",
    caption = "Source: Texas Inpatient Public Use Data File"
  ) 

ggsave("../data-published/figures/vagdel/vagdel-hosp-race-memorial-hermann.png", height = 8, width = 8, units = "in")

Saved Version:

Rate of vaginal deliveries by year and race for Memorial Hermann

Unaffiliated hospitals

Here are the race breakdowns for all of the hospitals that don’t fall under a brand.

Expand this to see code
vagdel_hosp_race_unaffiliated <- ahrq_vaginal_rate_hosp_race |>
  filter(
    FAC_NAME %in% unaffiliated_list
  ) |>
  create_race_graph() +
  labs(
    title = str_wrap("Rate of vaginal deliveries by year and race for unaffiliated hospitals"),
    subtitle = str_wrap("The ratio is calculated using the number of vaginal deliveries in unaffiliated hospitals with respect to race. The rate is presented per 1,000 deliveries."),
    x = "Year", y = "Number of vaginal deliveries (per 1,000 deliveries)",
    caption = "Source: Texas Inpatient Public Use Data File"
  ) 

ggsave("../data-published/figures/vagdel/vagdel-hosp-race-unaffiliated.png", height = 8, width = 8, units = "in")

Saved Version:

Rate of vaginal deliveries by year and race for unaffiliated hospitals

Comparisons for Medical Center

We will also compare by race for the hospitals in the Medical Center area and for those outside of the Medical Center area.

First, let’s create a data frame that determines whether the hospital is in the Medical Center and include considerations of race and ethnicity.

Expand this to see code
ahrq_vaginal_rate_tmc_race <- tx_deliveries_vaginal |>
  mutate(
    TMC = if_else(FAC_NAME %in% tmc_list, T, F)
  ) |>
  group_by(YR, TMC, MOD_RACE, VAGDEL) |>
  add_vagdel_calc(1000)

ahrq_vaginal_rate_tmc_race

Now we can create two graphs side by side so that we can compare the differences for race between whether a hospital is in the Medical Center or not.

Expand this to see code
tmc_labels <- c("FALSE" = "Not in Medical Center", "TRUE" = "In Medical Center")

vagdel_tmc_race <- ahrq_vaginal_rate_tmc_race |>
  ggplot(aes(x = YR, y = VAGDEL_DEL_PER)) +
  geom_point(aes(color = MOD_RACE)) +
  geom_line(aes(color = MOD_RACE, group = MOD_RACE)) +
  scale_color_manual(values = race_colors, name = "Race") +
  scale_y_continuous(limits = c(0, 800)) +
  facet_wrap(~ TMC, labeller = as_labeller(tmc_labels)) +
  labs(
    title = str_wrap("Rate of vaginal deliveries by year and race in the Texas Medical Center"),
    subtitle = str_wrap("The ratio is calculated using the number of vaginal deliveries both in and outside of the Texas Medical Center with respect to race. The rate is presented per 1,000 deliveries."),
    x = "Year", y = "Number of vaginal deliveries (per 1,000 deliveries)",
    caption = "Source: Texas Inpatient Public Use Data File"
  ) +
  theme(
    legend.position = "bottom"
  )

ggsave("../data-published/figures/vagdel/vagdel-race-tmc.png", height = 6, width = 8, units = "in")

Saved Version:

Rate of vaginal deliveries by year and race in TMC