pow2 {agpower} | R Documentation |
Power for LWYY (fixed sample size)
Description
Function to compute power at one-sided Type I control level alp/2.
Usage
pow2(N, bta1, thta, L, alp = 0.05, ar = 0.5)
Arguments
N |
Sample size. |
bta1 |
log-transform of rate ratio. |
thta |
Variance of frailty parameter. |
L |
Number of events. |
alp |
Two-sided alpha-level. |
ar |
Allocation ratio (Number control / Total) |
Value
The power given the input assumptions.
Examples
pow2(N = 500, bta1 = log(0.8), thta = 2, L = 1000, alp = 0.05)
pow2(N = 500, bta1 = log(0.8), thta = 3, L = 1000, alp = 0.05)
if (require("dplyr") & require("tidyr")) {
assumptions = tibble(alp = 0.05) %>%
crossing(
thta = c(1),
RR = c(0.6, 0.7, 0.8),
L = c(1000, 1500, 2000),
N = c(500, 1000)
) %>%
mutate(pow = pow2(N = N, bta1 = log(RR), thta = thta, L = L, alp = alp))
assumptions %>% data.frame()
}
[Package agpower version 0.1.2 Index]