plotSurv | R Documentation |
Generates a plot of an estimated survival function S(T>t|x) based on estimated discrete hazards.
plotSurv(hazards, ...)
hazards |
Estimated discrete hazards ("numeric vector") |
... |
Further arguments passed to |
Moritz Berger moritz.berger@imbie.uni-bonn.de
https://www.imbie.uni-bonn.de/personen/dr-moritz-berger/
tutzModelDiscdiscSurv
estSurv
# 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") plotSurv(hazard)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.