pwefv2 | R Documentation |
This will $int_0^t s^k lambda_1(s)S_2(s)ds$ where k=0,1,2 and rate1=lambda_1 and S_2 has hazard rate2
pwefv2(t=seq(0,5,by=0.5),rate1=c(0,5,0.8),
rate2=rate1,tchange=c(0,3),eps=1.0e-2)
t |
A vector of time points |
rate1 |
piecewise constant event rate |
rate2 |
piecewise constant event rate |
tchange |
a strictly increasing sequence of time points starting from zero at which event rate changes. The first element of tchange must be zero. The above rates and tchange must have the same length. |
eps |
tolerance |
Let h_1,h_2
correspond to rate1
,rate2
, and H_1,H_2
be the corresponding survival functions.
This function will calculate
\int_0^t s^k h_1(s)H_2(s)ds,\hspace{1cm} k=0,1,2.
f0 |
values when |
f1 |
values when |
f2 |
values when |
This will provide the number of events.
Xiaodong Luo
Luo et al. (2018) Design and monitoring of survival trials in complex scenarios, Statistics in Medicine <doi: https://doi.org/10.1002/sim.7975>.
rpwe
r1<-c(0.6,0.3)
r2<-c(0.6,0.6)
tchange<-c(0,1.75)
pwefun<-pwefv2(t=seq(0,5,by=0.5),rate1=r1,rate2=r2,
tchange=tchange,eps=1.0e-2)
pwefun
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.