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

create_age_groups with bins of custom lengths #93

Open
r6lm opened this issue Apr 18, 2023 · 1 comment
Open

create_age_groups with bins of custom lengths #93

r6lm opened this issue Apr 18, 2023 · 1 comment
Assignees

Comments

@r6lm
Copy link

r6lm commented Apr 18, 2023

Is your feature request related to a problem? Please describe.
At my team, we have to create age bands which do not have the same length. Currently, the create_age_groups does not allow this.

Describe the solution you'd like
I created a simple version of create_age_groups which allows custom bin lengths by specifying the cut points with a numeric vector.

@Moohan
Copy link
Member

Moohan commented Jul 2, 2024

@r6lm This is a great idea and something we'd like to see taken forward.

Do you have a suggested implementation? I like the idea of an age_breaks parameter that would take a vector of integers, and override the default behaviour of create_age_groups.

@Nic-Chr suggested providing 'common' age bands - #54 (comment) however, I think these are already easy enough to do with create_age_groups and the advantage to be had here would be to allow 'non-systematic' groupings e.g. 0-18, 18-40, 40-65, 65+ etc. Nic's implementation does allow that - https://phs-git.nhsnss.scot.nhs.uk/Nic-Chr/rtemethods/src/branch/master/R/age_band.R so I think those ideas could be brought into phsmethods::create_age_groups

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants