Description Usage Arguments Details Value See Also Examples
Create survival curves
1 2 | ## S3 method for class 'survTerms'
survfit(survTerms, ...)
|
survTerms |
|
... |
Arguments passed on to
|
A survival curve is based on a tabulation of the number at risk and
number of events at each unique death time. When time is a floating
point number the definition of "unique" is subject to interpretation.
The code uses factor() to define the set.
For further details see the documentation for the appropriate method, i.e.,
?survfit.formula
or ?survfit.coxph
.
A survfit object may contain a single curve, a set of curves, or a
matrix curves.
Predicted curves from a coxph
model have one row for each
stratum in the Cox model fit and one column for each specified
covariate set.
Curves from a multi-state model have one row for each stratum and
a column for each state, the strata correspond to predictors on the
right hand side of the equation. The default printing and plotting
order for curves is by column, as with other matrices.
Curves can be subscripted using either a single or double subscript. If the set of curves is a matrix, as in the above, and one of the dimensions is 1 then the code allows a single subscript to be used. (That is, it is not quite as general as using a single subscript for a numeric matrix.)
survfit
object. See survfit.object
for details. Methods
defined for survfit
objects are print
, plot
,
lines
, and points
.
Other functions to analyse survival:
assignValuePerSubject()
,
getAttributesTime()
,
labelBasedOnCutoff()
,
optimalSurvivalCutoff()
,
plotSurvivalCurves()
,
plotSurvivalPvaluesByCutoff()
,
processSurvTerms()
,
survdiffTerms()
,
testSurvival()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | library("survival")
clinical <- read.table(text = "2549 NA ii female
840 NA i female
NA 1204 iv male
NA 383 iv female
1293 NA iii male
NA 1355 ii male")
names(clinical) <- c("patient.days_to_last_followup",
"patient.days_to_death",
"patient.stage_event.pathologic_stage",
"patient.gender")
timeStart <- "days_to_death"
event <- "days_to_death"
formulaStr <- "patient.stage_event.pathologic_stage + patient.gender"
survTerms <- processSurvTerms(clinical, censoring="right", event, timeStart,
formulaStr=formulaStr)
survfit(survTerms)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.