estCumInz: Estimates Cumulative Incidence Function for Discrete Time...

View source: R/DiscSurvEstimation.R

estCumInzR Documentation

Estimates Cumulative Incidence Function for Discrete Time Competing Risks Models

Description

Estimates the cumulative incidence function of a discrete time competing risks model given covariates P(T <= t, event = k | x).

Usage

estCumInz(hazards, eventFocus)

Arguments

hazards

Estimated discrete hazard rates of all events ("numeric matrix"). Each column represents one event. The first column is assumed to contain the censoring case and the discrete hazards should only vary over time in each row.

eventFocus

Column that represent the discrete hazards of the primary event ("integer vector").

Details

The covariates set is required to be constant across rows.

Value

Returns cumulative incidence function of the primary event. If argument nonparCI is set to TRUE, then a list is returned: The first element includes the cumulative incidence function. The second list element contains the lower and the third list element the upper bound of the pointwise confidence intervals.

Author(s)

Thomas Welchowski welchow@imbie.meb.uni-bonn.de

References

\insertRef

minjungDiscCompdiscSurv

See Also

compRisksGEE, dataLongCompRisks, dataLongCompRisksTimeDep, geeglm,

Examples


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

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

# Estimate GEE models for all events
estGEE <- compRisksGEE(datShort = SubUnempDur, dataTransform = "dataLongCompRisks", 
corstr = "independence", formulaVariable =~ timeInt + age + ui + logwage * ui, 
eventColumns = c("censor1", "censor2", "censor3", "censor4"), timeColumn = "spell")

# Estimate hazards of all events given the covariates of third person
SubUnempDurLong <- dataLongCompRisks(dataShort = SubUnempDur, 
eventColumns = c("censor1", "censor2", "censor3", "censor4"), timeColumn = "spell") 
preds <- predict(estGEE, subset(SubUnempDurLong, obj == 3))

# Estimate cumulative incidence function
cumInzGEE <- estCumInz(preds, eventFocus = 2)
cumInzGEE


discSurv documentation built on March 18, 2022, 7:12 p.m.