parseCoxph | R Documentation |
Creates a set of survival data and fits a coxph
model
using a survival formula and a data set.
parseCoxph(surv.formula, data, center = TRUE)
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 |
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
.
data = simData()$data
parseCoxph(Surv(survtime, status) ~ bin, data = data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.