ciplot | R Documentation |
cuminc2
plotting methodPlot a cuminc2
object with optional cumulative events or
estimate table, Gray's test results, and other features.
ciplot(
x,
col.ci = seq_along(xx),
lty.ci = par("lty"),
lwd.ci = par("lwd"),
conf.int = FALSE,
alpha.conf = 0.05,
col.conf = NULL,
lty.conf = 2L,
lwd.conf = lwd.ci,
conf.band = FALSE,
alpha.band = 0.5,
events = TRUE,
atrisk = TRUE,
events.total = TRUE,
wh.events = c("events", "est", "est.sd", "est.ci", "atrisk", "percent", "percent.ci"),
events.lab = NULL,
events.pad = 0.5,
events.digits = ifelse(grepl("percent", wh.events), 0L, 3L),
events.lines = TRUE,
events.col = FALSE,
include_censored = FALSE,
main = NULL,
xlab = "Time",
ylab = "Probability",
groups.lab = names(xx),
xlim = NULL,
ylim = NULL,
cex.lab = par("cex.lab"),
cex.main = par("cex.main"),
cex.axis = par("cex.axis"),
cex.events = cex.axis,
gy_test = TRUE,
test_details = TRUE,
legend.args = list(),
split = FALSE,
xaxis.at = pretty(xlim),
yaxis.at = pretty(ylim),
xaxis.lab = xaxis.at,
yaxis.lab = yaxis.at,
events.at = xaxis.at,
groups.order = seq_along(xx),
extra.margin = 5L,
mar = NULL,
add = FALSE,
panel.first = NULL,
panel.last = NULL,
...
)
## S3 method for class 'cuminc2'
plot(
x,
col.ci = seq_along(xx),
lty.ci = par("lty"),
lwd.ci = par("lwd"),
conf.int = FALSE,
alpha.conf = 0.05,
col.conf = NULL,
lty.conf = 2L,
lwd.conf = lwd.ci,
conf.band = FALSE,
alpha.band = 0.5,
events = TRUE,
atrisk = TRUE,
events.total = TRUE,
wh.events = c("events", "est", "est.sd", "est.ci", "atrisk", "percent", "percent.ci"),
events.lab = NULL,
events.pad = 0.5,
events.digits = ifelse(grepl("percent", wh.events), 0L, 3L),
events.lines = TRUE,
events.col = FALSE,
include_censored = FALSE,
main = NULL,
xlab = "Time",
ylab = "Probability",
groups.lab = names(xx),
xlim = NULL,
ylim = NULL,
cex.lab = par("cex.lab"),
cex.main = par("cex.main"),
cex.axis = par("cex.axis"),
cex.events = cex.axis,
gy_test = TRUE,
test_details = TRUE,
legend.args = list(),
split = FALSE,
xaxis.at = pretty(xlim),
yaxis.at = pretty(ylim),
xaxis.lab = xaxis.at,
yaxis.lab = yaxis.at,
events.at = xaxis.at,
groups.order = seq_along(xx),
extra.margin = 5L,
mar = NULL,
add = FALSE,
panel.first = NULL,
panel.last = NULL,
...
)
x |
an object of class |
col.ci , lty.ci , lwd.ci |
line color, type, and width for each curve |
conf.int |
logical; if |
alpha.conf |
the confidence level for |
col.conf , lty.conf , lwd.conf |
line color, type, and width for each confidence interval line |
conf.band |
logical; if |
alpha.band |
alpha transparency (in |
events |
logical; if |
atrisk |
logical; if |
events.total |
logical or numeric; if |
wh.events |
a character string giving the type of |
events.lab |
heading for events table |
events.pad |
extra padding between plot and events table; alternatively, a vector of padding for each line in the events table, recycled as needed |
events.digits |
when estimates are shown in events table (see
|
events.lines |
logical; draw lines next to groups in events table |
events.col |
logical or a vector with colors for events table text;
if |
include_censored |
logical; if |
main |
title of plot |
xlab , ylab |
x- and y-axis labels |
groups.lab |
labels for each line in |
xlim , ylim |
x- and y-axis limits |
cex.lab , cex.main |
text size for axis and main titles |
cex.axis |
text size for axis labels and |
cex.events |
text size for events table |
gy_test |
logical; if |
test_details |
logical; if |
legend.args |
an optional named list of |
split |
optionally split plot by unique competing risks or group;
one of |
xaxis.at , yaxis.at |
positions for x- and y-axis labels and ticks |
xaxis.lab , yaxis.lab |
x- and y-axis tick labels |
events.at |
x-coordinates to show events table (default is
|
groups.order |
order of groups in events table |
extra.margin |
increase left margin when groups labels in events
table are long (note that this will be overridden by |
mar |
margins; see |
add |
logical; if |
panel.first |
an expression to be evaluated after the plot axes are set up but before any plotting takes place |
panel.last |
an expression to be evaluated after plotting but before returning from the function |
... |
additional parameters ( |
ciplot_by
; cuminc2
;
summary.cuminc2
; cuminc
tp <- within(transplant, {
futime <- futime + 1e-8
age50 <- factor(+(age > 50))
age_cat <- cut(age, c(0, 40, 60, Inf), c('<40', '40-60', '60+'))
})
## basic usage
ci1 <- cuminc2(Surv(futime, event(censored)) ~ 1, tp)
plot(ci1)
plot(ci1, groups.lab = paste('1', names(ci1$cuminc))) ## testing
plot(ci1, conf.int = TRUE, lty.conf = 3)
plot(ci1, conf.band = TRUE)
ci1 <- cuminc2(Surv(futime, event(censored)) ~ age_cat, tp)
plot(ci1)
plot(ci1, split = 'event')
plot(ci1, split = 'event', events = FALSE, test_details = FALSE,
legend.args = list(x = 'topright', cex = 1.5, text.col = 2,
title = "Gray\'s test p-value for"))
## also plots "cuminc" objects but without extra features
plot(ci1$cuminc)
ci1 <- cuminc2(Surv(futime, event(censored) == death) ~ age50, tp)
plot(ci1, lty.ci = c(1, 1, 2, 2, 3, 3), col.ci = 1:2)
ci2 <- cuminc2(Surv(futime, event(censored) == death) ~ 1, tp)
plot(ci2, wh.events = 'est', events.digits = 2, groups.order = c(2, 1, 3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.