Mon, 01/24/2011 - 20:47

Hi,

Some scripts which I'm sure have run without problems a couple of months ago are now giving me the following error:

> equateAEModelFit <- mxRun(equateAEModel)

Running equateAE

Error in slot(model, name) :

no slot of name ".newobjects" for this object of class "MxModel"

Any ideas what's happening?

Thanks,

Paul

Can you run the following and tell me what is stored in the variable 'slots'?

slotN <- slotNames(equateAEModel)

If you see ".newobjects", ".newobjective", and ".newtree" in the output above, then try:

slotN <- setdiff(slotN, c('.newobjects', '.newobjective', '.newtree'))

And then try:

newModel <- mxModel()

for(i in 1:length(slotN)) {

slot(newModel, slotN[[i]]) <- slot(equateAEModel, slotN[[i]])

}

That seems to work. Thanks a lot.

> slotN <- slotNames(equateAEModelFit)

> slotN

[1] "name" "matrices" "algebras" "constraints" "intervals" "latentVars"

[7] "manifestVars" "data" "submodels" "objective" "independent" "options"

[13] "output" "runstate" ".newobjects" ".newobjective" ".newtree"

> slotN <- setdiff(slotN, c('.newobjects', '.newobjective', '.newtree'))

> slotN

[1] "name" "matrices" "algebras" "constraints" "intervals" "latentVars" "manifestVars"

[8] "data" "submodels" "objective" "independent" "options" "output" "runstate"

> newModel <- mxModel()

> for(i in 1:length(slotN)) {

+ slot(newModel, slotN[[i]]) <- slot(equateAEModelFit, slotN[[i]])

+ }

> tableFitStatistics(multiCholACEFit, newModel)

Name ep -2LL df AIC diffLL diffdf p

Model 1 : multiCholACE 250 24309 12892 -1475 - - -

Model 2 : equateAE 172 24344.68 12982 -1619.32 35.68 90 1

This solution should work: http://openmx.psyc.virginia.edu/thread/774

Thanks Michael,

But I don't follow this - sorry.

When I try to substitute using:

newModel <- mxModel()

oldSlotNames <- slotNames(equateAEModel)

for(i in 1:length(oldSlotNames)) {

slot(newModel, oldSlotNames[[i]]) <- slot(equateAEModel, oldSlotNames[[i]])

}

I get a similar error:

Error in slot(equateAEModel, oldSlotNames[[i]]) :

no slot of name ".newobjects" for this object of class "MxModel"

Can you explain what I need to?