Sat, 04/09/2011 - 00:31

Hi, everyone.

I was fitting a multivariate model with a general script. The commands didn't have errors. After I mxRun() and summary() my model, it quickly presented the summary. But the problem was that there were no -2ll, AIC, BIC, or any other fitting results, though the number of observations was rightly showed. And it seemed just summarized the dataset, like the min, max, and mean of every variables of the dataset, not the model fit. I guess the values of the variables were not input to the model. But why?

I attached the example script written by Rijsdijk here. Every steps I did were following the very script.

I am looking forward for your reply. Thank you in advance.

Attachment | Size |
---|---|

MVcor3var_ IP_CP_OpenMx.R | 55.19 KB |

It sounds like you applied the summary() function to the unfitted model and not the fitted model. If you attach a copy of the script you executed, it would give us more information to determine what is happening.

my script

just had a quick look, but down the bottom of the main model, you have managed to put the objective for your outer model into the OS model...

should look like this:

Sorry, I am not sure that I understand your explaination. What's the outer model?

I did not find difference between your script and mine. Though I copied your script to run, and got the same result.

The short version: Move one of the parentheses from the last line before the

This line is just before you start adding MZ and DZ models.

The longer version: In this script, you first create a container model, called ACEsex. Then you build a model inside that, called ACE, and four models inside that, called MZm, DZm, etc. More important than that, the container model ACEsex has no objective function. You can check this by looking at the raw model itself (you stored it in ACEsexModel, so just type

`ACEsexModel`

at the R command prompt). Notice that it has one object (ACE) in its @submodels slot, and only NULL in its @objective slot.Now move the parenthesis, and run it again. The paren that we're moving closes the

`mxModel("ACE" ..`

. That means that the MZm, etc. models will now end up in the container model (ACEsex) rather than the child model (ACE). More importantly, the two lines that follow, the mxAlgebra() and the mxAlgebraObjective(), will be part of the container model (ACEsex). Go ahead and look at ACEsex again. Notice that it now has several submodels and a non-NULL objective function.Unless you have independent child models, only the objective function of the outermost model (the container model, in this case ACEsex) will be minimized.

I appreciate all of you for your patience and explainations. I knew the ACE model was nested in the ACEsex model, but, I have to say, I misunderstood the word "outer".

I will treat the parenthesis more carefully. And thanks again.