Parametric Survival Estimates
Computes predicted survival probabilities or hazards and optionally confidence
limits (for survival only) for parametric survival models fitted with
If getting predictions for more than one observation,
be specified. For a model without predictors, no input data are
## S3 method for class 'psm': survest(fit, newdata, linear.predictors, x, times, fun, loglog=FALSE, conf.int=0.95, what=c("survival","hazard","parallel"), ...)
## S3 method for class 'survest.psm': print(x, \dots)
- fit from
- newdata, linear.predictors, x, times, conf.int
survest.cph. One of
xmust be given.
linear.predictorsincludes the intercept. If
timesis omitted, predictions are made at 200 equally spaced po
- The default is to compute survival probabilities. Set
what="hazard"or some abbreviation of
"hazard"to compute hazard rates.
what="parallel"assumes that the length of
timesis the number of subjects (
- set to
TRUEto transform survival estimates and confidence limits using log-log
- a function to transform estimates and optional confidence intervals
Confidence intervals are based on asymptotic normality of the linear predictors. The intervals account for the fact that a scale parameter may have been estimated jointly with beta.
survest.cph. If the model has no predictors, predictions are made with respect to varying time only, and the returned object is of class
"survfit"so the survival curve can be plotted with survplot.survfit. If
timesis omitted, the entire survival curve or hazard from
t=0,...,fit$maxtimeis estimated, with increments computed to yield 200 points where
fit$maxtimeis the maximum survival time in the data used in model fitting. Otherwise, the
timesvector controls the time points used.
# Simulate data from a proportional hazards population model n <- 1000 set.seed(731) age <- 50 + 12*rnorm(n) label(age) <- "Age" cens <- 15*runif(n) h <- .02*exp(.04*(age-50)) dt <- -log(runif(n))/h label(dt) <- 'Follow-up Time' e <- ifelse(dt <= cens,1,0) dt <- pmin(dt, cens) units(dt) <- "Year" S <- Surv(dt,e) f <- psm(S ~ lsp(age,c(40,70))) survest(f, data.frame(age=seq(20,80,by=5)), times=2) #Get predicted survival curve for 40 year old survest(f, data.frame(age=40)) #Get hazard function for 40 year old survest(f, data.frame(age=40), what="hazard")$surv #still called surv