Learn R Programming

ctsem (version 1.1.5.2)

ctCI: ctCI Computes confidence intervals on specified parameters / matrices for already fitted ctsem fit object.

Description

ctCI Computes confidence intervals on specified parameters / matrices for already fitted ctsem fit object.

Usage

ctCI(ctfitobj, confidenceintervals, optimizer = "NPSOL", verbose = 0)

Arguments

ctfitobj
Already fit ctsem fit object (class: ctsemFit) to estimate confidence intervals for.
confidenceintervals
character vector of matrices and or parameters for which to estimate 95% confidence intervals for.
optimizer
character vector. Defaults to NPSOL (recommended), but other optimizers available within OpenMx (e.g. 'SLSQP') may be specified.
verbose
Integer between 0 and 3 reflecting amount of output while calculating.

Value

  • ctfitobj, with confidence intervals included.

Details

Confidence intervals typically estimate more reliably using the proprietary NPSOL optimizer available within OpenMx only when installing directly from OpenMx website. Use command " source('http://openmx.psyc.virginia.edu/getOpenMx.R') " to install OpenMx with NPSOL. If estimating for a multigroup model, specify confidence intervals as normal, e.g. confidenceintervals = c('DRIFT', 'diffusion_Y1_Y1') . The necessary group prefixes are added internally.

Examples

Run this code
## Examples set to 'dontrun' because they take longer than 5s.
data("ctExample3")
model <- ctModel(n.latent = 1, n.manifest = 3, Tpoints = 100, 
 LAMBDA = matrix(c(1, "lambda2", "lambda3"), nrow = 3, ncol = 1), 
 MANIFESTMEANS = matrix(c(0, "manifestmean2", "manifestmean3"), nrow = 3, 
   ncol = 1))
fit <- ctFit(data = ctExample3, ctmodelobj = model, objective = "Kalman",
 stationary = c("T0VAR"))

fit <- ctCI(fit, confidenceintervals = 'DRIFT')

summary(fit)$omxsummary$CI

Run the code above in your browser using DataLab