brfss_cg.RdBRFSS Caregiving Module Questions asked from 2015-2020 https://www.cdc.gov/aging/healthybrain/brfss-faq-caregiver.htm.
brfss_cg
A "long" data frame with XX rows of individual BRFSS respondents in a given state and year and YY column variables:
indicator, numeric variable of whether respondent was Caregiver (cg_d_num=1) or not (cg_d_num=0)
indicator, factor variable of whether respondent was Caregiver (cg_d_fct="CG") or not (cg_d_fct="Non-CG")
state FIPS code, labeled with state alphabetic abbreviation
identificaiton variable
Numeric year, 2014-2020
Original, raw sampling weight: 2014-2020
BRFSS Annual Survey Data https://www.cdc.gov/brfss/annual_data/annual_data.htm.
# To adjust the sampling weight (cg_wt_adj) by dividing the # sampling weight (cg_wt_raw) by the number of instances # a state is in the data, run: library(tidyverse)#>#> ✓ ggplot2 3.3.2 ✓ purrr 0.3.4 #> ✓ tibble 3.0.3 ✓ dplyr 1.0.2 #> ✓ tidyr 1.1.2 ✓ stringr 1.4.0 #> ✓ readr 1.4.0 ✓ forcats 0.5.0#> Conflicts ─────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ── #> x dplyr::filter() masks stats::filter() #> x dplyr::lag() masks stats::lag()data(brfss_cg) waves<-brfss_cg %>% filter(year %in% 2016:2018) %>% #keeping only 2016-2018 for illustration group_by(year,state) %>% slice(1) %>% #keeping the first observation of each state + year ungroup() %>% group_by(state) %>% #grouping by state count() %>% #counting how many years the state was included rename(wave=n) #renaming as wave brfss_cg<-full_join(brfss_cg,waves,by="state") %>% mutate(cg_wt_adj = cg_wt_raw/wave) #adjusting the weight by number of waves