Created
January 6, 2023 12:54
-
-
Save nrkoehler/339191b6acaf5e5ef8365e9d8ec826b4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
report_samplesize_t.test <- function(pwr, drop_out){ | |
n_raw <- ceiling(pwr$n) | |
n_total <- (n_raw + ceiling(n_raw * drop_out))*2 | |
glue::glue("A two-sample t-test to detect a difference of {round(pwr$delta, 1)} l/min between the groups with an SD of {round(pwr$sd, 1)} l/min has power of {pwr$power*100}% if {ceiling(pwr$n)} patients per arm are randomized. Allowing for a drop-out of {drop_out*100}% implies that {n_total} patients need to be randomized in total.") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment