Define the strata in a dataset to match those of a stratified Cox model
coxStrata(object, data, sterms, strata.vars, strata.levels)# S3 method for cph
coxStrata(object, data, sterms, strata.vars, strata.levels)
# S3 method for coxph
coxStrata(object, data, sterms, strata.vars, strata.levels)
# S3 method for phreg
coxStrata(object, data, sterms, strata.vars, strata.levels)
The fitted Cox regression model object either
obtained with coxph
(survival package), cph
(rms package), or phreg
(mets package).
a data.frame
or a data.table
terms in the formula corresponding to the strata variables
the name of the variables used to define the strata
a named list containing for each variable used to form the strata all its possible levels
the strata levels that have been used to fit the Cox model
Brice Ozenne broz@sund.ku.dk
if no strata variables returns a vector of "1"
(factor).