what's wrong with my data?
Posted on
userzht
Joined: 02/19/2011
Forums
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.
It sounds like you applied
Log in or register to post comments
In reply to It sounds like you applied by mspiegel
my script
Log in or register to post comments
In reply to my script by userzht
objective in wrong model
should look like this:
Log in or register to post comments
In reply to objective in wrong model by tbates
I did not find any difference
I did not find difference between your script and mine. Though I copied your script to run, and got the same result.
Log in or register to post comments
In reply to I did not find any difference by userzht
MxModel Tree Issues
mxRun()
command to here:
mxAlgebra( expression=rbind(cbind(Am/Vm,Cm/Vm,Em/Vm),cbind(Af/Vf,Cf/Vf,Ef/Vf)), name="VarComp")), # Note second paren I added
.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.
Log in or register to post comments
In reply to MxModel Tree Issues by tbrick
nest the model correctly
I will treat the parenthesis more carefully. And thanks again.
Log in or register to post comments