Calculating Growth Rate with Tidycensus?

Hi all. I'm trying to understand the best way of calculating a growth rate for individual counties in Tidycensus using the population estimates by age, race, and ethnicity. I need to only use the dates that are population estimates and not the estimates base or census population. Can anyone offer some help on this? I assume I need to group by county and the other variables and then exclude the two estimate types I don't want.

library(tidycensus)
library(tidyverse)

va_age_sex_race <- get_estimates(
geography = "county",
state = "VA",
product = "characteristics",
breakdown = c("AGEGROUP", "RACE", "SEX", "HISP"),
breakdown_labels = TRUE,
year = 2019,
time_series = TRUE
)
str(va_age_sex_race)

dates_va_age_sex_race <- va_age_sex_race %>%
mutate(longdate =
case_when(
DATE == 1 ~ "4/1/2010",
DATE == 2 ~ "4/1/2010",
DATE == 3 ~ "7/1/2010",
DATE == 4 ~ "7/1/2011",
DATE == 5 ~ "7/1/2012",
DATE == 6 ~ "7/1/2013",
DATE == 7 ~ "7/1/2014",
DATE == 8 ~ "7/1/2015",
DATE == 9 ~ "7/1/2016",
DATE == 10 ~ "7/1/2017",
DATE == 11 ~ "7/1/2018",
DATE == 12 ~ "7/1/2019"
))

va_age_sex_race_wdate <- dates_va_age_sex_race %>%
mutate(counttype =
case_when(
DATE == 1 ~ "Census population",
DATE == 2 ~ "Estimates base",
TRUE ~ "Population estimate"
)
)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.