Learn R Programming

coxsei (version 0.3)

CumInt: Cumulative intensity function

Description

Calculate the cumulative/integrated hazard/intensity function

Usage

CumInt(x, int, ...)

Arguments

x

the value at which to calculate the cumulative function value

int

the intensity/hazard rate function. Has to be vectorized.

the arguments to be passed in to control the behavior of the underlying integrate function.

Value

The value(s) of the cumulative hazard function at the specified x value(s).

Warning

The validity of the user supplied intensity function is not checked.

Details

Relies on the numerical integration routine of R.

Examples

Run this code
# NOT RUN {
curve(CumInt(x,int=function(y)1*( y>=0 & y<2)+3*(y>=2 & y<3)+1*(y>=3)),
      0,5,xlab="t",ylab="H(t) of a piece-wise constant hazard fun h(t)")   
# }

Run the code above in your browser using DataLab