You are here

Saving umxReduceACE output

1 post / 0 new
hampusgronvall's picture
Offline
Joined: 05/24/2023 - 07:29
Saving umxReduceACE output

Hi again all, very sorry for double posting, but I figured since it's two different questions they should be in two separate topics.

Using umxReduceACE on an ACE-model will print out a wonderful comparison between different models, but is there any way to save it?

> # Import data
> data(twinData)
> twinData[, c("ht1", "ht2")] = twinData[, c("ht1", "ht2")] * 10
> mzData = twinData[twinData$zygosity %in% "MZFF", ]
> dzData = twinData[twinData$zygosity %in% "DZFF", ]
> 
> # Do the umxACE-stuff
> ACE = umxACE(selDVs = "ht", selCovs = "age", sep = "", dzData = dzData, mzData = mzData)
1 row(s) dropped from 'data' due to missing definition variable(s)
Running ACE with 5 parameters
ACE -2 × log(Likelihood) = 5944.831
 
 
Table: Standardized parameter estimates from a 1-factor Cholesky ACE model. A: additive genetic; C: common environment; E: unique environment.
 
|   |    a1|    c1|   e1|
|:--|-----:|-----:|----:|
|ht | 0.929| 0.082| 0.36|
 
 
Table: Means and (raw) betas from model$top$intercept and model$top$meansBetas
 
|          |    ht1|    ht2|
|:---------|------:|------:|
|intercept | 16.446| 16.446|
|age       | -0.005| -0.005|
 
?umxPlotACE options: std=T/F, means=T/F, digits=n, strip_zero=T/F, file=, min=, max =
> # Try to store results of umxReduceACE comparisons...
> reduce_output <- umxReduceACE(ACE, silent = T)
You gave me an ACE model
 
 Solution found!  Final fit=5944.8455 (started at 5944.8658)  (1 attempt(s): 1 valid, 0 errors)
 
 
 Solution found!  Final fit=6464.8584 (started at 23701.837)  (1 attempt(s): 1 valid, 0 errors)
 
 
 Solution found!  Final fit=5944.8455 (started at 5944.8968)  (1 attempt(s): 1 valid, 0 errors)
 
 
 Solution found!  Final fit=7776.1643 (started at 25927.514)  (1 attempt(s): 1 valid, 0 errors)
 
 
 
|Model |a    |c    |    e|d  | EP|Δ Fit   |Δ df |p       |     AIC|Δ AIC   |Compare with Model |Fit units |
|:-----|:----|:----|----:|:--|--:|:-------|:----|:-------|-------:|:-------|:------------------|:---------|
|ACE   |0.93 |0.08 | 0.36|   |  5|        |     |        | 5954.83|0       |                   |-2lnL     |
|ADE   |0.93 |     | 0.36|0  |  5|0.01    |0    |        | 5954.85|0.01    |ACE                |-2lnL     |
|CE    |     |0.84 | 0.54|   |  4|520.03  |1    |< 0.001 | 6472.86|518.03  |ACE                |-2lnL     |
|AE    |0.93 |     | 0.36|   |  4|0.01    |1    |0.904   | 5952.85|-1.99   |ACE                |-2lnL     |
|E     |     |     | 1.00|   |  3|1831.33 |2    |< 0.001 | 7782.16|1827.33 |ACE                |-2lnL     |
Among ACE, ADE, CE, and AE models 'AE' fit best according to AIC.
Conditional AIC probability {Wagenmakers, 2004, 192-196}  indicates relative model support as'ACE', 'ADE', 'CE', and 'AE' respectively are: '0.21', '0.21', '0', and '0.58' Using MuMIn::Weights(AIC()).
ACE (0.21%)ADE (0.21%)CE (0%)AE (0.58%)
Running AE with 4 parameters
> # ... but it doesn't work and only saves a model
> reduce_output
MxModel 'AE' 
type : default 
$matrices : NULL 
$algebras : NULL 
$penalties : NULL 
$constraints : NULL 
$intervals : 'top.a_std', 'top.c_std', and 'top.e_std' 
$latentVars : none
$manifestVars : none
$data : NULL
$submodels : 'top', 'MZ', and 'DZ' 
$expectation : NULL 
$fitfunction : MxFitFunctionMultigroup 
$compute : MxComputeSequence 
$independent : FALSE 
$options :  
$output : TRUE