estMeasures: Fit Discrete Survival Measures Based On Hazards

View source: R/DiscSurvEstimation.R

estMeasuresR Documentation

Fit Discrete Survival Measures Based On Hazards

Description

Wrapper to estimate survival functions, cumulative hazards and marginal probabilities of all individuals of a given data set.

Usage

estMeasures(hazards, obj)

Arguments

hazards

Estimated hazards of the event (class "numeric").

obj

Integer identification number of each individual. Usually this information is computed during data augmentation (class "numeric").

Value

List of estimated measures (class "list"). There are three list elements with following contents:

  • surv List of estimated survival curves for each individual.

  • cumHaz List of estimated cumulative hazards for each individual.

  • margProb List of estimated marginal probabilities for each individual.

Note

It is assumed that the data set was preprocessed with functions such as dataLong or dataLongTimeDep.

Author(s)

Thomas Welchowski t.welchowski@psychologie.uzh.ch

References

\insertRef

tutzModelDiscdiscSurv

See Also

estSurv, estCumHaz, estMargProb

Examples


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

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

#########################
# Estimate hazard rates

estRegModel <- estReg(dataShort = subUnempDur, dataTransform = "dataLong", 
formulaVariable =~ timeInt + age + ui + logwage * ui, 
eventColumn = "censor1", timeColumn = "spell")
estHaz <- predict(estRegModel, type="response")

######################
# Single event example

# Estimate all survival functions of a given data set
measures1 <- estMeasures(hazards=estHaz, 
obj=attr(estRegModel, "augData")$obj)

# Survival function of first individual
measures1$surv[[1]] 

# Cumulative hazard of first individual
measures1$cumHaz[[1]]

# Marginal probabilities of first individual
measures1$margProb[[1]]


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