| plot.aj_estimate | R Documentation |
Visualizes calendar-time state occupation, product-integral point estimates, Nelson–Aalen cumulative cause-specific hazards, or hazard increments from the Aalen–Johansen estimator.
## S3 method for class 'aj_estimate'
plot(
x,
type = c("state_occupation", "stacked_transition_prob", "cumulative_hazard",
"hazard_increment", "transition_intensity"),
states = NULL,
ci = FALSE,
col = NULL,
main = NULL,
xlab = "Time",
ylab = NULL,
...
)
x |
An |
type |
Character, one of |
states |
Character vector of states to plot (default: all). For cumulative-hazard and hazard-increment plots, transitions are filtered by destination state. |
ci |
One nonmissing logical value. This is a deprecated compatibility
argument: |
col |
One or more colors for selected states/transitions. Values are
recycled when necessary; |
main |
Title (default: auto-generated). |
xlab, ylab |
Axis labels. |
... |
Additional arguments passed to |
The input x object, returned invisibly. Called for its
side effect of producing a plot.
AJ plots are covariate-free calendar-time point estimates from the common
baseline. Confidence bands are unavailable. Hazard increments are discrete
Nelson–Aalen increments, not smoothed transition intensities. The legacy
"transition_intensity" type is deprecated and draws the same
hazard-increment plot with a warning. The historical
"stacked_transition_prob" label displays the selected state-occupation
components from the recorded initial state.
ms <- define_multistate(c("A", "B"), "B", list(A = "B"))
dat <- data.frame(id = 1:6, x = 1:6, time_B = 1:6,
censor = NA_real_)
long <- prepare_data(dat, "id", ms, list(B = "time_B"), "censor", "x")
aj <- aalen_johansen(long)
plot(aj, states = "B", xlab = "Study day", ylab = "Probability")
plot(aj, type = "hazard_increment", states = "B")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.