Determine the asymptotic power of the test of RMST under a given trial design, or calculate the samples size needed to achieve a desired power.

RMSTpow(survdefC, survdefT, k1, k2, tau, n = NA, power = NA,
  plot = F, sim = F, M = 1000, method = "tau_star", alpha = NA,
  two.sided = F)

Arguments

survdefC

the survival distribution of the control group, as a list in the form output by survdef.

survdefT

the survival distribution of the treatment group, as a list in the form output by survdef.

k1

length of the accrual period. We assume subjects will accrue uniformly over the interval (0, k1) and then be followed until trial time k1+k2.

k2

length of the follow-up period.

tau

restriction time for the RMST.

n

total sample size for both groups. 1:1 randomization is assumed. Either n or power can be specified, and the other value will be calculated.

power

the desired power.

plot

if T, plots of the assumed survival distributions and power as a function of sample size, accrual time ka1and follow-up time k2 will be produced. Default is F. The power of the RMST test, the log-rank test using all available followup and the log-rank test using only followup to time tau after randomization will be displayed. If two-sided=T, the power of the test for superiorty (treatment over control) and inferiority (control over treatment), are represented with solid and dashed lines, respectively.

sim

if T, simulations will be conducted and empirical power and other summary statistics will be provided. Default is F. The hypothesis tests are carried out based on the normal approximation with the variance estimated according to the Greenwood plug-in/infinitesimal jackknife method. Specifying situations where survival doesn't go to zero in a reasonable amount of time (trial length times 1000) will lead to problems if the sim=T option is used.

M

number of simualations. Default is 1000.

method

modification to be used in simulations if the Kaplan-Meier estimate is not defined at time tau in either group. Default is 'tau_star', which changes the restriction time to the last censoring time, if the last observation is censored at a time earlier than tau. Other possible values are 'gill', 'efron', 'tau_star', 'risk1', 'risk2', and 'risk5'. The riskX' options indicate estimating RMST difference at the latest time at which at least X people are at risk in each group, irrespective of the value of tau.

alpha

type I error level. Default is 0.025 if 'two.sided'=F and 0.05 if 'two.sided'=T.

two.sided

whether a two-sided test is desired. Default is F, meaning that all reported power values correspond to a test of the superiority of treatment over control. If set to T, the power for a test of superiority (treatment over control) and inferiority (control over treatment) will be reported separately in the results; the power of a two-sided test is the sum of two.

Value

a list with components

n

the user-specified n, or if n was left blank, the n needed to achieve the user-specified power.

powerRMST

the user-specified power, or if power was left blank, the asymptotic power of the RMST test. If one-sided=T, powerRMST is equivalent to powerRMSToverC. If one-sided=F, powerRMST is equivalent to the sum of the power of a one-sided test in each direction, i.e. powerRMSToverC + powerRMSCoverT.

powerRMSToverC

the asymptotic power for a test of superiority of treatment over control.

powerRMSCoverT

the asymptotic power for a test of superiority of control over treatment. If a one-sided test is specified, this is set to NA.

powerLRToverC

the asymptotic power of the log-rank test of superiority of treatment over control.

powerLRCoverT

the asymptotic power of the log-rank test of superiority of control over treatment. If a one-sided test is specified, this is set to NA.

powerLRtauToverC

the asymptotic power of the log-rank test of superiority of treatment over control, using only data up to time tau after randomization.

powerLRtauCoverT

the asymptotic power of the log-rank test of superiority of control over treatment, using only data up to time tau after randomization. If a one-sided test is specified, this is set to NA.

pKME

the probability that you will be able to estimate RMST difference at time tau using the standard Kaplan-Meier estimator. If the last observation in either group is censored, and the censoring time is less than tau, the Kaplan-Meier estimate is not defined through time tau, and the RMST difference cannot be estimated using the standard area under the Kaplan-Meier curve. A modified estimator must be used.

simout

a list returned if sim = T, with components:

emppowRMSTToverC empirical power of the RMST test for the superiority of treatment over control. emppowRMSTCoverT empirical power of the RMST test for the superiority of control over treatment. If a one-sided test is specified, this is set to NA. emppowLRToverC empirical power of the log-rank test for the superiority of treatment over control. emppowLRCoverT empirical power of the log-rank testthe superiority of control over treatment. If a one-sided test is specified, this is set to NA. emppowLRtauToverC empirical power of the log-rank test for the superiority of treatment over control, using only data up to time tau after randomization. emppowLRtauCoverT empirical power of the log-rank testthe superiority of control over treatment, using only data up to time tau after randomization. If a one-sided test is specified, this is set to NA. emppKME proportion of simulations where the standard KM estimator was used. meandiff mean estimated difference in RMST across the simulated datasets. SDdiff standard deviation of the estimated difference in RMST across the simulated datasets. meantrunc mean truncation time used in the simulated datasets (may be smaller than tau if method = 'tau_star' or 'riskX' options are used). SDtrunc standard deviation of the truncation time used in the simulated datasets.

Examples

con<-survdef(times = 3, surv = 0.5) trt<-survdef(haz = 0.67*con$h(1)) RMSTpow(con, trt, k1 = 0, k2 = 3, tau = 3, power = 0.8)
#> $n #> [1] 552 #> #> $powerRMST #> [1] 0.8008182 #> #> $powerRMSTToverC #> [1] 0.8008182 #> #> $powerRMSTCoverT #> [1] NA #> #> $powerLRToverC #> [1] 0.8708721 #> #> $powerLRCoverT #> [1] NA #> #> $powerLRtauToverC #> [1] 0.8708721 #> #> $powerLRtauCoverT #> [1] NA #> #> $pKME #> [1] 1 #>
RMSTpow(con, trt, k1 = 0, k2 = 3, tau = 3, n = 552)
#> $n #> [1] 552 #> #> $powerRMST #> [1] 0.8008182 #> #> $powerRMSTToverC #> [1] 0.8008182 #> #> $powerRMSTCoverT #> [1] NA #> #> $powerLRToverC #> [1] 0.8708721 #> #> $powerLRCoverT #> [1] NA #> #> $powerLRtauToverC #> [1] 0.8708721 #> #> $powerLRtauCoverT #> [1] NA #> #> $pKME #> [1] 1 #>