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

Add in the attrition records drop when creating concept cohort #366

Merged
merged 3 commits into from
Oct 22, 2024

Conversation

nmercadeb
Copy link
Collaborator

@nmercadeb nmercadeb commented Oct 22, 2024

- conceptCohort attrition:

>  attrition(cohort)
# A tibble: 4 × 7
  cohort_definition_id number_records number_subjects reason_id reason                       excluded_records excluded_subjects
                 <int>          <int>           <int>     <int> <chr>                                   <int>             <int>
1                    1              9               2         1 Initial qualifying events                   0                 0
2                    1              9               2         2 Record start <= record end                  0                 0
3                    1              9               2         3 Record in observation                       0                 0
4                    1              4               2         4 Collapse overlapping records                5                 0

- measurementCohort attrition( (after PR revision):

> cdm$cohort |> attrition()
# A tibble: 5 × 7
  cohort_definition_id number_records number_subjects reason_id reason                                    excluded_records excluded_subjects
                 <int>          <int>           <int>     <int> <chr>                                                <int>             <int>
1                    1              5               3         1 Initial qualifying events                                0                 0
3                    1              2               2         2 Not missing record date                                  0                 0
4                    1              2               2         3 Record in observation                                    0                 0
5                    1              2               2         4 Distinct measurement records                             0                 0

@nmercadeb nmercadeb marked this pull request as draft October 22, 2024 13:48
@nmercadeb nmercadeb marked this pull request as ready for review October 22, 2024 14:58
cohort <- cohort |>
dplyr::filter(!!!filterExpr) |>
dplyr::compute(name = name, temporary = FALSE) |>
omopgenerics::recordCohortAttrition(reason = "Fulfilling measurement value requirements")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nmercadeb I feel like this is a little vague, could it be a bit clearer why records are being dropped?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is when we filter to measurements that recorded a certain outcome/value, but I was not sure whether this should be a separate attrition entrance since maybe t should be included in the "Initial qualifying events"?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think i would not include it

@edward-burn edward-burn merged commit 88a945b into main Oct 22, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

Tell user how many records are dropped for being out of observation in conceptCohort
2 participants