| gce_alligator | R Documentation |
Plots the cause-specific cumulative incidence functions (CIFs) of the event of interest and the competing event over time on a single panel, with risk groups distinguished by color and event types by line type (event of interest solid, competing event dashed). In higher-risk groups the event-of-interest CIF rises above the competing-event CIF and the curves separate like an alligator's open jaws.
The x-axis is truncated at xmax (by default the model's readout time t), with tick marks
at 1-unit (e.g. 1-year) intervals. The y-axis auto-scales its cap to the
smallest of 25/50/75/100% that covers the peak cumulative incidence (so
low-incidence settings are not compressed), with ticks at 10% (or 5% when
capped at 25%). Numbers at risk for each group are shown in an aligned panel
below the plot. Gray's test across groups is attached.
gce_alligator(
object,
groups = 2,
method = c("optimal", "quantile"),
criterion = c("omegaplus", "cif"),
xlab = "Time (years)",
ylab = "Cumulative incidence",
group.lab = "Risk group",
risk.table = TRUE,
ymax = NULL,
xmax = NULL
)
## S3 method for class 'gce_alligator'
print(x, ...)
## S3 method for class 'gce_alligator'
plot(x, ...)
object |
a |
groups |
a |
method |
grouping rule used when |
criterion |
optimal-search criterion when |
xlab, ylab |
axis labels. |
group.lab |
legend title for the risk groups (default "Risk group"). |
risk.table |
logical; show numbers at risk in an aligned panel below the
plot (default |
ymax |
optional numeric upper cap for the y-axis (0-1). If |
xmax |
upper limit of the time axis; defaults to the readout time
|
x |
a |
... |
unused. |
An object of class "gce_alligator" with print and
plot methods. It is a list holding the cumulative incidence curves
($data), the numbers at risk ($n.risk), Gray's tests
across groups ($grays_test), and the cutpoints. Printing shows
the group sizes and Gray's tests; plot draws the figure and
returns the ggplot/patchwork object invisibly. The display
arguments (xlab, ylab, group.lab,
risk.table, ymax) are stored and used by plot.
data(hn)
fit <- gcecox(Surv(time, status) ~ age + t_cat + p16, data = hn, t = 5)
al <- gce_alligator(fit, groups = 2)
al
plot(al)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.