surv1samp: Sample Size Calculation for a One-Sample Exponential

View source: R/surv1samp.R

surv1sampR Documentation

Sample Size Calculation for a One-Sample Exponential

Description

Computes the sample size for a given size and power for the test for a specified improvement in the exponential rate parameter.

Usage

surv1samp(
  control.rate = NULL,
  pct.imp = NULL,
  acc.per,
  add.fu,
  alpha = 0.1,
  power = 0.9,
  control.med = NULL,
  control.survp = NULL,
  tp = NULL,
  pct.reduc = NULL,
  nonpar = FALSE,
  alt.rate = NULL,
  alt.med = NULL,
  alt.survp = NULL
)

Arguments

control.rate

The hazard rate under the null hypothesis

pct.imp

The percent improvement in the median failure time under the alternative

acc.per

The length of the time period during which patients are accrued

add.fu

The length of time after the end of accrual during which patients continue to be followed prior to analysis

alpha

The one-sided type I error rate

power

The power of the test

control.med

The median under the null

control.survp

The survival probability at tp under the null

tp

Time point for survival probability values and/or the nonparametric test

pct.reduc

Percent reduction in the hazard rate under the alternative

nonpar

If TRUE, the test based on the nonparametric cumulative hazard estimator at tp is used

alt.rate

The hazard rate under the alternative

alt.med

The median under the alternative

alt.survp

The survival probability at tp under the alternative

Details

Accrual is assumed to be uniform over the accrual period, so censoring is uniform on the interval add.fu to acc.per + add.fu. The power is based on the Wald test for the log failure rate parameter unless nonpar=TRUE, in which case the test is based on the nonparametric estimate of the cumulative hazard at tp. Simulations suggest that the distribution approximation to the latter test is anti-conservative, so the test (and the corresponding power calculations should be used with extreme caution). Exponential failures are assumed for the calculations, even for the nonparametric test.

Any combination of parameters determining the null and alternative event rates can be specified.

Value

A vector giving the sample size (n), the number of failures needed (nd), the proportion of failures (fail.prob), the hazard ratio of the null to alternative hazard rates (haz.ratio), the input values of pct.imp and control.rate, the hazard rate under the alternative (alt.rate) and the input values of alpha and beta.

Examples

surv1samp(-1.333 * log(0.96) / 5, 33.3, 4, 3, alpha = 0.1, power = 0.95)
surv1samp(-log(0.95) / 5, 100 * (log(0.95) / log(0.96) - 1), 4, 3,
          alpha = 0.1, power = 0.95)
surv1samp(-log(0.955) / 5, 100 * (log(0.955) / log(0.965) - 1), 4, 3,
          alpha = 0.1, power = 0.95)


raredd/desmon documentation built on May 7, 2024, 3:46 p.m.