Question about a dimnames error message

Posted on
Picture of user. dkaplan Joined: 08/04/2009

Greetings all,

I finally was able to get OpenMx going on my Mac. I am reading in some data and estimating a very small path model, just to get the hang of things. The syntax is

sciach <- read.table("~/Desktop/sciach.txt",header=TRUE)

require(OpenMx)

#data(sciach)

manifests <- names(sciach)

sciachsimple <- sciach[,c("irtsci", "grades", "probsolv")]

pathmodel <- mxModel("path model",type="RAM",
mxData(observed=sciachsimple,type="raw"),
manifestVars = manifests,

mxPath(from="probsolv", to="grades",arrows=1,free=TRUE),

mxPath(from="grades", to="irtsci",arrows=1,free=TRUE),

mxPath(from=c("probsolv", "grades", "irtsci"),
arrows=2,
free=TRUE,
values = c(1, 1, 1),
labels=c("varx", "residual1", "residual2")),

mxPath(from="one",
to=c("probsolv", "grades", "irtsci"),
arrows=1,
free=TRUE,
values=c(1, 1, 1),
labels=c("meanx","beta0grades", "beta0irtsci")))

pathmodelfit <- mxRun(pathmodel)
pathmodelfit@output

summary(mxRun(pathmodel))
----------
The error message I'm getting is

Error: The column name 'challeng' in the observed covariance matrix of the FIML objective function in model 'path model' cannot be found in the dimnames of the data.
> pathmodelfit@output
Error: object 'pathmodelfit' not found
>
> summary(mxRun(pathmodel))
Running path model
Error: The column name 'challeng' in the observed covariance matrix of the FIML objective function in model 'path model' cannot be found in the dimnames of the data.
Error in summary(mxRun(pathmodel)) :
error in evaluating the argument 'object' in selecting a method for function 'summary'
----------

The variable "challeng" is in the sciach dataset but I thought I correctly selected only the variables I wanted using the line sciachsimple <- sciach[,c("irtsci", "grades", "probsolv")] from above.

Thoughts?

Thanks in advance.

David

Replied on Wed, 03/10/2010 - 16:37
Picture of user. mspiegel Joined: Jul 31, 2009

I think you need to set manifests <- names(sciachsimple). Inferring from the error message, it looks like you're specifying some manifest variables that do not exist in the subset of the dataset that you are using.

Replied on Tue, 03/16/2010 - 16:27
No user picture. twalls Joined: Aug 26, 2009

In reply to by mspiegel

I am getting the same or similar error message:

Running FIML Multiple Regression of Z1, Z2, Z3, Z4 on x1, x2, x3, x4
Error: The column name 'Z1' in the observed covariance matrix of the FIML objective function in model 'FIML Multiple Regression of Z1, Z2, Z3, Z4 on x1, x2, x3, x4' cannot be found in the dimnames of the data.

Replied on Tue, 03/16/2010 - 16:56
Picture of user. mspiegel Joined: Jul 31, 2009

In reply to by twalls

Sorry, it looks like there is a typo in the error message. It should read:

The column name 'Z1' in the expected covariance matrix of the FIML objective function in model 'FIML Multiple Regression of Z1, Z2, Z3, Z4 on x1, x2, x3, x4' cannot be found in the dimnames of the data.

The dataset used in the model must have column names. The expected covariance matrix that you specify in your model must also have column names. These two quantities do not have to be of the same length, or appear in the same order. But the column names in the expected covariance matrix should be a subset of the column names in the dataset.