#create dummy table of household data, where each row represents one member
df_hh <- data.frame(HHID = sample(
x = 1:300,
size = 1000,
replace = TRUE
),
age_cat = ordered(sample(
x = c("18-24", "25-39", "40-64", "64-100"),
size = 1000,
replace = TRUE
)))
table_basicstats(df_hh, "HHID", "age_cat")
Run the code above in your browser using DataLab