Copyright © 2007-2024 The OpenMx Project
OpenMx models support inheriting data from a parent, but the mxRefModels function chokes on this.
require(OpenMx) data(demoOneFactor) latents = c("G") manifests = names(demoOneFactor) m1 <- mxModel("model1", type = "RAM", manifestVars = manifests, latentVars = latents, mxPath(from = latents, to = manifests), mxPath(from = manifests, arrows = 2), mxPath(from = latents, arrows = 2, free = F, values = 1.0) ) m2 <- mxModel("model2", type = "RAM", manifestVars = manifests, latentVars = latents, mxPath(from = latents, to = manifests), mxPath(from = manifests, arrows = 2), mxPath(from = latents, arrows = 2, free = F, values = 1.0) ) m3 = mxModel("bob", m1, m2, mxData(cov(demoOneFactor), type = "cov", numObs = 500), mxFitFunctionMultigroup(c("model1.fitfunction","model2.fitfunction")) ) m3r = mxRun(m3) ref <- mxRefModels(m3r, run=TRUE) #Error in generateReferenceModels(x$fitfunction, x) : # Model 'model1' does not contain any data