! SCRIPT NAME : lingrow.mx (jh) ! GOAL : To evaluate bivariate linear growth curve model for heritability estimation of latent variables: intercept and slope ! DATA : continuous ! INPUT : raw data ! UNI/BI/MULTI : uni (longitudinal observations) ! DATA-GROUPS : MZ, DZ-SS ! MEANS MODEL : grand mean, sex effect ! VARIANCE COVARIANCE MODEL(S) : 1.ACE , 2.ACE orthogonal, 3. AE, 4. ADE ! Downloading Mx software: ! Mx script's library: ! GenomEUtwin lingrow.mx ! ! Script for the analysis of (simulated) univariate ! continuous longitudinal twin data in wave representation. ! ! Model: Linear growthcurve model. ! Biometric model (ACE) for slopes and intercepts. #define NT 4 ! number of timepoints. #define NF 2 ! number of factors. GROUP #1 Initialization CALCULATION NG=3 BEGIN MATRICES; !Matrices for phenotypic part of model F FULL NT 2 FIXED ! matrix of factor loadings R DI NT NT FREE ! residual variance. H FULL 1 1 FIXED ! DZ GENETIC R=.5 Q FULL NF 1 FREE ! mean intercept & slope N FULL 1 NT FREE ! Effect of covariate !Matrices for variance decomposition of intercept & slope X LOWER NF NF FREE ! cholesky factor for genetic (co)variance of Y LOWER NF NF FREE ! cholesky factor for variance due to shared covariance of Z LOWER NF NF FREE ! cholesky factor for variance due to non-shared environment of END MATRICES; MATRIX H .5 MATRIX F !Factor loadings of slope correspond to years 91, 95, 97 & 2000 1 0 1 2 1 3 1 4.5 Specify R 100 200 300 400 !Residuals equal for tw1 and tw2 BEGIN ALGEBRA; A = X*X'; C = Y*Y'; E = Z*Z'; K = ( A%(A+C+E) | C%(A+C+E) | E%(A+C+E) ); M = A+C+E | A+C _ A+C | A+C+E; ! covariance matrix of intercept and slope for mz pair S = A+C+E | H@A+C _ H@A+C | A+C+E; ! covariance matrix of intercept and slope for dz pair P = \stnd(A) | \stnd(C) | \stnd(E); END ALGEBRA; ST -.5 N 1 1 - N 1 NT ST 10 Q 1 1 ST -1 Q 2 1 ST 5 R 1 1 R 2 2 R 3 3 R 4 4 ST 1.5 X 1 1 Y 1 1 Z 1 1 ST .3 X 2 2 Y 2 2 Z 2 2 ST -.3 X 2 1 Y 2 1 Z 2 1 END GROUP #2 Mz twins Data NInput_vars= 21 ! nr of inputvars per family Missing=-1.00 REctangular file=aggression.dat LABELS id TWZYG ZYG2 NYAGG1.1 NYAGG3.1 NYAGG4.1 NYAGG5.1 NYAGG1.2 NYAGG3.2 NYAGG4.2 NYAGG5.2 AGE1.1 AGE3.1 AGE4.1 AGE5.1 AGE1.2 AGE3.2 AGE4.2 AGE5.2 AGE91.1 AGE91.2 ! tell Mx what is found in the datafile Select if zyg2 = 1; Select NYAGG1.1 NYAGG3.1 NYAGG4.1 NYAGG5.1 NYAGG1.2 NYAGG3.2 NYAGG4.2 NYAGG5.2 AGE1.1 AGE3.1 AGE4.1 AGE5.1 AGE1.2 AGE3.2 AGE4.2 AGE5.2; Definition AGE1.1 AGE3.1 AGE4.1 AGE5.1 AGE1.2 AGE3.2 AGE4.2 AGE5.2; BEGIN MATRICES; F FULL NT NF =F1 !FACTOR LOADINGS M COMPUTED =M1 !MZ COVARIANCE MATRIX BETWEEN I AND S R DI NT NT =R1 !RESIDUAL VARIANCES Q FULL NF 1 =Q1 !FACTOR MEANS N FULL 1 NT =N1 ! Effect of covariate K FULL 1 NT !COVARIATE FOR TWIN 1 (TIME VARYING) L FULL 1 NT !COVARIATE FOR TWIN 2 (TIME VARYING) I IDEN 2 2 END MATRICES; Specify K AGE1.1 AGE3.1 AGE4.1 AGE5.1 Specify L AGE1.2 AGE3.2 AGE4.2 AGE5.2 MEANS (F*Q)' + K.N | (F*Q)'+ L.N ; COVARIANCE (I@F)&M + (I@R) ; OPTIONS RS END GROUP #3 Dz twins Data NInput_vars= 21 ! nr of inputvars per family Missing=-1.00 REctangular file=aggression.dat LABELS id TWZYG ZYG2 NYAGG1.1 NYAGG3.1 NYAGG4.1 NYAGG5.1 NYAGG1.2 NYAGG3.2 NYAGG4.2 NYAGG5.2 AGE1.1 AGE3.1 AGE4.1 AGE5.1 AGE1.2 AGE3.2 AGE4.2 AGE5.2 AGE91.1 AGE91.2 ! tell Mx what is found in the datafile Select if zyg2 = 2; Select NYAGG1.1 NYAGG3.1 NYAGG4.1 NYAGG5.1 NYAGG1.2 NYAGG3.2 NYAGG4.2 NYAGG5.2 AGE1.1 AGE3.1 AGE4.1 AGE5.1 AGE1.2 AGE3.2 AGE4.2 AGE5.2; Definition AGE1.1 AGE3.1 AGE4.1 AGE5.1 AGE1.2 AGE3.2 AGE4.2 AGE5.2; BEGIN MATRICES; F FULL NT NF =F1 !FACTOR LOADINGS S COMPUTED =S1 !DZ COVARIANCE MATRIX BETWEEN I AND S R DI NT NT =R1 !RESIDUAL VARIANCES Q FULL NF 1 =Q1 !FACTOR MEANS N FULL 1 NT =N1 ! Effect of covariate K FULL 1 NT !COVARIATE FOR TWIN 1 (TIME VARYING) L FULL 1 NT !COVARIATE FOR TWIN 2 (TIME VARYING) I IDEN 2 2 END MATRICES; Specify K AGE1.1 AGE3.1 AGE4.1 AGE5.1 Specify L AGE1.2 AGE3.2 AGE4.2 AGE5.2 MEANS (F*Q)' + K.N | (F*Q)'+ L.N ; COVARIANCE (I@F)&S + (I@R) ; !OPTIONS MULTIPLE RS issat END SAVE LINGROW.MXS /* !TEST GENETIC EFFECTS ON INTERCEPT & SLOPE !On the covariance i-s DROP * * * * end !On the Intercept DROP * * * * end !On the Slope DROP * * * * end */