rs-delve / covid19_datasets

Interfacing several COVID-19 related datasets
MIT License
45 stars 19 forks source link

Age Regrouping #24

Closed sbodenstein closed 3 years ago

sbodenstein commented 3 years ago

This feature regroups any count data for arbitrary age ranges using the R ungroup package. For example,

regroup_counts_pclm(['0-2', '3-4'], [2,5], max_age=5)
# output (['0-0', '1-1', '2-2', '3-3', '4-4'], [0.41, 0.81, 1.44, 2.09, 2.21])
regroup_counts_pclm(['0-2', '3-6', '7+'], [3,9,12], new_ages=['0-1', '2-5', '6+'])
# output (['0-1', '2-5', '6+'], [2.01, 7.4, 16.9])

Some design questions: