View source: R/DiscSurvEstimationCR.R
| estCumHazCompRisks | R Documentation |
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.
estCumHazCompRisks(hazards)
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. |
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).
Estimated cumulative all cause hazard (class "numeric")
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.
Thomas Welchowski t.welchowski@psychologie.uzh.ch
tutzModelDiscdiscSurv
# 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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.