estCumHazCompRisks: Cumulative Hazard Function For Competing Risks

View source: R/DiscSurvEstimationCR.R

estCumHazCompRisksR Documentation

Cumulative Hazard Function For Competing Risks

Description

Estimates the overall cumulative hazard function \Gamma(T = t|x) based on the overall hazard rate in competing risks. The hazard rates may or may not depend on covariates. The covariates have to be equal across all estimated hazard rates. Therefore the given hazard rates should only vary over time.

Usage

estCumHazCompRisks(hazards)

Arguments

hazards

Estimated discrete hazards (numeric class c("matrix", "array")). Discrete hazards of each time interval are stored in the rows and the number of columns equal to the number of events.

Details

The argument hazards must be given for all intervals \left[ a_0, a_1 \right), \left[ a_1, a_2 \right), ..., \left[ a_{q-1}, a_q \right), \left[ a_q, \infty \right).

Value

Estimated cumulative all cause hazard (class "numeric")

Note

It is assumed that all time points up to the last theoretical interval \left[ a_q, \infty \right) are available. If not already present, these can be added manually.

Author(s)

Thomas Welchowski t.welchowski@psychologie.uzh.ch

References

\insertRef

tutzModelDiscdiscSurv

Examples



# Example unemployment data
library(Ecdat)
data(UnempDur)

# Select subsample
subUnempDur <- UnempDur[1:100, ]

# Estimate binomial model with logit link
estModel <- estRegSmoothCompRisks(dataShort = subUnempDur, 
dataTransform = "dataLongCompRisks", 
formulaVariable =~ timeInt + age + ui + logwage * ui, 
eventColumns = c("censor1", "censor2", "censor3", "censor4"), timeColumn = "spell")

# Estimate discrete survival function given age, logwage of first person
predFrame <- attr(estModel, "augData")
hazard <- predict(estModel, newdata=predFrame[predFrame$obj==1, ], type = "response")
cumHazCondX <- estCumHazCompRisks(cbind(hazard, 1))
cumHazCondX


discSurv documentation built on April 29, 2026, 9:07 a.m.