plot.simjm: Plot method for simjm simulated data frames

Description Usage Arguments Value

View source: R/plot.simjm.R

Description

Plot the underlying longitudinal trajectory and hazard function for the data generating model underpinning a simjm call. The plots are deterministic functions that use the true parameter values from the data generating model. These true parameter values are stored as an attribute in the object returned by a call to simjm (which is a list of data frames with class c("simjm", "list")).

Usage

1
2
3
## S3 method for class 'simjm'
plot(x, type = c("all", "trajectory", "basehaz", "hazard"),
  m = 1)

Arguments

x

An object of class "simjm", which is a list of data frames returned by a call to simjm.

type

The type of plot to produce. Type "trajectory" produces a plot of the mean trajectory for each longitudinal outcome, or if m is specified then the mean trajectory for the mth longitudinal outcome. Type "basehaz" produces a plot of the hazard function evaluated at the mean value of the baseline covariates and a zero contribution from the association structure. Type "hazard" produces a plot of the hazard function evaluated at the mean value of the baseline covariates and at the current mean value (i.e. the value at time t) for each of the longitudinal outcome(s). The default "all" produces a plot matrix with all of the above plot types.

m

A positive integer. If NULL then plots are shown for all the longitudinal outcomes (only relevant if the data was simulated for a multivariate joint model). Otherwise, one can specify a specific longitudinal outcome to produce the plots for. Note that is ignored if type = "basehaz" or type = "hazard".

Value

A ggplot object, which can be further customised using the ggplot2 package.


sambrilleman/simjm documentation built on July 9, 2018, 2:26 a.m.