data("toy_data")
# Counts by period, binned by age
plot_binned_counts(toy_data, x = period,
bin_by = age, n_bins = 4)
# Counts by period, binned by age, stratified by education levels
plot_binned_counts(toy_data, period,
bin_by = age, n_bins = 4,
stratify_by = education)
# Counts by period, binned by age, stratified by education levels, for each sex
plot_binned_counts(toy_data, period,
bin_by = age, n_bins = 4,
stratify_by = education, for_each = sex)
Run the code above in your browser using DataLab