predict.fitcox: Generate predictions for a fitted Cox model

Description Usage Arguments Details Value Examples

View source: R/fitcox.R

Description

Generate predictions for a fitted Cox model

Usage

1
2
## S3 method for class 'fitcox'
predict(model, newdata, type = "median")

Arguments

model

A fitcox object returned by the fitcox function.

newdata

A dataframe of values to generate predictions for.

type

The type of prediction to make: "median" | "expected" | "survival"

Details

The types of prediction are:

median

The median survival times given the predictors

expected

The expected number of events at the event time

survival

The estimated survival probability at the event time

Value

A vector of predictions for the new data

Examples

1
predict(fitcox(remission ~ sample, delta="censor", data=leukemia), newdata=leukemia)

mathmonster/sta545package documentation built on Jan. 1, 2021, 9:20 a.m.