strata {survival} | R Documentation |
This is a special function used in the context of the Cox survival model. It identifies stratification variables when they appear on the right hand side of a formula.
strata(..., na.group=FALSE, shortlabel, sep=', ')
... |
any number of variables. All must be the same length. |
na.group |
a logical variable, if |
shortlabel |
if |
sep |
the character used to separate groups, in the created label |
The result is identical to the interaction
function,
but for the labeling of the factors (strata
is more verbose).
a new factor, whose levels are all possible combinations of the factors supplied as arguments.
a <- factor(rep(1:3,4), labels=c("low", "medium", "high")) b <- factor(rep(1:4,3)) levels(strata(b)) levels(strata(a,b,shortlabel=TRUE)) coxph(Surv(futime, fustat) ~ age + strata(rx), data=ovarian)