require(OpenMx)
data(demoOneFactor)
manifests <- names(demoOneFactor)
latents <- c("G")
factorModel <- 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))
fitted.model <- mxRun(factorModel)
onyx(fitted.model)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.