! SCRIPT NAME : TwinsOnly.mx ! GOAL : To evaluate best model for variance components ! DATA : continuous ! INPUT : raw data ! UNI/BI/MULTI : uni ! DATA-GROUPS : MZ DZ ! MEANS MODEL : grand mean ! VARIANCE COVARIANCE MODEL(S) ACE ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! #define nvar 1 ! For every instance of the word nvar in the script, ! Mx reads 1. This corresponds to one phenotype to be analysed G1: calculation group Data Calc NGroups=3 Begin matrices; X Lower nvar nvar Free ! additive genetic path coefficient (standard deviation) Y Lower nvar nvar Free ! common environmental path coefficient (standard deviation) Z Lower nvar nvar Free ! unique environmental path coefficient (standard deviation) H Full 1 1 fix ! .5 for dz cov A G Full 1 nvar free ! grand mean phenotypes 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; st -.8 G 1 1 1 st 10 X 1 1 1 - X 1 nvar nvar st 1 Y 1 1 1 - Y 1 nvar nvar st 8 Z 1 1 1 - Z 1 nvar nvar end G2: MZ twins, datagroup Data NInput_vars=34 Missing=-200.00 REctangular file=mriiq.rec LABELS famnr zyg sex1 age1 wmem1 grey1 sex2 age2 wmem2 grey2 sex3 age3 wmem3 grey3 sex4 age4 wmem4 grey4 sex5 age5 wmem5 grey5 sex6 age6 wmem6 grey6 sex7 age7 wmem7 grey7 sex8 age8 wmem8 grey8 select if zyg < 3 ; ! Zyg = 1=mzm, 2=mzf, 3=dzm, 4=dzf, 5=dos select wmem1 wmem2 ; Matrices = Group 1 End Matrices Means G | G ; ! model for means, assuming grand mean twin 1 = grand mean twin 2 Covariances ! model for MZ variance/covariances A+C+E | A+C _ A+C | A+C+E ; Options RSiduals End G3: DZ twins, datagroup Data NInput_vars=34 Missing=-200.00 REctangular file=mriiq.rec LABELS famnr zyg sex1 age1 wmem1 grey1 sex2 age2 wmem2 grey2 sex3 age3 wmem3 grey3 sex4 age4 wmem4 grey4 sex5 age5 wmem5 grey5 sex6 age6 wmem6 grey6 sex7 age7 wmem7 grey7 sex8 age8 wmem8 grey8 select if zyg > 2 ; ! Zyg = 1=mzm, 2=mzf, 3=dzm, 4=dzf, 5=dos select wmem1 wmem2 ; Matrices = Group 1 End Matrices Means G | G; ! model for means, assuming grand mean twin 1 = grand mean twin 2 Covariances ! model for MZ variance/covariances A+C+E | H@A+C _ H@A+C | A+C+E ; Options RSiduals !Interval @95 V 1 1 1 V 1 1 2 V 1 1 3 End