visualise_msm {icmstate} | R Documentation |
Visualise multi-state data
Description
Produce a plot with the y-axis representing subjects in the data and the x-axis representing the time at which states have been observed.
Usage
visualise_msm(gd, npmsm, tmat, neat = TRUE, cutoff)
Arguments
gd |
A
|
npmsm |
Output from |
tmat |
A transition matrix as created by |
neat |
Boolean indicating whether redundant observations should be removed in the plot. Default is TRUE |
cutoff |
cutoff value for numerically determining the support using
|
Value
A plot will be produced in the plotting window.
Examples
#Write a function for evaluation times: observe at 0 and uniform inter-observation times.
eval_times <- function(n_obs, stop_time){
cumsum( c( runif(1, 0, 0.5), runif( n_obs-1, 0, 2*(stop_time-4)/(n_obs-1) ) ) )
}
#Use built_in function to simulate illness-death data
#from Weibull distributions for each transition
sim_dat <- sim_id_weib(n = 50, n_obs = 6, stop_time = 15, eval_times = eval_times,
start_state = "stable", shape = c(0.5, 0.5, 2),
scale = c(5, 10, 10/gamma(1.5)))
#Visualise the data
visualise_msm(sim_dat)
[Package icmstate version 0.2.0 Index]