Fitting Bivariate Models October 21, 2014 Elizabeth Prom-Wormley & Hermine Maes 804-828-8154.

Slides:



Advertisements
Similar presentations
Lecture 42 Prof Duncan Shaw. Genetic variation & normal traits Normal traits include height, IQ, blood pressure These are influenced by many genes (called.
Advertisements

Bivariate analysis HGEN619 class 2007.
Elizabeth Prom-Wormley & Hermine Maes
Univariate Model Fitting
Multivariate Mx Exercise D Posthuma Files: \\danielle\Multivariate.
Estimating “Heritability” using Genetic Data David Evans University of Queensland.
Factor analysis Caroline van Baal March 3 rd 2004, Boulder.
Path Analysis Danielle Dick Boulder Path Analysis Allows us to represent linear models for the relationships between variables in diagrammatic form.
Multivariate Analysis Nick Martin, Hermine Maes TC21 March 2008 HGEN619 10/20/03.
Introduction to Multivariate Analysis Frühling Rijsdijk & Shaun Purcell Twin Workshop 2004.
Multivariate Genetic Analysis: Introduction(II) Frühling Rijsdijk & Shaun Purcell Wednesday March 6, 2002.
Quantitative Genetics
Chapter 5 Human Heredity by Michael Cummings ©2006 Brooks/Cole-Thomson Learning Chapter 5 Complex Patterns of Inheritance.
Summarizing Data Nick Martin, Hermine Maes TC21 March 2008.
Multiple raters March 7 th, 2002 Boulder, Colorado John Hewitt.
Multivariate Analysis Hermine Maes TC19 March 2006 HGEN619 10/20/03.
David M. Evans Sarah E. Medland Developmental Models in Genetic Research Wellcome Trust Centre for Human Genetics Oxford United Kingdom Twin Workshop Boulder.
Genetic Growth Curve Models Practica Boulder, March 2008 Irene Rebollo & Gitta Lubke & Mike Neale VU Amsterdam NL & Notre Dame, US & VCU, US.
Gene x Environment Interactions Brad Verhulst (With lots of help from slides written by Hermine and Liz) September 30, 2014.
Introduction to Multivariate Genetic Analysis Kate Morley and Frühling Rijsdijk 21st Twin and Family Methodology Workshop, March 2008.
Path Analysis Frühling Rijsdijk. Biometrical Genetic Theory Aims of session:  Derivation of Predicted Var/Cov matrices Using: (1)Path Tracing Rules (2)Covariance.
Raw data analysis S. Purcell & M. C. Neale Twin Workshop, IBG Colorado, March 2002.
Karri Silventoinen University of Helsinki Osaka University.
Multifactorial Traits
Process of Genetic Epidemiology Migrant Studies Familial AggregationSegregation Association StudiesLinkage Analysis Fine Mapping Cloning Defining the Phenotype.
Chapter 5 Characterizing Genetic Diversity: Quantitative Variation Quantitative (metric or polygenic) characters of Most concern to conservation biology.
Karri Silventoinen University of Helsinki Osaka University.
Continuously moderated effects of A,C, and E in the twin design Conor V Dolan & Sanja Franić (BioPsy VU) Boulder Twin Workshop March 4, 2014 Based on PPTs.
Introduction to Multivariate Genetic Analysis (2) Marleen de Moor, Kees-Jan Kan & Nick Martin March 7, 20121M. de Moor, Twin Workshop Boulder.
Cholesky decomposition May 27th 2015 Helsinki, Finland E. Vuoksimaa.
Univariate modeling Sarah Medland. Starting at the beginning… Data preparation – The algebra style used in Mx expects 1 line per case/family – (Almost)
Discriminant Analysis Discriminant analysis is a technique for analyzing data when the criterion or dependent variable is categorical and the predictor.
Genetic influences “Which is more important, heredity or environment?” “Do the observed differences between people depend more on heredity or the environment?”
Mx modeling of methylation data: twin correlations [means, SD, correlation] ACE / ADE latent factor model regression [sex and age] genetic association.
Mx Practical TC20, 2007 Hermine H. Maes Nick Martin, Dorret Boomsma.
Genetic simplex modeling of personality in adolescent Australian twins N.A. GILLESPIE 1, D. M. EVANS 1, N.G. MARTIN 1 1 Queensland Institute of Medical.
Introduction to Genetic Theory
Biological Approach Methods. Other METHODS of studying biological traits??? How else can you examine biological links to behaviour? Brain storm.
Introduction to Multivariate Genetic Analysis Danielle Posthuma & Meike Bartels.
Developmental Models/ Longitudinal Data Analysis Danielle Dick & Nathan Gillespie Boulder, March 2006.
March 7, 2012M. de Moor, Twin Workshop Boulder1 Copy files Go to Faculty\marleen\Boulder2012\Multivariate Copy all files to your own directory Go to Faculty\kees\Boulder2012\Multivariate.
Multivariate Genetic Analysis (Introduction) Frühling Rijsdijk Wednesday March 8, 2006.
Department of Psychiatry, Washington University School of Medicine
All in the Family The Shared and Distinctive Causes of Personality and Well-Being Chris C. Martin & Corey L. M. Keyes | Department of Sociology,
Genetic simplex model: practical
Multivariate Analysis
Bivariate analysis HGEN619 class 2006.
Univariate Twin Analysis
Introduction to Multivariate Genetic Analysis
Fitting Univariate Models to Continuous and Categorical Data
Re-introduction to openMx
Univariate Analysis HGEN619 class 2006.
Quantitative Variation
MRC SGDP Centre, Institute of Psychiatry, Psychology & Neuroscience
Path Analysis Danielle Dick Boulder 2008
Can resemblance (e.g. correlations) between sib pairs, or DZ twins, be modeled as a function of DNA marker sharing at a particular chromosomal location?
Behavior Genetics The Study of Variation and Heredity
Univariate modeling Sarah Medland.
GxE and GxG interactions
Pak Sham & Shaun Purcell Twin Workshop, March 2002
Sarah Medland faculty/sarah/2018/Tuesday
\nathan\RaterBias.
Lucía Colodro Conde Sarah Medland & Matt Keller
Product moment correlation
Bivariate Genetic Analysis Practical
BOULDER WORKSHOP STATISTICS REVIEWED: LIKELIHOOD MODELS
Multivariate Genetic Analysis: Introduction
Rater Bias & Sibling Interaction Meike Bartels Boulder 2004
Presentation transcript:

Fitting Bivariate Models October 21, 2014 Elizabeth Prom-Wormley & Hermine Maes

The Problem(s) BMI may not be an appropriate measure for use in studying the genetics of obesity – Do height and weight share the same genetic/environmental influences? Smoking is a risk factor for cardiovascular disease, but how ? – Does smoking in adolescence lead to cardiovascular disease in adulthood?

A Solution Bivariate Genetic Analysis Two or more traits can be correlated because they share common genes or common environmental influences – e.g. Are the same genetic/environmental factors influencing the traits? With twin data on multiple traits it is possible to partition the covariation into its genetic and environmental components – Goal: to understand what factors make sets of variables correlate or co-vary

Bivariate Analysis A Roadmap 1- Use the data to test basic assumptions inherent to standard genetic models Saturated Bivariate Model 2- Estimate the contributions of genetic and environmental factors to the covariance between two traits Bivariate Genetic Models (Bivariate Genetic Analysis via Cholesky Decomposition)

Getting a Feel for the Data Phenotypic and Twin Correlations MZ DZ Height2Weight2 Height2Weight2 Height Weight Open R script for today r Weight/Height = 0.47

Getting a Feel for the Data Phenotypic and Twin Correlations MZ DZ Height2Weight2 Height2Weight2 Height Weight r Weight/Height = 0.47 Expectations 1- rMZ > rDZ (cross-twin/cross-trait) Genetic effects contribute to the relationship between height and weight 2- Cross-twin cross-variable correlations are not as big as the correlations between twins within variables. Variable specific genetic effects on height and/or weight

So…How Can We be Sure?

Building the Bivariate Genetic Model Sources of Information Cross-trait covariance within individuals – Within-Twin Covariance Cross-trait covariance between twins – Cross-Twin Covariance MZ:DZ ratio of cross-trait covariance between twins

Basic Data Assumptions MZ and DZ twins are sampled from the same population, therefore we expect – Equal means/variances in Twin 1 and Twin 2 – Equal means/variances in MZ and DZ twins – Equal covariances between Twin 1 and Twin 2 in MZ and DZ twins 9

Getting a Feel for the Data Means ht1wt1ht2wt2 MZ DZ

Getting a Feel for the Data Variances-Covariances ht1wt1ht2wt2 ht1 wt1 ht2 wt2 ht1wt1ht2wt2 ht1 wt1 ht2 wt2 MZ Twins DZ Twins Twin 1Twin 2 Twin 1 Twin 2 Twin 1Twin 2 Twin 1 Twin 2

Getting a Feel for the Data Variances-Covariances Variances

Observed Variance-Covariance Matrix P1P 2P1P 2 P 1 Variance Twin 1- P1 P2 Variance Twin 1- P2 P 1 Variance Twin2- P1 P 2 Variance Twin 2- P2 Twin 1Twin 2 Twin 1 Twin 2 Variances

Getting a Feel for the Data Variances-Covariances ht1wt1ht2wt2 ht wt ht wt ht1wt1ht2wt2 ht wt ht wt MZ Twins DZ Twins Twin 1Twin 2 Twin 1 Twin 2 Twin 1Twin 2 Twin 1 Twin 2

Getting a Feel for the Data Variances-Covariances Cross-Trait / Within-Twin Covariance

Observed Variance-Covariance Matrix P1P 2P1P 2 P 1 Variance Twin 1- P1 Covariance Twin 1 P1/P2 P2 Covariance Twin 1 P1/P2 Variance Twin 1- P2 P 1 Variance Twin2- P1 Covariance Twin 2 P1/P2 P 2 Covariance Twin 2 P1/P2 Variance Twin 2- P2 Twin 1Twin 2 Twin 1 Twin 2 Variances + Cross-Trait Within-Twin Covariances

Getting a Feel for the Data Variances-Covariances ht1wt1ht2wt2 ht wt ht wt ht1wt1ht2wt2 ht wt ht wt MZ Twins DZ Twins Twin 1Twin 2 Twin 1 Twin 2 Twin 1Twin 2 Twin 1 Twin 2

Getting a Feel for the Data Variances-Covariances Cross-Trait / Within-Twin Covariance

Observed Variance-Covariance Matrix P1P 2P1P 2 P 1 Variance Twin 1- P1 Covariance Twin 1 P1/P2 P1 Within Trait T1 /T2 Covariance P2 Covariance Twin 1 P1/P2 Variance Twin 1- P2 P2 Within Trait T1 /T2 Covariance P 1 P1 Within Trait T1 /T2 Covariance Variance Twin2- P1 Covariance Twin 2 P1/P2 P 2 P2 Within Trait T1 /T2 Covariance Twin 2 P1/P2 Variance Twin 2- P2 Twin 1Twin 2 Twin 1 Twin 2 Variances + Cross-Trait Within-Twin Covariances + Within-Trait Cross-Twin Covariances

Getting a Feel for the Data Variances-Covariances ht1wt1ht2wt2 ht wt ht wt ht1wt1ht2wt2 ht wt ht wt MZ Twins DZ Twins Twin 1Twin 2 Twin 1 Twin 2 Twin 1Twin 2 Twin 1 Twin 2

Getting a Feel for the Data Variances-Covariances Cross-Trait / Cross-Twin Covariance

Observed Variance-Covariance Matrix P1P 2P1P 2 P 1 Variance Twin 1- P1 Covariance Twin 1 P1/P2 P1 Within Trait T1 /T2 Covariance P1/P2 Cross-Trait T1 /T2 Covariance P2 Covariance Twin 1 P1/P2 Variance Twin 1- P2 P2/P1 Cross-Trait T1 /T2 Covariance P2 Within Trait T1 /T2 Covariance P 1 P1 Within Trait T1 /T2 Covariance P2/P1 Cross-Trait T1 /T2 Covariance Variance Twin2- P1 Covariance Twin 2 P1/P2 P 2 P1/P2 Cross-Trait T1 /T2 Covariance P2 Within Trait T1 /T2 Covariance Twin 2 P1/P2 Variance Twin 2- P2 Twin 1Twin 2 Twin 1 Twin 2 Variances + Cross-Trait Within-Twin Covariances + Within-Trait Cross-Twin Covariances

Observed Variance-Covariance Matrix P1P 2P1P 2 P 1 Variance Twin 1- P1 Covariance Twin 1 P1/P2 P1 Within Trait T1 /T2 Covariance P1/P2 Cross-Trait T1 /T2 Covariance P2 Covariance Twin 1 P1/P2 Variance Twin 1- P2 P2/P1 Cross-Trait T1 /T2 Covariance P2 Within Trait T1 /T2 Covariance P 1 P1 Within Trait T1 /T2 Covariance P2/P1 Cross-Trait T1 /T2 Covariance Variance Twin2- P1 Covariance Twin 2 P1/P2 P 2 P1/P2 Cross-Trait T1 /T2 Covariance P2 Within Trait T1 /T2 Covariance Twin 2 P1/P2 Variance Twin 2- P2 Twin 1Twin 2 Twin 1 Twin 2 Variances + Cross-Trait Within-Twin Covariances + Within-Trait Cross-Twin Covariances + Cross-Twin Cross-Trait Covariances

Observed Variance-Covariance Matrix P1P 2P1P 2 P 1 Variance P1 P2 Covariance P1-P2 Variance P2 P 1 Within- trait P1 Cross-traitVariance P1 P 2 Cross-trait Within- trait P2 Covarianc e P1-P2 Variance P2 Twin 1Twin 2 Twin 1 Twin 2 Within-twin covariance Within-twin covariance Cross-twin covariance

Getting a Feel for the Data Variances-Covariances ht1wt1ht2wt2 ht wt ht wt ht1wt1ht2wt2 ht wt ht wt MZ Twins DZ Twins Twin 1Twin 2 Twin 1 Twin 2 Twin 1Twin 2 Twin 1 Twin 2

Within-twin cross-trait covariances imply common etiological influences Cross-twin cross-trait covariances imply familial common etiological influences MZ/DZ ratio of cross-twin cross-trait covariances reflects whether common etiological influences are genetic or environmental Cross-Trait Covariances

Bivariate Twin Covariance Matrix X1X1 Y1Y1 X2X2 Y2Y2 X1X1 V X1 C X1Y1 C X1X2 C X1Y2 Y1Y1 C Y1X1 V Y1 C Y1X2 C Y1Y2 X2X2 C X2X1 C X2Y1 V X2 C X2Y2 Y2Y2 C Y2X1 C Y2Y1 C Y2X2 V Y2 twin 1 twin 2 Variances of X & Y same across twins and zygosity groups Variances of X & Y same across twins and zygosity groups

Bivariate Twin Covariance Matrix X1X1 Y1Y1 X2X2 Y2Y2 X1X1 V X1 C X1Y1 C X1X2 C X1Y2 Y1Y1 C Y1X1 V Y1 C Y1X2 C Y1Y2 X2X2 C X2X1 C X2Y1 V X2 C X2Y2 Y2Y2 C Y2X1 C Y2Y1 C Y2X2 V Y2 twin 1 twin 2 Covariances of X & Y same across twins and zygosity groups Covariances of X & Y same across twins and zygosity groups

Bivariate Twin Covariance Matrix X1X1 Y1Y1 X2X2 Y2Y2 X1X1 V X1 C X1Y1 C X1X2 C X1Y2 Y1Y1 C Y1X1 V Y1 C Y1X2 C Y1Y2 X2X2 C X2X1 C X2Y1 V X2 C X2Y2 Y2Y2 C Y2X1 C Y2Y1 C Y2X2 V Y2 twin 1 twin 2 Cross-Twin Within- Trait Covariances differ by zygosity

Bivariate Twin Covariance Matrix X1X1 Y1Y1 X2X2 Y2Y2 X1X1 V X1 C X1Y1 C X1X2 C X1Y2 Y1Y1 C Y1X1 V Y1 C Y1X2 C Y1Y2 X2X2 C X2X1 C X2Y1 V X2 C X2Y2 Y2Y2 C Y2X1 C Y2Y1 C Y2X2 V Y2 twin 1 twin 2 Cross-Twin Cross- Trait Covariances differ by zygosity

Saturated Model Testing

Bivariate Analysis A Roadmap 1- Use the data to test basic assumptions inherent to standard genetic models Saturated Bivariate Model 2- Estimate the contributions of genetic and environmental factors to the covariance between two traits Bivariate Genetic Models (Bivariate Genetic Analysis via Cholesky Decomposition)

Genetic Modeling with Twin Data acac MZ = 1 DZ = A C Twin 1 Height Twin 2 Height ee EEC A

a 11 a 21 c 11 c 22 c 21 e 11 e 21 e 22 a 11 a 22 a 21 c 11 c 22 c 21 e 11 e 21 e 22 MZ = 1 DZ = 0.5 MZ = 1 DZ = C1C2C1C2 Twin 1 Height Twin 1 Weight Twin 2 Height Twin 2 Weight E1 E2 E1 E2 a 22 Bivariate Genetic Modeling A1 A2 A1A2

Building the Bivariate Genetic Model Sources of Information Cross-trait covariance within individuals – Within-Twin Covariance Cross-trait covariance between twins – Cross-Twin Covariance MZ:DZ ratio of cross-trait covariance between twins

Alternative Representations

Bivariate Twin Covariance Matrix X1X1 Y1Y1 X1X1 V X1 C X1Y1 Y1Y1 C Y1X1 V Y1 twin 1

Bivariate Twin Covariance Matrix X1X1 Y1Y1 X1X1 a 11 2 C X1Y1 Y1Y1 C Y1X1 V Y1 twin 1

Bivariate Twin Covariance Matrix X1X1 Y1Y1 X1X1 a 11 2 C X1Y1 Y1Y1 a 21 *a 11 V Y1 twin 1

Bivariate Twin Covariance Matrix X1X1 Y1Y1 X1X1 a 11 2 a 21 *a 11 Y1Y1 V Y1 twin 1

Bivariate Twin Covariance Matrix X1X1 Y1Y1 X1X1 a 11 2 a 21 *a 11 Y1Y1 a a 21 2 twin 1

Bivariate Twin Covariance Matrix X1X1 Y1Y1 X1X1 a e 11 2 a 21 *a 11 + e 21 *e 11 Y1Y1 a a e e 21 2 twin 1

Bivariate Twin Covariance Matrix X1X1 Y1Y1 X2X2 C X2X1 C X2Y1 Y2Y2 C Y2X1 C Y2Y1 twin 1 twin 2

Bivariate Twin Covariance Matrix X1X1 Y1Y1 X2X2 1/0.5 * a 11 2 C X2Y1 Y2Y2 C Y2X1 C Y2Y1 twin 1 twin 2

Bivariate Twin Covariance Matrix X1X1 Y1Y1 X2X2 1/0.5 * a 11 2 C X2Y1 Y2Y2 1/0.5 * a 21 *a 11 C Y2Y1 twin 2 twin 1

Bivariate Twin Covariance Matrix X1X1 Y1Y1 X2X2 1/0.5 * a /0.5 * a 21 *a 11 Y2Y2 C Y2Y1 twin 2 twin 1

Bivariate Twin Covariance Matrix X1X1 Y1Y1 X2X2 1/0.5* a /0.5 * a 21 *a 11 Y2Y2 1/0.5 *a /0.5 *a 21 2 twin 2 twin 1

Bivariate Twin Covariance Matrix X1X1 Y1Y1 X2X2 Y2Y2 X1X1 V X1 C X1Y1 C X1X2 C X1Y2 Y1Y1 C Y1X1 V Y1 C Y1X2 C Y1Y2 X2X2 C X2X1 C X2Y1 V X2 C X2Y2 Y2Y2 C Y2X1 C Y2Y1 C Y2X2 V Y2 twin 1 twin 2

Predicted Twin Covariance Matrix X1X1 Y1Y1 X2X2 Y2Y2 X1X1 a e 11 2 a 21 *a 11 + e 21 *e 11 1/0.5* a /0.5 * a 21 *a 11 Y1Y1 a 21 *a 11 + e 21 *e 11 a a e e /0.5 * a 21 *a 11 1/0.5*a /0.5*a 21 2 X2X2 1/0.5* a /0.5 * a 21 *a 11 a e 11 2 a 21 *a 11 + e 21 *e 11 Y2Y2 1/0.5 * a 21 *a 11 1/0.5*a /0.5*a 21 2 a 21 *a 11 + e 21 *e 11 a a e e 21 2 twin 1 twin 2

Predicted MZ Twin Covariance X1X1 Y1Y1 X2X2 Y2Y2 X1X1 a e 11 2 a 21 *a 11 + e 21 *e 11 a 11 2 a 21 *a 11 Y1Y1 a 21 *a 11 + e 21 *e 11 a a e e 21 2 a 21 *a 11 a a 21 2 X2X2 a 11 2 a 21 *a 11 a e 11 2 a 21 *a 11 + e 21 *e 11 Y2Y2 a 21 *a 11 a a 21 2 a 21 *a 11 + e 21 *e 11 a a e e 21 2 twin 1 twin 2

Predicted DZ Twin Covariance X1X1 Y1Y1 X2X2 Y2Y2 X1X1 a e 11 2 a 21 *a 11 + e 21 *e *a *a 21 *a 11 Y1Y1 a 21 *a 11 + e 21 *e 11 a a e e *a 21 *a *a * a 21 2 X2X2 0.5*a *a 21 *a 11 a e 11 2 a 21 *a 11 + e 21 *e 11 Y2Y2 0.5*a 21 *a *a * a 21 2 a 21 *a 11 + e 21 *e 11 a a e e 21 2 twin 1 twin 2

Predicted Covariance Matrix X1X1 Y1Y1 X2X2 Y2Y2 X1X1 V X1 C X1Y1 C X1X2 C X1Y2 Y1Y1 C Y1X1 V Y1 C Y1X2 C Y1Y2 X2X2 C X2X1 C X2Y1 V X2 C X2Y2 Y2Y2 C Y2X1 C Y2Y1 C Y2X2 V Y2 twin 1 twin 2 Variances of X & Y same across twins and zygosity groups Variances of X & Y same across twins and zygosity groups

Predicted Covariance Matrix X1X1 Y1Y1 X2X2 Y2Y2 X1X1 V X1 C X1Y1 C X1X2 C X1Y2 Y1Y1 C Y1X1 V Y1 C Y1X2 C Y1Y2 X2X2 C X2X1 C X2Y1 V X2 C X2Y2 Y2Y2 C Y2X1 C Y2Y1 C Y2X2 V Y2 twin 1 twin 2 Covariances of X & Y same across twins and zygosity groups Covariances of X & Y same across twins and zygosity groups

Predicted Covariance Matrix X1X1 Y1Y1 X2X2 Y2Y2 X1X1 V X1 C X1Y1 C X1X2 C X1Y2 Y1Y1 C Y1X1 V Y1 C Y1X2 C Y1Y2 X2X2 C X2X1 C X2Y1 V X2 C X2Y2 Y2Y2 C Y2X1 C Y2Y1 C Y2X2 V Y2 twin 1 twin 2 Cross-Twin Within- Trait Covariances differ by zygosity

Predicted Covariance Matrix X1X1 Y1Y1 X2X2 Y2Y2 X1X1 V X1 C X1Y1 C X1X2 C X1Y2 Y1Y1 C Y1X1 V Y1 C Y1X2 C Y1Y2 X2X2 C X2X1 C X2Y1 V X2 C X2Y2 Y2Y2 C Y2X1 C Y2Y1 C Y2X2 V Y2 twin 1 twin 2 Cross-Twin Cross- Trait Covariances differ by zygosity

OpenMx Specification X1X1 Y1Y1 X2X2 Y2Y2 X1X1 V X1 C X1Y1 C X1X2 C X1Y2 Y1Y1 C Y1X1 V Y1 C Y1X2 C Y1Y2 X2X2 C X2X1 C X2Y1 V X2 C X2Y2 Y2Y2 C Y2X1 C Y2Y1 C Y2X2 V Y2 OpenMx script

Read in and Transform Variable(s) transform variables to make variances with similar order of magnitudes # Load Data data(twinData) describe(twinData) twinData[,'ht1'] <- twinData[,'ht1']*10 twinData[,'ht2'] <- twinData[,'ht2']*10 twinData[,'wt1'] <- twinData[,'wt1']/10 twinData[,'wt2'] <- twinData[,'wt2']/10 # Select Variables for Analysis Vars <- c('ht','wt') nv <- 2 # number of variables ntv <- nv*2 # number of total variables selVars <- paste(Vars,c(rep(1,nv),rep(2,nv)),sep="") #c('ht1','wt1,'ht2','wt2') # Select Data for Analysis mzData <- subset(twinData, zyg==1, selVars) dzData <- subset(twinData, zyg==3, selVars)

# Set Starting Values svMe <- c(15,5) # start value for means laMe <- paste(selVars,"Mean",sep="_") svPa <-.6 # start value for parameters svPas <- diag(svPa,nv,nv) laA <- paste("a",rev(nv+1-sequence(1:nv)),rep(1:nv,nv:1),sep="") # c("a11","a21","a22") laD <- paste("d",rev(nv+1-sequence(1:nv)),rep(1:nv,nv:1),sep="") laC <- paste("c",rev(nv+1-sequence(1:nv)),rep(1:nv,nv:1),sep="") laE <- paste("e",rev(nv+1-sequence(1:nv)),rep(1:nv,nv:1),sep="") Start Values, Labels Means & Parameters create numbered labels to fill the lower triangular matrices with the first number corresponding to the variable being pointed to and the second number corresponding to the factor

Within-Twin Covariance [A] Path Tracing:Matrix Algebra: Lower 2x2 A 1 A 2 P1P2P1P2

# Matrices declared to store a, c, and e Path Coefficients pathA <- mxMatrix( type="Lower", nrow=nv, ncol=nv, free=T, values=svPas, label=laA, name="a" ) pathD <- mxMatrix( type="Lower", nrow=nv, ncol=nv, free=T, values=svPas, label=laD, name="d" ) pathC <- mxMatrix( type="Lower", nrow=nv, ncol=nv, free=F, values=0, label=laC, name="c" ) pathE <- mxMatrix( type="Lower", nrow=nv, ncol=nv, free=T, values=svPas, label=laE, name="e" ) # Matrices generated to hold A, C, and E computed Variance Components covA <- mxAlgebra( expression=a %*% t(a), name="A" ) covD <- mxAlgebra( expression=d %*% t(d), name="D" ) covC <- mxAlgebra( expression=c %*% t(c), name="C" ) covE <- mxAlgebra( expression=e %*% t(e), name="E" ) Path Coefficients Variance Components regular multiplication of lower triangular matrix and its transpose A 1 A 2 P1P2P1P2 a %*% t(a)

Within-Twin Covariance [A]+[E] + using matrix addition to generate total within-twin covariance

# Algebra to compute total variances and standard deviations (diagonal only) covP <- mxAlgebra( expression=A+D+C+E, name="V" ) matI <- mxMatrix( type="Iden", nrow=nv, ncol=nv, name="I") invSD <- mxAlgebra( expression=solve(sqrt(I*V)), name="iSD") # Algebras generated to hold Parameter Estimates and Derived Variance Components rowVars <- rep('vars',nv) colVars <- rep(c('A','D','C','E','SA','SD','SC','SE'),each=nv) estVars <- mxAlgebra( cbind(A,D,C,E,A/V,D/V,C/V,E/V), name="Vars", dimnames=list(rowVars,colVars)) Total Variances Variance Components each of covariance matrices is of size nv x nv

Cross-Twin Covariances [A] & 0.5[A] + using Kronecker product to multiple every element of matrix by scalar

# Algebra for expected Mean and Variance/Covariance Matrices in MZ & DZ twins meanG <- mxMatrix( type="Full", nrow=1, ncol=nv, free=T, values=svMe, labels=laMe, name="Mean" ) meanT <- mxAlgebra( cbind(Mean,Mean), name="expMean" ) covMZ <- mxAlgebra( rbind( cbind(V, A+D+C), cbind(A+D+C, V )), name="expCovMZ" ) covDZ <- mxAlgebra( rbind( cbind(V, 0.5%x%A+0.25%x%D+C), cbind(0.5%x%A+0.25%x%D+C, V )), name="expCovDZ" ) Expected Means & Covariances cbind creates two nv x ntv row matrices rbind turns them into to ntv x ntv matrix

# Data objects for Multiple Groups dataMZ <- mxData( observed=mzData, type="raw" ) dataDZ <- mxData( observed=dzData, type="raw" ) # Objective objects for Multiple Groups objMZ <- mxFIMLObjective( covariance="expCovMZ", means="expMean", dimnames=selVars ) objDZ <- mxFIMLObjective( covariance="expCovDZ", means="expMean", dimnames=selVars ) # Combine Groups pars <- list( pathA, pathD, pathC, pathE, covA, covD, covC, covE, covP, matI, invSD, estVars, meanG, meanT ) modelMZ <- mxModel( pars, covMZ, dataMZ, objMZ, name="MZ" ) modelDZ <- mxModel( pars, covDZ, dataDZ, objDZ, name="DZ" ) minus2ll <- mxAlgebra( expression=MZ.objective + DZ.objective, name="m2LL" ) obj <- mxAlgebraObjective( "m2LL" ) BivAceModel <- mxModel( "BivACE", pars, modelMZ, modelDZ, minus2ll, obj ) Data, Objectives & Model Objects expected covariances and meansobserved data

# Run Bivariate ACE model BivAceFit <- mxRun(BivAceModel) BivAceSum <- summary(BivAceFit) BivAceSum$pa BivAceSum$Mi # Generate Output with Functions source("GenEpiHelperFunctions.R") parameterSpecifications(BivAceFit) expectedMeansCovariances(BivAceFit) tableFitStatistics(BivAceFit) Parameter Estimates Variance Components two ways to get parameter estimates print pre-calculated unstandardized variance components and standardized variance components

Three Important Results from Bivariate Genetic Analysis 1. Variance Decomposition -> Heritability, (Shared) environmental influences 2. Covariance Decomposition -> The influences of genes and environment on the covariance between the two variables “How much of the phenotypic correlation is accounted for by genetic and environmental influences?” 3. Genetic and Environmental correlations -> the overlap in genes and environmental effects “Is there a large overlap in genetic/ environmental factors?

From Cholesky to Genetic Correlation standardized solution = correlated factors solution

Genetic Covariance to Genetic Correlation calculated by dividing genetic covariance by square root of product of genetic variances of two variables

# Calculate genetic and environmental correlations corA <- mxAlgebra( expression=solve(sqrt(I*A))%&%A), name ="rA" ) corD <- mxAlgebra( expression=solve(sqrt(I*D))%&%E), name ="rD" ) corC <- mxAlgebra( expression=solve(sqrt(I*C))%&%C), name ="rC" ) corE <- mxAlgebra( expression=solve(sqrt(I*E))%&%E), name ="rE" ) Genetic Correlation Algebra

72 Contribution to Phenotypic Correlation if rg=1, then two sets of genes overlap completely if however, a11 and a22 are near to zero, genes do not contribute much to phenotypic correlation contribution to phenotypic correlation is function of both heritabilities and rg

Interpreting Results High genetic correlation = large overlap in genetic effects on the two phenotypes Does it mean that the phenotypic correlation between the traits is largely due to genetic effects? No: the substantive importance of a particular r G depends the value of the correlation and the value of the  A 2 paths i.e. importance is also determined by the heritability of each phenotype

Interpretation of Correlations Consider two traits with a phenotypic correlation (r P ) of 0.40 : h 2 P1 = 0.7 and h 2 P2 = 0.6 with r G =.3 Correlation due to additive genetic effects = ? Proportion of phenotypic correlation attributable to additive genetic effects = ? h 2 P1 = 0.2 and h 2 P2 = 0.3 with r G = 0.8 Correlation due to additive genetic effects = ? Proportion of phenotypic correlation attributable to additive genetic effects = ? Correlation due to A: Divide by r P to find proportion of phenotypic correlation.

Bivariate CholeskyMultivariate Cholesky