## Examples set to 'dontrun' because they take longer than 5s.
generatingModel <- ctModel(n.latent = 1, n.manifest = 1, Tpoints = 10,
LAMBDA = diag(1), DRIFT = matrix(-.3, nrow = 1),
MANIFESTVAR = diag(1),
CINT = matrix(3, 1, 1),
DIFFUSION = t(chol(diag(5, 1))))
dat <- ctGenerate(generatingModel, n.subjects=10, burnin=300)
### ctsem model and fit
ctsemModel <- ctModel(n.latent=1, n.manifest = 1, Tpoints = 10,
LAMBDA = diag(1))
ctsemFit <- ctFit(dat, ctsemModel, stationary = c('T0VAR'))
### fit with PSM
psmFit <- ctPSMfit(dat, omxStartValues =
omxGetParameters(ctsemFit$mxobj), ctsemModel)
Run the code above in your browser using DataLab