estCumInz {discSurv} | R Documentation |
Estimates the cumulative incidence function of a discrete time competing risks model given covariates P(T <= t, event = k | x).
estCumInz(hazards, eventFocus)
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"). |
The covariates set is required to be constant across rows.
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.
Thomas Welchowski welchow@imbie.meb.uni-bonn.de
Lee M, Feuer EJ, Fine JP (2018). “On the analysis of discrete time competing risks data.” Biometrics, 74, 1468-1481.
compRisksGEE
, dataLongCompRisks
,
dataLongCompRisksTimeDep
, geeglm
,
# 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