You are here

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

4 posts / 0 new
Last post
camus's picture
Offline
Joined: 03/21/2019 - 13:32
Obtain 95%CI for ACE model- script revised from Dorothy Bishop
AttachmentSize
Microsoft Office document icon DB ACE_revised.doc55 KB
File twindata.csv20.2 KB

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!

AdminRobK's picture
Offline
Joined: 01/24/2014 - 12:15
Unless I'm missing something,

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().

camus's picture
Offline
Joined: 03/21/2019 - 13:32
Thanks much for your response

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!

tbates's picture
Offline
Joined: 07/31/2009 - 14:25
mxSE, mxAlgebra, mxCI, and umx

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

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. doi:10.1017/thg.2019.2