You are here

Bivariate ACE model with moderator

10 posts / 0 new
Last post
EmilieRH's picture
Offline
Joined: 09/24/2020 - 04:43
Bivariate ACE model with moderator

Hi all,

I am currently working on a project on how intelligence moderates school achievement among young adults. My sample consists of 4,084 German twins aged 17 and 23-24, respectively, who have information on both intelligence and GPA from secondary school. However, the twins' GPAs come from various types of secondary schools so to check whether I need to use school type as a moderator in my GxE analyses, I first want to see what happens if I run separate bivariate variance decomposition analyses for the three school types constraining their parameters equal.

In other words, I would like to set up a three-group program running the bivariate variance decomposition analyses for all three school types at once. However, so far I can only run them separately using the umxACE function. Can anyone help me how to set up a three-group program?

All the best,
Emilie

Leo's picture
Leo
Offline
Joined: 01/09/2020 - 14:36
Hi Emilie,

Hi Emilie,

I assume you are doing GxE Purcell-style? As your moderator varies between twins, go for the full bivariate model. see here:
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3253285/

In OpenMx:
Integrating your issues with different school types should be no problem, as you can simply produce 6 instead of 2 groups and add them to mxFitFunctionMultigroup (2 groups per school type). Subsequently you can equal the parameters (by equaling the labels) and check if model fit decreases significantly with MxCompare.

If you'd like to to stick with umx you could familiarize yourself with the object umx creates. You would probably have to change/add: 1) add different mxData objects (probably 6), 2) duplicate matrices, paths with different labels per school type 3) add group names to multigroup function. Maybe you could even do separate models for each school type at first and then merge them. Still you'd have to do 2) and 3).

Leo's picture
Leo
Offline
Joined: 01/09/2020 - 14:36
of course 6 mxmodels. Which
  • of course 6 mxmodels. Which names you would then put in the multigroup function
AdminNeale's picture
Offline
Joined: 03/01/2013 - 14:09
The six names of the mxModels

The six names of the mxModel objects. Note that they need to differ!

EmilieRH's picture
Offline
Joined: 09/24/2020 - 04:43
Hi Leo,

Hi Leo,

Thanks for your answer! As I am new to both R and behavioural genetics, what I have been doing so far is mainly to modify others' scripts to my case, so I will try to see if I can find an OpenMx script showing how to fit a multigroup model.

EmilieRH's picture
Offline
Joined: 09/24/2020 - 04:43
What about twins who differ on school type?

Hi both,

I just tried to modify the attached script by Lucia Colodro-Conde from this year's IBG workshop. However, I am not sure what to do with twins who differ on school type when I have to produce the six categories (MZ/DZ within 3 school types)? I was thinking about recoding the GPA and IQ of the twin whose school type was not of interest to missing, but unless there is also a way to handle missing data within this script, it seems that I will have to rely on twin pairs who have attended the same school type only.

File attachments: 
Leo's picture
Leo
Offline
Joined: 01/09/2020 - 14:36
That's true. If twins go to

That's true. If twins go to different types of schools, then this won't work. You might want to add school type as a definition variable as an alternative (which is an unordered factor, therefore use dummies).
However, most twin pairs are going to be concordant on school type, particularly MZs.

Missing data is handled automatically in FIML, so your script is still going to work fine if you set a few cells to NA.

You could use that script. In essence: Duplicate all matrices, algebras using different labels and names. Build 6 mxModels (DZ/MZ models for each school type). Add model names to the multigroup function and run model. Then create another model where you equal the labels and compare it to the first model (does fit decrease significantly?)

EmilieRH's picture
Offline
Joined: 09/24/2020 - 04:43
How is missing data handled?

Actually, there is quite a number of twin pairs who attend different kinds of secondary schools. But if I just recode the IQ and GPA of those twins whose school type is not of interest to missing and use FIML, this should be fine. However, I cannot see that missing data is handled by FIML in the script I sent you? How do I know that this is the case?

Leo's picture
Leo
Offline
Joined: 01/09/2020 - 14:36
mxFitFunctionML should

mxFitFunctionML should automatically use FIML. check what your fitfunction says in the object after it was run

EmilieRH's picture
Offline
Joined: 09/24/2020 - 04:43
Coding problems

Hi again,

It seems that mxFitFunctionML uses FIML.

In general, it also seems that my modified script runs OK. However, when I look at my results, it is clear that I have messed up something because some of the standardized variance components are larger than |1| and so are some of the genetic and environmental correlations. Can you help me figure out what the problem is in the attached script?

I use the standardized residuals of my two variables of interest as data input.