pwr2n.LR: Sample Size Calculation under Proportional Hazards

Description Usage Arguments Details Value References See Also Examples

View source: R/oxy-pwr2n.LR.R View source: R/pwr2n.LR.R

Description

pwr2n.LR calculates the total number of events and total number of subjects required given the provided design parameters based on either schoenfeld or freedman formula.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
pwr2n.LR(
  method = c("schoenfeld", "freedman"),
  lambda0,
  lambda1,
  ratio = 1,
  entry = 0,
  fup,
  alpha = 0.05,
  beta = 0.1,
  alternative = c("two.sided"),
  Lparam = NULL,
  summary = TRUE
)

Arguments

method

calculation formula, Default: c("schoenfeld", "freedman")

lambda0

hazard rate for the control group

lambda1

hazard rate for the treatment group

ratio

randomization ratio between treatment and control. For example, ratio=2 if randomization ratio is 2:1 to treatment and control group. Default:1

entry

enrollment time. A constant enrollment rate is assumed, Default: 0

fup

follow-up time.

alpha

type I error rate, Default: 0.05

beta

type II error rate. For example,if the target power is 80%, beta is 0.2. Default: 0.1

alternative

a value must be one of ("two.sided", "one.sided"), indicating whether a two-sided or one-sided test to use. Default: c("two.sided")

Lparam

a vector of shape and scale parameters for the drop-out Weibull distribution, See Details below. Default: NULL

summary

a logical controlling whether a brief summary is printed or not , Default: TRUE

Details

Both Schoenfeld's formula and Freedman's formula are included in the function pwr2n.LR. The total event number is determined by α, β and hazard ratio, i.e., λ_1/λ_0. Other design parameters such as enrollment period affects the event probability and thus the total sample size. A fixed duration design is assumed in the calculation. All patients are enrolled at a constant rate within entry time and have at least fup time of follow-up. So the total study duration is entry+fup. If drop-out is expected, a Weibull distribution with shape parameter -α and scale parameter - β is considered. The CDF of Weibull is F(x)=1-exp(-(x/β)^α), where α is the shape parameter and β is the scale parameter. The event rate is calculated through numeric integration. See more details in cal_event.

Value

a list of components including

eventN

a numeric value giving the total number of events

totalN

a numeric value giving the total number of subjects

summary

a list containing the input parameters and output results

References

Schoenfeld, D. (1981) The asymptotic properties of nonparametric tests for comparing survival distributions. Biometrika, 68, 316–319.

Freedman, L. S. (1982) Tables of the number of patients required in clinical trials using the logrank test. Statistics in medicine, 1, 121–129.

See Also

pwr2n.NPH, evalfup, cal_event

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# define design parameters
l0 <- log(2)/14; HR <- 0.8; RR <- 2; entry <- 12; fup <- 12;
eg1 <- pwr2n.LR( method    = c("schoenfeld")
                 ,l0
                 ,l0*HR
                 ,ratio=RR
                 ,entry
                 ,fup
                 ,alpha     = 0.05
                 ,beta      = 0.1
)
# event number, total subjects, event probability
c(eg1$eventN,eg1$totalN,eg1$eventN/eg1$totalN)

# example 2: drop-out from an exponential with median time is 30
eg2 <- pwr2n.LR( method    = c("schoenfeld")
                 ,l0
                 ,l0*HR
                 ,ratio=RR
                 ,entry
                 ,fup
                 ,alpha     = 0.05
                 ,beta      = 0.1
                 ,Lparam = c(1,30/log(2))
)
# event number, total subjects, event probability
c(eg2$eventN,eg2$totalN,eg2$eventN/eg2$totalN)

nphPower documentation built on Dec. 1, 2021, 5:06 p.m.