Learn R Programming

EstSimPDMP (version 1.2)

plotCHR: Plot the Nelson-Aalen estimator

Description

Function for computing and plotting the Nelson-Aalen estimator of the cumulative hazard rate between two times.

Usage

plotCHR(dat,tmin,tmax,N)

Arguments

dat
data from which the estimator is to be computed.
tmin
the estimator is computed from time tmin to time tmax.
tmax
the estimator is computed from time tmin to time tmax. In addition, tmax is greater than tmin.
N
size of the grid plot.

References

Andersen P.K., Borgan O., Gill R.D., Keiding N. Statistical models based on counting processes Springer Series in Statistics. Springer-Verlag, New-York (1993)

See Also

CHR

Examples

Run this code
# plotCHR

# Simulation of 50 independent exponential random variables
dat<-rexp(50,1)

# Nelson-Aalen estimator of cumulative hazard rate between 0 and 2
plotCHR(dat,0,2,20)

# Theoretical cumulative hazard rate
points(0:2,0:2,col="blue",type="l")

Run the code above in your browser using DataLab