Learn R Programming

ctsem (version 1.1.1)

plot.ctsemFit: Plotting function for object class ctsemFit

Description

Ouputs mean trajectories, autoregression, and crossregression plots.

Usage

## S3 method for class 'ctsemFit':
plot(x, resolution = 50, wait = TRUE,
  max.time = "auto", mean = TRUE, withinVariance = TRUE, AR = TRUE,
  CR = TRUE, standardiseCR = TRUE, xlab = "Time", meansylim = "auto",
  ylab = "Value", ...)

Arguments

x
ctsemFit object as generated by ctFit.
resolution
Plot points between each unit of time.
wait
If true, user is prompted to continue before plotting next graph. If false, graphs are plotted one after another without waiting.
max.time
Time scale on which to plot parameters. If auto, parameters are plotted for full range of observed variables.
mean
if TRUE, plot of means from 0 to max.time included in output.
withinVariance
if TRUE, plot within subject variance / covariance.
AR
if TRUE, plot of autoregressive values from 0 to max.time included in output.
CR
if TRUE, plot of cross regressive values from 0 to max.time included in output.
standardiseCR
if TRUE (default), cross regression values are standardised based on estimated within subject variance.
xlab
X axis label.
meansylim
Vector of min and max limits for mean trajectory plot. 'auto' calculates automatically.
ylab
Y axis label.
...
Other options passed to plot().

Value

  • Nothing. Side-effect: plots graphs.

Examples

Run this code
### example from Driver, Oud, Voelkle (2015),
### simulated happiness and leisure time with unobserved heterogeneity.
data(ctExample1)
traitmodel <- ctModel(n.manifest=2, n.latent=2, Tpoints=6, LAMBDA=diag(2),
  manifestNames=c('LeisureTime', 'Happiness'),
  latentNames=c('LeisureTime', 'Happiness'), TRAITVAR="auto")
traitfit <- ctFit(datawide=ctExample1, ctmodelobj=traitmodel)
plot(traitfit)

Run the code above in your browser using DataLab