estimateNAH: Neslon-Aalen Estimator of the Cumulative Hazard Function

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Computes the Nelson-Aalen estimator of a cumulative hazard function.

Usage

1
estimateNAH(RT, CR)

Arguments

RT

A vector of times at which an event occurs (e.g., a vector of response times).

CR

A vector of status indicators, 1=normal, 0=censored. For response time data, this corresponds to 1=correct, 0=incorrect.

Details

The Nelson-Aalen estimator of the cumulative hazard function is a step function with jumps at each event time. The jump size is given by the number at risk up until immediately before the event. If Y(t) is the number at risk immediately before t, then the N-A estimator is given by:

H(t) = sum(s in {Event Times < t}) 1/Y(s)

Value

H

A function of class "stepfun" that returns the Nelson-Aalen estimator of the cumulative hazard function.

Var

A function of class "stepfun" that returns the estimated variance of the Nelson-Aalen estimator of the cumulative hazard function.

Author(s)

Joe Houpt <joseph.houpt@wright.edu>

References

Aalen, O. O., Borgan, O., & Gjessing, H. K. (2008). Survival and event history analysis: A process point of view. New York: Springer.

See Also

estimateNAK stepfun

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
x <- rexp(50, rate=.5)
censoring <- runif(50) < .90
H.NA <- estimateNAH(x, censoring)

# Plot the estimated cumulative hazard function
plot(H.NA$H, 
  main="Cumulative Hazard Function\n X ~ Exp(.5)    n=50", 
  xlab="X", ylab="H(x)")

# Plot 95% Confidence intervals
times <- seq(0,10, length.out=100)
lines(times, H.NA$H(times) + sqrt(H.NA$Var(times))*qnorm(1-.05/2), lty=2)
lines(times, H.NA$H(times) - sqrt(H.NA$Var(times))*qnorm(1-.05/2), lty=2)

# Plot the true cumulative hazard function
abline(0,.5, col='red')


Search within the sft package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.