parseCoxph: Parsing the survival formula and constructing all survival-related data objects.
Description
Creates a set of survival data and fits a coxph model
using a survival formula and a data set.
Usage
parseCoxph(surv.formula, data, center = TRUE)
Value
A list with class parseCoxph containing:
survdata
reduced version of data, with only one row per subject, with
covariates specified by surv.formula along with survival time and failure status.
Smat
matrix containing all requisite survival covariates (one row per subject).
ph
the model fit from coxph.
Delta
list of failure indicators for each of the unique subjects.
n
number of unique subjects.
ft
vector of unique failure times.
nev
vector containing number of failures at each failure time ft.
survtime
the name of the time variable in surv.formula.
status
the name of the event variable in surv.formula.
Arguments
surv.formula
A formula readable by `coxph`.
data
a set of data containing covariate information for variables
named by `surv.formula`. Can be of any 'completeness', as the function
returns a reduced set.
center
Should the covariate matrices be mean-centered before being returned?
defaults to center = TRUE.