plot_mstate {oncomsm} | R Documentation |
Swimmer plot of multi-state data
Description
plot_mstate()
plots data in 'multi-state-format' as swimmer plot.
Usage
plot_mstate(
data,
model,
now = max(tbl_mstate$t_max),
relative_to_sot = TRUE,
...
)
Arguments
data |
a data frame with multi-state data; variables are
|
model |
an object of class srpmodel containing prior information |
now |
the current time relative to the start of the trial |
relative_to_sot |
logical, should the timeline be relative to the start of trial or the start of treatment for each individual |
... |
further arguments passed to method implementations |
Value
a ggplot2::ggplot object
See Also
Examples
mdl <- create_srpmodel(A = define_srp_prior())
tbl_visits <- sample_predictive(mdl, n_per_group = 5L, nsim = 1, seed = 468L)
tbl_mstate <- visits_to_mstate(tbl_visits, mdl)
plot_mstate(tbl_mstate, mdl)