Obtain 95%CI for ACE model- script revised from Dorothy Bishop

Posted on
No user picture. camus Joined: 03/21/2019
Hi, I am new with R and OpenMx. Recently I revised Dorothy Bishop's script to run ACE models. However, her original code could not get the 95%CI for of A,C,E estimates, but only 95%CI for Unsquared path estimates. I know mxCI() can obtain 95%CI, but after various attempts, it never works for me. Could any expert have a look of the code and let me know how should I add it?
Thanks!
Replied on Wed, 06/05/2019 - 10:36
Picture of user. AdminRobK Joined: 01/24/2014

Unless I'm missing something, you'd just need to put mxCI(c("A","C","E")) into the MxModel you're naming "twinACE", and pass intervals=TRUE to mxRun().
Replied on Fri, 06/07/2019 - 15:47
No user picture. camus Joined: 03/21/2019

In reply to by AdminRobK

Thanks much for your response. However, I want to get the 95%CI for a2_ACE, c2_ACE, e2_ACE for this script:

expMeans_ACE <- mxEval(expMean, twinACEFit) # expected mean
A_ACE <- mxEval(a*a, twinACEFit) # additive genetic variance, a^2
C_ACE <- mxEval(c*c, twinACEFit) # shared environmental variance, c^2
E_ACE <- mxEval(e*e, twinACEFit) # unique environmental variance, e^2
V <- (A_ACE+C_ACE+E_ACE) # total variance
a2_ACE <- A_ACE/V # standardized additive genetic variance
c2_ACE <- C_ACE/V # standardized shared environmental variance
e2_ACE <- E_ACE/V # standardized unique environmental variance

Should I add `mxCI(c("a2_ACE"," c2_ACE "," e2_ACE"))` to somethere? Thanks again for your help!
Replied on Fri, 06/07/2019 - 16:21
Picture of user. tbates Joined: 07/31/2009

When you compute a value outside the model like `A_ACE/V`, you can't use mxCI().

Options include `mxSE(A_ACE/V, model)` or adding functions like this to the twin model:
`mxAlgebra(name= "A_std", A_ACE/V)`

you can then request `mxCI("A_std")` and `intervals= TRUE` in the mxRun()

Finally: Check out the umx package twin modelling functions like `umxACE`

[https://cran.r-project.org/web/packages/umx](https://cran.r-project.org/web/packages/umx)

and the accompanying open access paper

Bates, T. C., Neale, M. C., & Maes, H. H. (2019). umx: A library for Structural Equation and Twin Modelling in R. *Twin Research and Human Genetics*, **22**, 27-41. [link](https://www.cambridge.org/core/journals/twin-research-and-human-genetics/article/umx-twin-and-pathbased-structural-equation-modeling-in-r). doi:10.1017/thg.2019.2