Learn R Programming

NPHMC (version 2.2)

NPHMC: An R-package for Estimating Sample Size and Power of Proportional Hazards Mixture Cure Model

Description

Estimating sample size and power of survival trial based on PH mixture cure model and standard PH model

Usage

NPHMC(n=NULL, power = 0.8, alpha = 0.05, accrualtime = NULL, 
followuptime = NULL, p = 0.5, accrualdist = c("uniform", "increasing",
"decreasing"), hazardratio = NULL, oddsratio = NULL, pi0 = NULL, 
survdist = c("exp", "weib"), k = 1, lambda0 = NULL, data = NULL)

Arguments

n

the sample size needed for the power calculation.

power

the power needed for sample size calculation. The default power is \(80\%\).

alpha

the level of significance of the statistical test. The default alpha is 0.05.

accrualtime

the length of accrual period.

followuptime

the length of follow-up time.

p

the proportion of subjects in the treatment arm. The default p is 0.5.

accrualdist

the accrual pattern. It can be "uniform", "increasing" or "decreasing".

hazardratio

the hazard ratio of uncured patients between two arms, which is defined as \(e^{\beta_0}=\lambda_1(t) / \lambda_0(t)\). The value must be greater than 0 but cannot be 1 because \(\beta_0\) is the denominator of the sample size formula.

oddsratio

the odds ratio of cure rates between two arms, which is equivalent to \(e^{\gamma_0}=\frac{\pi_1}{1-\pi_1}/\frac{\pi_0}{1-\pi_0}\). The value should be greater than 0 if there is cured fraction. When it is 0, the model is reduced to the standard proportional hazards model, which means there is no cure rate.

pi0

the cure rate for the control arm, which is between 0 and 1.

survdist

the survival distribution of uncured patients. It can be "exp" or "weib".

k

if survdist = "weib", the shape parameter k needs to be specified. By default k = 1, which refers to the exponential distribution.

lambda0

the scale parameter of exponential distribution or Weibull distribution for survival times of uncured patients in the control arm.

The density function of Weibull distribution with shape parameter k and scale parameter \(\lambda_0\) is given by $$f(t)=\lambda_{0}k(\lambda_{0}t)^{k-1}\exp(-(\lambda_{0}t)^k),$$ for \(t > 0\), and the corresponding survival distribution is $$S(t)=\exp(-(\lambda_0 t)^k). $$

data

if observed/historical data is avaialble, the sample size can be calculated based on the nonparametric estimators from the proportional hazards mixture model by 'smcure' package in R. The data must contain three columns with order of "Time","Status" and "X" where "Time" refers to time to event of interest, "Status" refers to censoring indicator (1=event of interest happens, and 0=censoring) and "X" refers to arm indicator (1=treatment and 0=control). By default, data=NULL.

Value

when data is not specified, the package can return the following estimated sample size (power) values:

nsize

estimated sample size based on the PH mixture cure model

nsizeph

estimated sample size based on the standard PH model

pw

estimated power based on the PH mixture cure model

pwph

estimated power based on the standard PH model

when data is specified, the package will display the estimators from the "smcure" package in R and the returned values list as follows:

f

a list of estimators from the smcure package

nonpar

estimated nonparametric sample size estimation based on the PH mixture cure model and observed data

nonparPH

estimated nonparametric sample size estimation based on the standard PH model and observed data

nonparpw

estimated nonparametric power estimation based on the PH mixture cure model and observed data

nonparpwph

estimated nonparametric power estimation based on the standard PH model and observed data

Examples

Run this code
# NOT RUN {
# parametric sample size calculation
NPHMC(power=0.90,alpha=0.05,accrualtime=3,followuptime=4,p=0.5,accrualdist="uniform",
hazardratio=2/2.5,oddsratio=2.25,pi0=0.1,survdist="exp",k=1,lambda0=0.5)

# nonparametric sample size calculation
data(e1684szdata)
NPHMC(power=0.80,alpha=0.05,accrualtime=4,followuptime=3,p=0.5,accrualdist="uniform",
data=e1684szdata)

# parametric power calculation
n=seq(100, 500, by=50)
NPHMC(n=n, alpha=0.05,accrualtime=3,followuptime=4,p=0.5,
accrualdist="uniform", hazardratio=2/2.5,oddsratio=2.25,pi0=0.1,survdist="exp",
k=1,lambda0=0.5)

# nonparametric power calculation
n=seq(100, 500, by=50)
NPHMC(n=n,alpha=0.05,accrualtime=4,followuptime=3,p=0.5, 
accrualdist="uniform",data=e1684szdata)
# }

Run the code above in your browser using DataLab