fourhr {PWEALL}R Documentation

A utility functon

Description

This will calculate the more complex integration

Usage

fourhr(t=seq(0,5,by=0.5),rate1=c(0,5,0.8),rate2=rate1,
                   rate3=c(0.1,0.2),rate4=rate2,tchange=c(0,3),eps=1.0e-2)

Arguments

t

A vector of time points

rate1

piecewise constant event rate

rate2

piecewise constant event rate

rate3

piecewise constant event rate

rate4

additional piecewise constant

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

Details

Let h_1,\ldots,h_4 correspond to rate1,...,rate4, and H_1,\ldots,H_4 be the corresponding survival functions. We calculate

\int_0^t h_1(s)H_2(s)h_3(t-s)H_4(t-s)ds.

Value

fx

values

Note

This provides the result of the complex integration

Author(s)

Xiaodong Luo

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

r1<-c(0.6,0.3)
r2<-c(0.6,0.6)
r3<-c(0.1,0.2)
r4<-c(0.5,0.4)
tchange<-c(0,1.75)
fourhrfun<-fourhr(t=seq(0,5,by=0.5),rate1=r1,rate2=r2,rate3=r3,
                 rate4=r4,tchange=c(0,3),eps=1.0e-2)
fourhrfun

[Package PWEALL version 1.3.0.1 Index]