Description Usage Arguments Details Value Author(s) Examples
View source: R/ynegbinompowersim.R
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.
| 1 2 3 4 | 
| 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 | 
Let τ_{min} and τ_{max} correspond to the minimum follow-up time fixedfu and the maximum follow-up time maxfu. Let T_f, C, E and R be the follow-up time, the drop-out time, the study entry time and the total recruitment period(R is the last element of ut). For type 1 follow-up, T_f=τ_{min}. For type 2 follow-up T_f=min(C,τ_{min}). For type 3 follow-up, T_f=min(R+τ_{min}-E,τ_{max}). For type 4 follow-up, T_f=min(R+τ_{min}-E,τ_{max},C). Let f be the density of T_f. 
Suppose that Y_i is the number of event obsevred in follow-up time t_i for patient i with treatment assignment Z_i, i=1,…,n. Suppose that Y_i follows a negative binomial distribution such that 
P(Y_i=y\mid Z_i=j)=\frac{Γ(y+1/k_j)}{Γ(y+1)Γ(1/k_j)}\Bigg(\frac{k_ju_i}{1+k_ju_i}\Bigg)^y\Bigg(\frac{1}{1+k_ju_i}\Bigg)^{1/k_j},
where k_j, j=0,1 are the dispersion parameters for control j=0 and treatment j=1 and
\log(u_i)=\log(t_i)+β_0+β_1 Z_i.
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".
| power | simulation power (in percentage) | 
Xiaodong Luo
| 1 2 3 4 5 6 7 8 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.