View source: R/plot.ctsemFit.R
plot.ctsemFit | R Documentation |
Ouputs mean trajectories, autoregression, and crossregression plots.
For more customization possibilities, see ctPlot
.
## S3 method for class 'ctsemFit'
plot(
x,
resolution = 50,
wait = TRUE,
max.time = "auto",
mean = TRUE,
withinVariance = TRUE,
AR = TRUE,
CR = TRUE,
standardiseCR = FALSE,
randomImpulse = FALSE,
experimentalImpulse = FALSE,
xlab = "Time",
meansylim = "auto",
ARylim = "auto",
CRylim = "auto",
ylab = "Value",
...
)
x |
ctsemFit object as generated by |
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 , 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 |
Nothing. Side-effect: plots graphs.
## Examples set to 'donttest' because they take longer than 5s.
### 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(dat=ctExample1, ctmodelobj=traitmodel)
plot(traitfit, wait=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.