-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Refactor estimate_incidence_rate
#1300
Conversation
Example with similar structure to library(tern)
adsl <- random.cdisc.data::cadsl %>% df_explicit_na()
adaette <- random.cdisc.data::cadaette %>% df_explicit_na()
anl <- adaette %>%
dplyr::filter(PARAM == "Time to first occurrence of any adverse event") %>%
dplyr::mutate(n_events = 1 - CNSR)
lyt <- basic_table(show_colcounts = TRUE) %>%
split_cols_by("ARM") %>%
estimate_incidence_rate(
vars = "AVAL",
n_events = "n_events",
.stats = c("person_years", "n_events", "rate")
) %>%
split_rows_by("SEX", child_labels = "visible") %>%
estimate_incidence_rate(
vars = "AVAL",
n_events = "n_events",
.stats = c("n_unique", "n_rate"),
summarize = TRUE,
label_fmt = "%.labels"
) %>%
split_rows_by("STRATA1") %>%
estimate_incidence_rate(
vars = "AVAL",
n_events = "n_events",
.stats = "n_rate",
summarize = TRUE,
label_fmt = "%s"
)
result <- lyt %>% build_table(anl, alt_counts_df = adsl)
result
|
Unit Tests Summary 1 files 84 suites 1m 13s ⏱️ Results for commit 8ce2246. ♻️ This comment has been updated with latest results. |
Unit Test Performance Difference
Additional test case details
Results for commit 5f3a15b ♻️ This comment has been updated with latest results. |
Code Coverage Summary
Diff against main
Results for commit: 8ce2246 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
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.
Lgtm! Thanks Emily :)
block this PR by #1311 |
Signed-off-by: Joe Zhu <[email protected]>
Pull Request
Fixes #1299