ynegbinompowersim {NBDesign} | R Documentation |
Two-sample sample size calculation for negative binomial distribution with variable follow-up
Description
This will calculate the power for the negative binomial distribution for the 2-sample case under different follow-up scenarios: 1: fixed follow-up, 2: fixed follow-up with drop-out, 3: variable follow-up with a minimum fu and a maximum fu, 4: variable follow-up with a minimum fu and a maximum fu and drop-out.
Usage
ynegbinompowersim(nsize=200,r0=1.0,r1=0.5,shape0=1,shape1=shape0,pi1=0.5,
alpha=0.05,twosided=1,fixedfu=1,type=1,u=c(0.5,0.5,1),ut=c(0.5,1.0,1.5),
tfix=ut[length(ut)]+0.5,maxfu=10.0,tchange=c(0,0.5,1),
ratec1=c(0.15,0.15,0.15),ratec0=ratec1,rn=10000)
Arguments
nsize |
total number of subjects in two groups |
r0 |
event rate for the control |
r1 |
event rate for the treatment |
shape0 |
dispersion parameter for the control |
shape1 |
dispersion parameter for the treatment |
pi1 |
allocation prob for the treatment |
alpha |
type-1 error |
twosided |
1: two-side, others: one-sided |
fixedfu |
fixed follow-up time for each patient |
type |
follow-up time type, type=1: fixed fu with fu time |
u |
recruitment rate |
ut |
recruitment interval, must have the same length as |
tfix |
fixed study duration, often equals to recruitment time plus minimum follow-up |
maxfu |
maximum follow-up time, should not be greater than |
tchange |
a strictly increasing sequence of time points starting from zero at which the drop-out rate changes. The first element of tchange must be zero. The above rates and |
ratec1 |
piecewise constant drop-out rate for the treatment |
ratec0 |
piecewise constant drop-out rate for the control |
rn |
Number of repetitions |
Details
Let and
correspond to the minimum follow-up time
fixedfu
and the maximum follow-up time maxfu
. Let ,
,
and
be the follow-up time, the drop-out time, the study entry time and the total recruitment period(
is the last element of
ut
). For type 1 follow-up, . For type 2 follow-up
. For type 3 follow-up,
. For type 4 follow-up,
. Let
be the density of
.
Suppose that
is the number of event obsevred in follow-up time
for patient
with treatment assignment
,
. Suppose that
follows a negative binomial distribution such that
where are the dispersion parameters for control
and treatment
and
The data will be gnerated according to the above model. Note that the piecewise exponential distribution and the piecewise uniform distribution are genrated using R package PWEALL functions "rpwe" and "rpwu", respectively.
The parameters in the model are estimated by MLE using the R package MASS function "glm.nb".
Value
power |
simulation power (in percentage) |
Author(s)
Xiaodong Luo
Examples
##calculating the sample sizes
abc=ynegbinompowersim(nsize=200,r0=1.0,r1=0.5,shape0=1,
pi1=0.5,alpha=0.05,twosided=1,fixedfu=1,
type=4,u=c(0.5,0.5,1),ut=c(0.5,1.0,1.5),
tchange=c(0,0.5,1),
ratec1=c(0.15,0.15,0.15),rn=10)
###Power
abc$power