Learn R Programming

PWEALL (version 1.3.0.1)

pwefv2: A utility function

Description

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

Usage

pwefv2(t=seq(0,5,by=0.5),rate1=c(0,5,0.8),
      rate2=rate1,tchange=c(0,3),eps=1.0e-2)

Value

f0

values when \(k=0\)

f1

values when \(k=1\)

f2

values when \(k=2\)

Arguments

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

Author

Xiaodong Luo

Details

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.$$

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)
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

Run the code above in your browser using DataLab