Copyright © 2007-2024 The OpenMx Project
See this minimal working example.
library(OpenMx) data(demoOneFactor) # =============================== # = Make and run a 1-factor CFA = # =============================== latents = c("G") # the latent factor manifests = names(demoOneFactor) # manifest variables to be modeled # ==================== # = Make the MxModel = # ==================== m1 <- mxModel("One Factor", type = "RAM", manifestVars = manifests, latentVars = latents, mxPath(from = latents, to = manifests), mxPath(from = manifests, arrows = 2), mxPath(from = latents, arrows = 2, free = FALSE, values = 1.0), mxData(cov(demoOneFactor), type = "cov", numObs = 500), mxCI("bob") # reference to entity not in model! ) # =============================== # = mxRun it and get a summary! = # =============================== m1 = mxRun(m1) # Error in free[i, j] : subscript out of bounds # should be unknown reference detected
See also, https://openmx.ssri.psu.edu/thread/4109