Learn R Programming

PWEALL (version 1.3.0.1)

pwecx: Various function for piecewise exponential distribution with crossover effect

Description

This will calculate the functions according to the piecewise exponential distribution with crossover

Usage

pwecx(t=seq(0,10,by=0.5),rate1=c(1,0.5),rate2=rate1,rate3=c(0.7,0.4),
      rate4=rate2,rate5=rate2,tchange=c(0,1),type=1,rp2=0.5,eps=1.0e-2)

Value

hazard

Hazard function

cumhazard

Cumulative hazard function

density

Density function

dist

Distribution function

surv

Survival function

Arguments

t

a vector of time points

rate1

piecewise constant event rate before crossover

rate2

piecewise constant event rate after crossover

rate3

piecewise constant event rate for crossover

rate4

additional piecewise constant event rate for more complex crossover

rate5

additional piecewise constant event rate for more complex crossover

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 rate1 to rate5 and tchange must have the same length.

type

type of crossover, i.e. 1: markov, 2: semi-markov, 3: hybrid case 1(as indicated in the reference), 4: hybrid case 2, 5: hybrid case 3.

rp2

re-randomization prob

eps

tolerance

Author

Xiaodong Luo

Details

More details

References

Luo et al. (2018) Design and monitoring of survival trials in complex scenarios, Statistics in Medicine <doi: https://doi.org/10.1002/sim.7975>.

See Also

rpwe

Examples

Run this code
r1<-c(0.6,0.3)
r2<-c(0.6,0.6)
r3<-c(0.1,0.2)
r4<-c(0.5,0.4)
r5<-c(0.4,0.5)
pwecxfun<-pwecx(t=seq(0,10,by=0.5),rate1=r1,rate2=r2,rate3=r3,rate4=r4,
                rate5=r5,tchange=c(0,1),type=1,eps=1.0e-2)
pwecxfun$surv

Run the code above in your browser using DataLab