! 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. #define NFX2 4 GROUP #1 Initialization CALCULATION NG=3 BEGIN MATRICES; !Matrices for phenotypic part of model F FULL NT NF FIXED ! matrix of factor loadings R DI NT NT FREE ! residual variance. Q FULL NF 1 FREE ! mean intercept & slope N FULL 1 NT FREE ! Effect of covariate !Matrices for variance decomposition of intercept & slope M SYMM NFX2 NFX2 FREE !MZ(Co)Variance matrix of intercepts and slopes of tw1 and tw2 S SYMM NFX2 NFX2 FREE !DZ(Co)Variance matrix of intercepts and slopes of tw1 and tw2 END MATRICES; 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 Specify M 500 600 700 800 900 500 900 810 600 700 Specify S 500 600 700 820 910 500 910 830 600 700 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 10 M 1 1 ST .2 M 2 2 ST -1 M 2 1 ST 5 M 3 1 S 3 1 ST .1 M 4 2 S 4 2 ST -.5 M 4 1 S 4 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 SYM NFX2 NFX2 =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; BEGIN ALGEBRA; A = \STND(M); !MZ CORRELATION MATRIX BETWEEN INTERCEPT & SLOPE END ALGEBRA; 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 SYM NFX2 NFX2 =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; BEGIN ALGEBRA; A = \STND(S); !DZ CORRELATION MATRIX BETWEEN INTERCEPT & SLOPE END ALGEBRA; 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