data-raw/combine_education.R

usa_data %<>%
    rename(Census_Population = Population)

cps_data %<>%
    rename(CPS_Population = Population)

age_group_levels <- c("85+ years", "75-84 years", "65-74 years", "55-64 years",
                    "45-54 years", "35-44 years", "25-34 years",
                    "20-24 years", "15-19 years", "10-14 years",
                    "5-9 years", "1-4 years",  "< 1 year", "Not Stated")

education_levels <- c("Missing/Unknown", "Advanced degree", "Bachelor's degree",
                      "Some college or associate's degree",
                      "High school completion", "Less than high school")

education_data <-
    full_join(usa_data, cps_data) %>%
    data.frame() %>%
    mutate(Age_Group = ordered(Age_Group, levels = age_group_levels)) %>%
    mutate(Race = factor(Race)) %>%
    mutate(Sex = factor(Sex)) %>%
    mutate(Education = ordered(Education, levels = education_levels)) %>%
    mutate(Census_Population = round(Census_Population)) %>%
    mutate(CPS_Population = round(CPS_Population)) %>%
    arrange(Year, Race, Sex, Age_Group, Education)
schifferl/LagSelectionBias documentation built on May 29, 2019, 3:38 p.m.