! SCRIPT NAME : Twins&6.mx (dp) ! GOAL : To evaluate best model for variance components ! DATA : continuous ! INPUT : raw data ! UNI/BI/MULTI : uni ! DATA-GROUPS : MZ + sibs DZ + sibs ! MEANS MODEL : grand mean ! VARIANCE COVARIANCE MODEL(S) :.ACE ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! #define nvar 1 ! number of dependent variables per individual #define maxsib 8 ! maximum number of family members (including twin pair) #define maxsibminus1 7 G1: calculation group Data Calc NGroups=3 Begin matrices; X Lower nvar nvar Free ! additive genetic parameter Y Lower nvar nvar Free ! common environmental parameter Z Lower nvar nvar Free ! unique environmental parameter G Full 1 nvar free ! grand mean I Unit maxsib 1 Q stand maxsib maxsib ! used for @A mz R stand maxsib maxsib ! used for @A dz S unit maxsib maxsib ! used for @C T ident maxsib maxsib ! used for @E End matrices; !Matrix Q will look like this when maxsib=8 !1 !1 1 !.5 .5 1 !.5 .5 .5 1 !.5 .5 .5 .5 1 !.5 .5 .5 .5 .5 1 !.5 .5 .5 .5 .5 .5 1 !.5 .5 .5 .5 .5 .5 .5 1 !Matrix R will look like this when maxsib=8 !1 !.5 1 !.5 .5 1 !.5 .5 .5 1 !.5 .5 .5 .5 1 !.5 .5 .5 .5 .5 1 !.5 .5 .5 .5 .5 .5 1 !.5 .5 .5 .5 .5 .5 .5 1 value 1 Q 2 1 value .5 Q 3 1 - Q maxsib maxsibminus1 value .5 R 2 1 - R maxsib maxsibminus1 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 Begin algebra; A= X*X' ; ! additive genetic variance C= Y*Y' ; ! common environmental variance E= Z*Z' ; ! unique environmental variance J = I@G ; ! Every element of matrix I is multiplied by matrix G ! gm equal for each fam member, equivalent to G_G_G_G_G_G_G_G V = A%(A+C+E) | C%(A+C+E) | E%(A+C+E) ; End algebra; 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 wmem3 wmem4 wmem5 wmem6 wmem7 wmem8 ; Matrices = Group 1 End Matrices Means J ; Covariances Q@A + S@C + T@E ; Options RSiduals End G3: DZ 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 wmem3 wmem4 wmem5 wmem6 wmem7 wmem8 ; Matrices = Group 1 End Matrices Means J ; Covariances R@A + S@C + T@E ; Options RSiduals !Multiple issat ! Interval @95 V 1 1 1 V 1 1 2 V 1 1 3 ENd