estCumHaz: Cumulative Hazard Function

View source: R/DiscSurvEstimation.R

estCumHazR Documentation

Cumulative Hazard Function

Description

Estimates the cumulative hazard function \Gamma(T = t|x) based on estimated hazard rates. 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

estCumHaz(hazards)

## S3 method for class 'discSurvEstCumHaz'
plot(x, ...)

Arguments

hazards

Estimated hazard rates (class "numeric")

x

Estimated cumulative hazard function \Lambda(t|x) (class "discSurvEstCumHaz").

...

Further arguments passed to plot.

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 probabilities of survival (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

See Also

estCumHaz

Examples


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

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

# Convert to long format
UnempLong <- dataLong(dataShort = subUnempDur, timeColumn = "spell", eventColumn = "censor1")

# Estimate binomial model with logit link
Fit <- glm(formula = y ~ timeInt + age + logwage, data=UnempLong, family = binomial())

# Estimate discrete survival function given age, logwage of first person
hazard <- predict(Fit, newdata = subset(UnempLong, obj == 1), type = "response")
cumHazCondX <- estCumHaz(c(hazard, 1))
cumHazCondX

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

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

# Convert to long format
UnempLong <- dataLong(dataShort = subUnempDur, timeColumn = "spell", eventColumn = "censor1")
head(UnempLong)

# Estimate binomial model with logit link
Fit <- glm(formula = y ~ timeInt + age + logwage, data = UnempLong, family = binomial())

# Estimate discrete survival function given age, logwage of first person
Tmax   <- max(subUnempDur$spell)
UnempEval <- dataLong(dataShort = UnempDur[1,], timeColumn = "spell", eventColumn = "censor1", 
aggTimeFormat = TRUE, lastTheoInt = Tmax)
hazard <- predict(Fit, newdata = UnempEval, type = "response")
estCumHaz1 <- estCumHaz(hazard)
plot(estCumHaz1)



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