Chapter 6 - Sample Size Calculation and Study Design
Department of Biostatistics & Medical Informatics
University of Wisconsin-Madison
Sample size for Cox model and RMST
Impact of study design and censoring
An example using pilot study
\[\newcommand{\d}{{\rm d}}\] \[\newcommand{\T}{{\rm T}}\] \[\newcommand{\dd}{{\rm d}}\] \[\newcommand{\pr}{{\rm pr}}\] \[\newcommand{\var}{{\rm var}}\] \[\newcommand{\se}{{\rm se}}\] \[\newcommand{\indep}{\perp \!\!\! \perp}\] \[\newcommand{\Pn}{n^{-1}\sum_{i=1}^n}\]
# ------ integrand function --------------------------------
zeta_integrand <- function(t, tau, lambda0,lambdaL, b, c){
integrand <- (exp(- lambda0 * t) - exp( - lambda0 * tau))^2*
exp(lambda0 * t)/(Gfun(t, lambdaL, b, c) * lambda0)
return(integrand)
}
# ------ numerical integration by integrate() --------------
zeta_fun <- function(tau, lambda0, lambdaL, b, c){
f <- function(t){
return(zeta_integrand(t, tau, lambda0, lambdaL, b, c))
}
zeta <- integrate(f, lower = 0, upper = tau)
return(zeta$value)
}
npsurvSS
Yung, G., & Liu, Y. (2020). Sample size and power for the weighted log‐rank test and Kaplan‐Meier based tests with allowance for nonproportional hazards. Biometrics, 76(3), 939-950.