! Boulder 2003 ! univariate Mx script for the analysis of one continuous phenotype ! using raw data input file ! MZ en DZ twins ! Evaluated models: ACE, AE, CE, E ! Mx homepage: http://views.vcu.edu/mx #define nvar 1 ! For every instance of the word nvar in the script, ! Mx reads 1. This corresponds to one phenotype to be analysed #define twonvar 2 ! twice nvar for defining the mean G1: calculation group Data Calc NGroups=3 Begin matrices; X Lower nvar nvar Free ! additive genetic path coefficient / factor loading Y Lower nvar nvar Free ! common environmental path coefficient / factor loading Z Lower nvar nvar Free ! unique environmental path coefficient / factor loading H Full 1 1 fix ! .5 for dz cov A End matrices; Matrix H .5 ! Matrix H is fixed and contains .5 Begin algebra; A= X*X' ; ! additive genetic variance C= Y*Y' ; ! common environmental variance E= Z*Z' ; ! unique environmental variance V = A%(A+C+E) | C%(A+C+E) | E%(A+C+E) ; !standardized variance components End algebra; start 1.5 X 1 1 1 ! provide starting values start 1.5 Y 1 1 1 start 1.5 Z 1 1 1 end G2: MZ twins, datagroup Data NInput_vars= 14 ! nr of inputvars per family Missing=-1.00 ! missing values = -1.00 REctangular file=all.dat ! read in raw datafile, must be in same directory LABELS ! tell Mx what is found in the datafile nih_id country zygot6 rear ageA sexA ldllnA apoblnA apoelnA ageB sexB ldllnB apoblnB apoelnB Select if country = 1 ; ! select Dutch twins, younger sample (Dorret) Select if zygot6 = 3 ; ! select MZM's Select ldllnA ldllnB ; !select one phenotype per twin member Matrices = group 1 M full nvar twonvar free !matrix for the means End matrices; Means M ; ! model for means Covariances ! model for MZ variance/covariances A+C+E | A+C _ A+C | A+C+E ; st 15 M 1 1 - M nvar twonvar Options RSiduals End G3: DZ twins, datagroup Data NInput_vars= 14 ! nr of inputvars per family Missing=-1.00 ! missing values = -1.00 REctangular file=all.dat ! read in raw datafile, must be in same directory LABELS ! tell Mx what is found in the datafile nih_id country zygot6 rear ageA sexA ldllnA apoblnA apoelnA ageB sexB ldllnB apoblnB apoelnB Select if country = 1 ; ! select Dutch twins, younger sample (Dorret) Select if zygot6 = 4; ! select DZM's Select ldllnA ldllnB ; ! select one phenotype per twin member Matrices = group 1 M full nvar twonvar free !matrix for the means end matrices; Means M; ! model for means Covariances ! model for DZ variance/covariances A+C+E | H@A+C _ H@A+C | A+C+E ; Options RSiduals Option Multiple sat=600.043, 120 ! -2LL of saturated model, will yield chi square for this model ! allows comparison of submodels with present model (ACE) Interval @95 V 1 1 1 V 1 1 2 V 1 1 3 End Save ACE.mxs ! AE model Drop Y 1 1 1 end get ace.mxs !CE model Drop X 1 1 1 end ! E model Drop X 1 1 1 Drop Y 1 1 1 end