Learn R Programming

riskRegression (version 1.4.3)

CoxSpecialStrata: Special character for strata in Cox model

Description

Return the special character used to indicate the strata variables of the Cox model

Usage

CoxSpecialStrata(object)

# S3 method for coxph CoxSpecialStrata(object)

# S3 method for cph CoxSpecialStrata(object)

# S3 method for phreg CoxSpecialStrata(object)

Arguments

object

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

Examples

Run this code
# NOT RUN {
d <- sampleData(1e2, outcome = "survival")
d$entry <- 0

##
library(survival)
mCoxS <- coxph(Surv(time, event) ~ strata(X1)+strata(X2), data = d)
CoxSpecialStrata(mCoxS)

##
library(rms)
mCoxS <- cph(Surv(time, event) ~ strat(X1)+strat(X2), data = d, y = TRUE)
CoxSpecialStrata(mCoxS)

##
library(mets)
mCoxS <- phreg(Surv(entry, time, event) ~ strat(X1)+strat(X2), data = d)
CoxSpecialStrata(mCoxS)
# }

Run the code above in your browser using DataLab