You are here

crash: when manifests not in data?

I ran the code below and got a crash. replicated twice
I think it is because the dataset in the model doesn't match the manifests list (salthouse vs demoOneFactor), but shouldn't crash....

require(OpenMx)
salthouse <- read.table("http://www.subjectpool.com/data/2009/andrea/salthouse.txt", header=TRUE, sep="\t", as.is=c(TRUE))
manifests <- names(salthouse)
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=F, values=1.0),
mxData(cov(demoOneFactor), type="cov", numObs=500)
)
mxRun(factorModel)

Reporter: 
Created: 
Mon, 11/02/2009 - 21:13
Updated: 
Tue, 11/17/2009 - 00:05

Comments

Good catch. As of revision 955, there is error checking for RAM objective functions to make sure that the column names of the F matrix and the column names of the M matrix are identical, and that they match up with the dimnames of the observed covariance matrix. A new parameter 'dimnames' has been added to the mxRAMObjective () function. It accepts a character vector and populates the column names of the F and M matrices. This parameter is analogous to the 'dimnames' parameter in the mxFIMLObjective() and mxMLObjective() functions. See ?mxRAMObjective for more information about the 'dimnames' argument. The RAM matrix-style demos and model/passing/ scripts have been updated to use the 'dimnames' parameter.

Automatically closed -- issue fixed for 2 weeks with no activity.