View source: R/ctPostPredict.R
ctPostPredict | R Documentation |
Samples data according to the ctsemFit object, computes quantiles over time based on model fit, plots these against original data.
ctPostPredict(
fit,
timestep = 0.1,
n.subjects = 100,
probs = c(0.025, 0.5, 0.975),
plot = TRUE,
ctPlotArrayArgs = list(grid = FALSE, legend = FALSE),
indPlotArgs = list(colourby = "subject", lwd = 2, new = FALSE, type = "p", opacity =
0.3),
mfrow = "auto"
)
fit |
object of class ctsemFit as returned from |
timestep |
positive value denoting the time interval to use for sampling. |
n.subjects |
Number of subjects worth of data to sample. |
probs |
Vector of values between 0 and 1 denoting quantiles to generate. For plotting, vector should be of length 3 and values should be rising. |
plot |
Whether to plot or return the generated data. |
ctPlotArrayArgs |
additional arguments to pass to |
indPlotArgs |
list of parameters to pass to ctIndplot, for plotting original data. Only used if plot=TRUE. |
mfrow |
2 dimensional integer vector defining number of rows and columns of plots,
as per the mfrow argument to |
Either nothing (if plot=TRUE) or an array containing generated data over quantiles.
data("AnomAuth")
AnomAuthmodel <- ctModel(LAMBDA = matrix(c(1, 0, 0, 1), nrow = 2, ncol = 2),
Tpoints = 5, n.latent = 2, n.manifest = 2, MANIFESTVAR=diag(0, 2), TRAITVAR = 'auto')
AnomAuthFit <- ctFit(AnomAuth, AnomAuthmodel)
ctPostPredict(AnomAuthFit,timestep=.5,n.subjects=100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.