sampleSizeSurvival {biostatUZH} | R Documentation |
Calculates two of the following quantities if one of them is given: Sample size, required number of events and power. The distribution of survival times is assumed to be either non-parametric given a Kaplan-Meier estimate or following an exponential or Weibull model given rate parameters or scale and shape parameters, respectively. The same time unit should be used for the survival times, the accrual period and the follow-up period.
sampleSizeSurvival(HR, a.length, f.length, sig.level=0.05, power=NULL, n = NULL, n.events=NULL, alloc.ratio=1, drop.rate=0, non.inf.margin=NULL, type="sup", dist="exp", lambda=NULL, shape=NULL, survfit.ref=NULL, alternative="two.sided", method="exact")
HR |
Hazard ratio of experimental group vs. control group. |
a.length |
Length of accrual period. |
f.length |
Length of follow-up period. |
sig.level |
Significance level. |
power |
Desired power. |
n |
Required sample size. |
n.events |
Required total number of events. |
alloc.ratio |
Allocation ratio: Ratio of the number of patients in the experimental group divided by the number of patients in the control group. |
drop.rate |
Drop-out rate. |
non.inf.margin |
Non-inferiority margin. |
type |
Study type. Either "sup" or "superiority" for superiority studies or "noninf" or "non-inferiority" for non-inferiority studies. Default is "sup". |
dist |
Distributional assumption for survival times. Either "exp" or "exponential" for exponential, "weib" or "weibull" for Weibull, or "nonp" or "non-parametric" for non-parametric. Default is "exp". |
lambda |
The rate parameter in the exponential distribution and the scale parameter in the Weibull distribution. |
shape |
The shape parameter of the Weibull distribution |
survfit.ref |
The survfit object, i.e. the Kaplan-Meier estimate of survival in the control group. |
alternative |
In c("one.sided","two.sided"), depending on whether the alternative hypothesis is one- or two-sided. |
method |
In c("exact","approx","approximate"), depending on whether the integral for the probability of event is solved with the function integrate or approximated. If a non-parametric approach is chosen only the approximate approach is available. |
A list with the entries
n |
Required sample size. |
HR |
Hazard ratio of experimental group vs. control group. |
power |
Desired power. |
sig.level |
Significance level. |
alternative |
In c("one.sided","two.sided"), depending on whether the alternative hypothesis is one- or two-sided. |
distribution |
Distributional assumption for survival times. Either "exp" or "exponential" for exponential, "weib" or "weibull" for Weibull, or "nonp" or "non-parametric" for non-parametric. |
PrEvent |
Probability that a patient will experience the event during the study. |
Events |
Required total number of events. |
Uriah Daugaard and Leonhard Held
leonhard.held@uzh.ch
Collett, D. (2015). Modelling Survival Data in Medical Research. New York: Chapman and Hall/CRC.
Schoenfeld, D.A. (1983). Sample-Size Formula for the Proportional-Hazards Regression Model. Biometrics, 39, 499–503.
The function sampleSizeSurvival
depends on
NumEvents
and PrEvent
.
## survival of females in lung cancer data data(lung, package = "survival") lung.female <- subset(lung, sex==2) survObj <- Surv(time = lung.female$time, event=lung.female$status==2, type='right') fit <- survfit(survObj ~ 1) ## exponential model exp.reg <- survreg(survObj~1, dist = "exponential") ## Weibull model weib.reg <- survreg(survObj~1, dist = "weibull") ## estimate the sample size with 5 different approaches ## Non-parametric sampleSizeSurvival(HR = .65, power=.90, a.length = 400, f.length = 400, dist = "nonp", survfit.ref = fit, type = "sup", alloc.ratio = 1, method = "approx") ## Exponential, approximate exp.lambda <- 1/exp(coef(exp.reg)) sampleSizeSurvival(HR = .65, power=.90, a.length = 400, f.length = 400, dist = "exp", lambda = exp.lambda, type = "sup", alloc.ratio = 1, method = "approx") ## Exponential, exact sampleSizeSurvival(HR = .65, power=.90, a.length = 400, f.length = 400, dist = "exp", lambda = exp.lambda, type = "sup", alloc.ratio = 1, method = "exact") weib.scale <- unname(exp(coef(weib.reg))) weib.shape <- unname(1/weib.reg$scale) ## Weibull, approximate sampleSizeSurvival(HR = .65, power=.90, a.length = 400, f.length = 400, dist = "weib", lambda = weib.scale, type = "sup", alloc.ratio = 1, shape = weib.shape, method = "approx") ## Weibull, exact sampleSizeSurvival(HR = .65, power=.90, a.length = 400, f.length = 400, dist = "weib", lambda = weib.scale, type = "sup", alloc.ratio = 1, shape = weib.shape, method = "exact")