-
-
Notifications
You must be signed in to change notification settings - Fork 3
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 ard_categorical_max()
#244
Conversation
Unit Tests Summary 1 files 170 suites 1m 14s ⏱️ Results for commit 61e16b6. ♻️ This comment has been updated with latest results. |
Unit Test Performance Difference
Additional test case details
Results for commit b64135c ♻️ This comment has been updated with latest results. |
Code Coverage Summary
Diff against main
Results for commit: c023a1a Minimum allowed coverage is ♻️ This comment has been updated with latest results |
Thanks @edelarua ! Can you help me understand the differences between this and the hierarchical function? Also, when we refer to ordered, does that mean ordered factors? |
This performs similarly to the hierarchical function but doesn't use hierarchies, so calculates event rates for flat tables. The For example, the grade rows in this table could be calculated with Honestly, we could probably simplify the hierarchical functions by implementing this upstream in |
Hmmm, before we merge this in, can we brainstorm together a bit? Either today or next week? |
Would another way to calculate these quantities be: ADAE |>
dplyr::slice_max(AESEV, n = 1, with_ties = FALSE, by = USUBJID) |>
cards::ard_categorical(
by = TRTA,
variables = AESEV,
denominator = ADSL |> dplyr::select(USUBJID, TRTA = ARM)
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, thank you!! Let's chat about the comments before you move forward making any changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is getting close! I am confusing myself thinking about the dataset passed in denominator
when it doesn't have all the by
variables. I think it may result in incorrect values.... 🤷🏼
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's chat and discuss!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thank you! Just add a NEWS entry and let's merge 👯
What changes are proposed in this pull request?
ard_categorical_max()
to calculate categorical occurrence rates by maximum level per unique ID. (Add ARD function for counting patients #240)Closes #240
Pre-review Checklist (if item does not apply, mark is as complete)
usethis::pr_merge_main()
ard_*()
function was added, it passes the ARD structural checks fromcards::check_ard_structure()
.ard_*()
function was added,set_cli_abort_call()
has been set.ard_*()
function was added and it depends on another package (such as,broom
),is_pkg_installed("broom")
has been set in the function call and the following added to the roxygen comments:@examplesIf do.call(asNamespace("cardx")$is_pkg_installed, list(pkg = "broom""))
devtools::test_coverage()
Reviewer Checklist (if item does not apply, mark is as complete)
devtools::test_coverage()
When the branch is ready to be merged:
NEWS.md
with the changes from this pull request under the heading "# cardx (development version)
". If there is an issue associated with the pull request, reference it in parentheses at the end update (seeNEWS.md
for examples).