parseCoxph {gmvjoint} | R Documentation |
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)
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 |
Value
A list with class parseCoxph
containing:
survdata
reduced version of
data
, with only one row per subject, with covariates specified bysurv.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 insurv.formula
.status
the name of the
event
variable insurv.formula
.
Examples
data = simData()$data
parseCoxph(Surv(survtime, status) ~ bin, data = data)