Learn R Programming

ctsem (version 1.1.6)

plot.ctsemFit: Plotting function for object class ctsemFit

Description

Ouputs mean trajectories, autoregression, and crossregression plots. For more customization possibilities, see ctPlot.

Usage

"plot"(x, resolution = 50, wait = TRUE, max.time = "auto", mean = TRUE, withinVariance = TRUE, AR = TRUE, CR = TRUE, standardiseCR = TRUE, randomImpulse = FALSE, experimentalImpulse = FALSE, xlab = "Time", meansylim = "auto", ARylim = "auto", CRylim = "auto", ylab = "Value", ...)

Arguments

x
ctsemFit object as generated by ctFit.
resolution
Numeric. Plot points between each unit of time. Default of 'auto' adapts to max.time and results in 500 in total.
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.
randomImpulse
if TRUE (default), plots expected change in processes given a random fluctuation of +1 for each process -- plot is then a mixture of DIFFUSION and DRIFT characteristics.
experimentalImpulse
if TRUE (default), plots expected change in processes given an exogenous input of +1 for each process -- alternate characterisation of autoregressive and cross regressive plots.
xlab
X axis label.
meansylim
Vector of min and max limits for mean trajectory plot. 'auto' calculates automatically.
ARylim
Vector of min and max limits for autoregression plot. 'auto' is c(0,1), and expands if necessary.
CRylim
Vector of min and max limits for cross regression plot. 'auto' is c(-1,1), and expands if necessary.
ylab
Y axis label.
...
Other options passed to plot().

Value

Nothing. Side-effect: plots graphs.

Examples

Run this code
## Examples set to 'dontrun' because they take longer than 5s.

### example from Driver, Oud, Voelkle (2015), 
### simulated happiness and leisure time with unobserved heterogeneity.
## Not run: 
# 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, wait=FALSE)
# ## End(Not run)

Run the code above in your browser using DataLab