You are here

mxRefModels output

5 posts / 0 new
Last post
Cindy.s's picture
Offline
Joined: 07/04/2015 - 18:52
mxRefModels output
AttachmentSize
Binary Data ACE_models.R4.41 KB

Hi OpenMx Community!

I just ran a single-trait ACE model, with one observed variable, and no definition variables. I used mxRefModels to get the Saturated and the Independence models. I wanted to see if I get similar values defining the Saturated model and the Independence model by hand.
My results differ basically in every aspect. Is my Saturated and Independence model definition wrong (see attached script), or is this a limitation of mxRefModels:
-Df is 6 vs 3: I guess mxRefModels includes A,C,E parameters, that is why it is 3 more. Should they be included in the Saturated model?
-My independence and saturated fit values is different, thus all fit statistics are different

#results of : summary(ACEFit, refModels = Sat_models)
observed statistics:  198                                
estimated parameters:  4                                 
degrees of freedom:  194                                 
fit value ( units ):  736.6658                               
saturated fit value ( units ):  729.8184                                 
number of observations:  99                              
chi-square:  X2 ( df=6 ) = 6.847411,  p = 0.3351895                                
Information Criteria:                                 
      |  df Penalty  |  Parameters Penalty  |  Sample-Size Adjusted                             
AIC:       348.6658               744.6658                       NA                             
BIC:      -154.7874               755.0463                 742.4141                              
CFI: 0.9926078                               
TLI: 0.9975359   (also known as NNFI)                                
RMSEA:  0.03777058  [95% CI (0, 0.1546974)]                             
Prob(RMSEA <= 0.05): 0.4868861                             
#results of : summary(ACEFit, SaturatedLikelihood=SatSum$Minus2LogLikelihood ,
#SaturatedDoF=SatSum$degreesOfFreedom,
#IndependenceLikelihood=IndepSum$Minus2LogLikelihood ,
#IndependenceDoF=IndepSum$degreesOfFreedom)
observed statistics:  198 
estimated parameters:  4 
degrees of freedom:  194 
fit value ( units ):  736.6658 
saturated fit value ( units ):  731.998 
number of observations:  99 
chi-square:  X2 ( df=3 ) = 4.667762,  p = 0.1978056
Information Criteria: 
      |  df Penalty  |  Parameters Penalty  |  Sample-Size Adjusted
AIC:       348.6658               744.6658                       NA
BIC:      -154.7874               755.0463                 742.4141
CFI: 0.9853227 
TLI: 0.9902151   (also known as NNFI) 
RMSEA:  0.07493571  [95% CI (0, 0.2185226)]
Prob(RMSEA <= 0.05): 0.2926299
AdminHunter's picture
Offline
Joined: 03/01/2013 - 11:03
The Means

Hi Cindy,

The difference between the saturated/independence models produced by mxRefModels and those made by you seems to be the means. The mxRefModels function is estimating a separate mean for each twin: one for each of MZ1, MZ2, DZ1, and DZ2. You are estimating a single mean for the MZs and a single mean for the DZs. The function makes no special treatment of A, C, E components.

I would be cautious interpreting your code because you refer to several different models that are not defined in it.

#Run model and Saturated models
ACEFit <- mxRun(ACEModel, intervals = FALSE)
Sat_models = mxRefModels(twinACEFit, run = T)
summary(tACEFit, refModels = Sat_models)

The reference models are made with respect to "twinACEFit" not "ACEFit". Then the summary is examined with respect to "tACEFit", not "twinACEFit" or "ACEFit". You didn't show code for these models, only "ACEFit". So I have no idea if the comparison is appropriate. At minimum, change the above code to

#Run model and Saturated models
ACEFit <- mxRun(ACEModel, intervals = FALSE)
Sat_models = mxRefModels(ACEFit, run = T)
summary(ACEFit, refModels = Sat_models)
Cindy.s's picture
Offline
Joined: 07/04/2015 - 18:52
Should the Saturated model be calculated with or four means

I defined the Saturated models as you insisted, and I got exactly the same results as mxRefModels! Thanks you so much for your help!

So in case my original model only has one mean (all online scripts only calculate with one), should the Saturated model calculate with 4 means, one for each MZ1, MZ2, DZ1, and DZ2?

I’m so sorry for my sloppy code I attached! I corrected the mistakes, and attached it again.

For some data, I get „status code 6” when defining the Saturated model or the Independence by hand (with one mean). Rerunning the already fitted model results in a status code 0 indicating no problem, but my estimates don’t really change, and the fit value doesn’t either. Is this a problem?

#First run results
>SatFit <- mxRun(SatModelHand, intervals = TRUE)
>SatSum <- summary(SatFit)
>SatFit$output$status$code
[1] 6
>SatSum
Summary of SatModel 
 
The model does not satisfy the first-order optimality conditions to the required accuracy, and no improved point for the merit function could be found during the final linesearch (Mx status RED) 
 
free parameters:
  name     matrix row col     Estimate   Std.Error A
1      covMZ11  MZ.CholMZ   1   1  1.561433620 0.145336982  
2      covMZ21  MZ.CholMZ   2   1  1.155059844 0.159254246  
3      covMZ22  MZ.CholMZ   2   2  0.888269973 0.082503650  
4         mean MZ.expMean   1   1 11.340158137 3.377992172  
5      covDZ11  DZ.CholDZ   1   1  1.161319052 0.130562092  
6      covDZ21  DZ.CholDZ   2   1  0.053166645 0.227378409  
7      covDZ22  DZ.CholDZ   2   2  1.404578065 0.159673078  
 
observed statistics:  198 
estimated parameters:  7 
degrees of freedom:  191 
fit value ( units ):  639.6439 
number of observations:  99 
 
#Rerunning the model
>SatFitRerun <- mxRun(SatFit, intervals = TRUE)
>SatSumRerun <- summary(SatFitRerun)
>SatFitRerun$output$status$code
[1] 0
>SatSumRerun
Summary of SatModel 
 
free parameters:
  name     matrix row col     Estimate   Std.Error A
1      covMZ11  MZ.CholMZ   1   1  1.561433621 0.145336072  
2      covMZ21  MZ.CholMZ   2   1  1.155059844 0.159253522  
3      covMZ22  MZ.CholMZ   2   2  0.888269975 0.082503727  
4         mean MZ.expMean   1   1 11.340158136 3.378332096  
5      covDZ11  DZ.CholDZ   1   1  1.161319054 0.130562104  
6      covDZ21  DZ.CholDZ   2   1  0.053166644 0.227378317  
7      covDZ22  DZ.CholDZ   2   2  1.404578065 0.159672677  
 
observed statistics:  198 
estimated parameters:  7 
degrees of freedom:  191 
fit value ( units ):  639.6439 
number of observations:  99
AdminNeale's picture
Offline
Joined: 03/01/2013 - 14:09
No Problem

Many - perhaps most - Status Code 6's are false alarms. Checking the result by refitting from the solution (as you have done) or from different starting values (as might be done with mxTryHard()) can help support the hypothesis that the solution found is a global minimum.

I reckon that there is nothing to worry about in this case.

mhunter's picture
Offline
Joined: 07/31/2009 - 15:26
It depends!

And here's how ...

Whether your saturated model should have 1 or 4 means depends on the hypothesis you're trying to test. If you're testing whether the covariance structure of your model is close enough to the saturated covariance structure, then match the means structure: hence, if your model has one mean, then the saturated model against which you're testing should have one mean. If, on the other hand, you're testing whether your model matches the covariance and means structure of the saturated model, then the saturated model should have four means and your model should have as many means as you hypothesize are different.