Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

option to prevent the aggregation of age groups (in case of sparse data) #144

Open
lwillem opened this issue Oct 23, 2024 · 1 comment
Open

Comments

@lwillem
Copy link
Contributor

lwillem commented Oct 23, 2024

The current implementation of contact_matrix() aggregates the oldest age groups, for example, combining the 60-89 and 90+ age groups into a single "60+" category if there is no data for the 90+ group. More specifically:


#line 275
adjust age.group.brakes to the lower and upper ages in the survey
survey$participants[, lower.age.limit := reduce_agegroups(
get(columns[["participant.age"]]),
age.limits[age.limits < max.age]
)]
part.age.group.breaks <- c(age.limits[age.limits < max.age], max.age)
part.age.group.present <- age.limits[age.limits < max.age]


Would it be useful to include a flag to disable this behavior and instead return a matrix with NA values if needed, while keeping the age groups fixed? This would be helpful in cases where post-processing assumes a matrix with a fixed number of columns (N), as receiving one with N-1 columns could cause issues.

@sbfnk
Copy link
Collaborator

sbfnk commented Nov 11, 2024

Yes, and I think perhaps your suggested behaviour would actually make sense as default.

@sbfnk sbfnk added this to the 1.0.0 milestone Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants