coxStrata: Define the strata for a new dataset

Description Usage Arguments Details Author(s)

Description

Define the strata in a dataset to match those of a stratified Cox model

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
coxStrata(object, data, sterms, strata.vars, strata.levels)

## S3 method for class 'cph'
coxStrata(object, data, sterms, strata.vars, strata.levels)

## S3 method for class 'coxph'
coxStrata(object, data, sterms, strata.vars, strata.levels)

## S3 method for class 'phreg'
coxStrata(object, data, sterms, strata.vars, strata.levels)

Arguments

object

The fitted Cox regression model object either obtained with coxph (survival package), cph (rms package), or phreg (mets package).

data

a data.frame or a data.table

sterms

terms in the formula corresponding to the strata variables

strata.vars

the name of the variables used to define the strata

strata.levels

a named list containing for each variable used to form the strata all its possible levels

levels

the strata levels that have been used to fit the Cox model

Details

if no strata variables returns a vector of "1" (factor).

Author(s)

Brice Ozenne broz@sund.ku.dk


bozenne/riskRegressionLight documentation built on May 7, 2019, 12:52 a.m.