Description Usage Arguments Value Author(s) See Also Examples
The analysis of survival data most often requires the production of Kaplan-Meier plots, estimated median survival time, and univariate estimates of hazard ratios (with associated confidence intervals and p-values). Often, this is performed separately for several possible risk factors. This function simplifies these tasks by providing a unified interface to simultaneously produce graphics, estimate median survival time, and compute hazard ratios with associated statistics from the Cox proportional hazards model.
1 2 3 4 5 6 7 8 9 10 | survrep(ftime, fstatus, fgroup = NA,
stmt.pl = c("bottomleft", "bottomright", "topright", "subtitle", "none")[1],
legend.pl = c("bottomleft", "bottomright", "topright", "none")[3],
output = c("plain", "text")[2],
maintitle = "",
ylbl = "Survival",
xlbl = "Time",
lbls = levels(fgroup),
dig = 2,
conf.level = 0.95)
|
ftime |
Event times, censored or observed. |
fstatus |
Censoring indicator, 1 for event, 0 for censored. |
fgroup |
Kaplan-Meier plots, median survival and hazard rates
will be computed by |
stmt.pl |
Placement of the statement giving hazard ratios,
confidence intervals and p-values in the plot. Ignored if
|
legend.pl |
Placement of the legend in the plot. Ignored if
|
output |
Type of output, “plain” gives plaintext output for
median survival and hazard ratios suitable for the creation of
tables etc., while “text” gives output suitable for the text of
reports. “text”-type output is always printed in the plots unless
|
maintitle |
Main title of the plot. Corresponds to the
|
ylbl |
Label for the y-axis of the plot. Corresponds to the
|
xlbl |
Label for the x-axis of the plot. Corresponds to the
|
lbls |
Labels used to produce the legend, as well as the contrasts printed in the hazard ratio statements. |
dig |
Number of significant digits used in rounding for “text”-type output. |
conf.level |
Significance level for confidence interval for the median survival and hazard ratio estimates. |
The Kaplan-Meier plot is printed, as well as a list containing:
med |
Matrix of median survival, and corresponding confidence
intervals. If |
events |
Matrix of hazard ratios, corresponding confidence
intervals, and p-values from the Wald test. If |
Sarah R. Haile
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## use Acute Myelogenous Leukemia survival data contained in package 'survival'
time <- leukemia[, 1]; status <- leukemia[, 2]; x <- leukemia[, 3]
survrep(time, status, NA)
survrep(time, status, x)
survrep(time, status, x, stmt.pl = "bottomright", out = "plain", main = "Acute Myeloid Leukemia")
survrep(time, status, x, stmt.pl = "bottomright", out = "text", main = "AML")
survrep(time, status, x, stmt.pl = "subtitle", out = "text", main = "Acute Myeloid Leukemia")
## using Larynx data contained in package 'survival'
## to show behavior with risk factors with >2 levels
data(larynx)
larynx$stage <- factor(larynx$stage, 1:4, c("I", "II", "III", "IV"))
with(larynx, survrep(time, death, stage, out = "t",
stmt.pl = "bottomright", main = "Larynx"))
with(larynx, survrep(time, death, stage, out = "t",
stmt.pl = "subtitle", main = ""))
with(larynx, survrep(time, death, stage, out = "p",
stmt.pl = "topright", legend.pl = "bottomright"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.