n2pwr.NPH {nphPower} | R Documentation |
Power Calculation with Combination Test
Description
n2pwr.NPH
calculates the power given either the
number of events or number of subjects using combination test
Usage
n2pwr.NPH(
method = "MaxLR",
entry = 1,
fup = 1,
maxfup = entry + fup,
CtrlHaz,
hazR,
transP1,
transP0,
Wlist,
entry_pdf0 = function(x) {
(1/entry) * (x >= 0 & x <= entry)
},
entry_pdf1 = entry_pdf0,
eventN = NULL,
totalN = NULL,
ratio = 1,
alpha = 0.05,
alternative = c("two.sided"),
k = 100,
nreps = 10
)
Arguments
method |
a text specifying the calculation method, either
|
entry |
a numeric value indicating the enrollment time, Default: 1 |
fup |
a numeric value indicating the minimum follow-up time for subjects. , Default: 1 |
maxfup |
maximum follow-up time |
CtrlHaz |
a function, specifying the hazard function for control group. |
hazR |
a function, specifying the hazard ratio function between treatment and control group |
transP1 |
a numeric vector of length 2, consisting of the transition probability from receiving treatment to drop-out (drop-out rate) and from receiving treatment to receiving control (drop-in rate) per time unit. |
transP0 |
a numeric vector of length 2, consisting of the transition probability from receiving control to drop-out (drop-out rate) and from receiving control to receiving treatment (drop-in rate) per time unit. |
Wlist |
a list, consisting of weight functions applied to the test. The element of the list must be functions. Default is a list of one constant function, corresponding to the logrank test. |
entry_pdf0 |
a function, indicating the probability density function (pdf) of enrollment/entry time for control group. The default assumes a uniform distribution corresponding to the constant enrollment rate. |
entry_pdf1 |
a pdf function of enrollment/entry time for treatment |
eventN |
the number of events |
totalN |
the number of subjects |
ratio |
allocation ratio, Default: 1 |
alpha |
type i error, Default: 0.05 |
alternative |
alternative hypothesis - one of c( |
k |
an integer, indicating number of sub-intervals per time unit, Default: 100 |
nreps |
number of replicates used for calculating quantitle using multivariate normal |
Details
Function npwr.NPH
calculates the asymptotic power given number
of events or number of subjects using maximum weighted logrank test or
projection type test. If only eventN
is provided, the
asymptotic power is based on provided number of events. If
only totalN
is given, the pooled event probability (eprob
) is calculated
according input design parameters including entry time, follow-up time
and hazard functions, etc. The number of events is calculated as
totalN
*eprob
, which is given in returned vector outN
.
Similarly, if only eventN
is given, the total sample
size is given as eventN
/eprob
. However, if both
eventN
and totalN
are provided, we only use
eventN
for calculation.
Check function pwr2n.NPH
for more calculation details.
Value
a list of components:
power |
asymptotic power |
inN |
a vector consisting of the input of |
outN |
a vector including the output of number of events and total sample. See details. |
prob_event |
event probability at the end of trial |
L_trans |
a list, consisting of transition matrix at each interval |
pdat |
a data frame including all the intermediate variables in the calculation. |
studytime |
a vector of length 2, including the entry and follow-up time as input |
RandomizationRatio |
as input |
See Also
Examples
# entry time
t_enrl <- 12
# follow-up time
t_fup <- 18
# baseline hazard
lmd0 <- -log(0.2)/10
# delayed treatment effects
f_hr_delay <- function(x){(x<=6)+(x>6)*0.75}
# maxcombo test
maxc <- gen.wgt(method="Maxcombo")
pwr1 <- n2pwr.NPH(entry = t_enrl
,fup = t_fup
,CtrlHaz = function(x){x^0*lmd0}
,hazR = f_hr_delay
,transP1 = c(0,0)
,transP0 = c(0,0)
,Wlist = maxc
,eventN = 50 # targeted number of events
)