! unimf.mx ! ! Univariate Model fitting for ADE, ACE, AE, CE and E ! Raw data ! Child Behavior Checklist, NTR MZM and DZM twins ! ! Mx homepage: http://views.vcu.edu/mx #NGroups 7 #define nvar 1 ! variable AGG or RB, mother rating, at age 10, males #define nsib 2 ! twin-1 & twin-2 G1: Model Parameters Calculation Begin Matrices; X Lower nvar nvar Free ! additive genetic structure Y Lower nvar nvar Free ! common environmental structure Z Lower nvar nvar Free ! specific environmental structure W Lower nvar nvar ! dominance structure H Full 1 1 ! scalar fixed @ .5 Q Full 1 1 ! scalar fixed @ .25 End Matrices; Matrix H .5 Matrix Q .25 Start .5 all ! starting values for all free parameters Begin Algebra; A= X*X' ; ! additive genetic variance C= Y*Y' ; ! common environmental variance E= Z*Z' ; ! specific environmental variance D= W*W' ; ! dominance variance V= A+C+E+D; ! total variance P= A|C|E|D; ! put parameter estimates in one matrix S= P@V~; ! standardized parameter estimates End Algebra; !Interval @95 S 1 1-S 1 3 ! confidence intervals End G2: male MZ twin pairs Data NInput_vars=5 Missing=-1.00 Rectangular File=Agg10.rec Labels ZYG RB10A AGG10A RB10B AGG10B Select if zyg =1 ; ! select MZM twins Select AGG10A AGG10B ; Begin Matrices = Group 1; M Full nsib nvar Free ! means End Matrices; Start 1 M 1 1 M 2 1 Means M ; ! model for means Covariances ! model for covariances A+C+D+E | A+C+D _ A+C+D | A+C+D+E ; Options RSiduals End G3: male DZ twin pairs Data NInput_vars=5 Missing=-1.00 Rectangular File=Agg10.rec Labels ZYG RB10A AGG10A RB10B AGG10B Select if zyg =2 ; ! select DZM twins Select AGG10A AGG10B ; Begin Matrices = Group 1; M Full nsib nvar Free ! means End Matrices; Start 1 M 1 1 M 2 1 Means M ; ! model for means Covariances ! model for covariances A+C+D+E | H@A+C+Q@D _ H@A+C+Q@D | A+C+D+E ; Option RSiduals End G3: Model Parameters Calculation Begin Matrices; X Lower nvar nvar Free ! additive genetic structure Y Lower nvar nvar Free ! common environmental structure Z Lower nvar nvar Free ! specific environmental structure W Lower nvar nvar ! dominance structure H Full 1 1 ! scalar fixed @ .5 Q Full 1 1 ! scalar fixed @ .25 End Matrices; Matrix H .5 Matrix Q .25 Start .5 all ! starting values for all free parameters Begin Algebra; A= X*X' ; ! additive genetic variance C= Y*Y' ; ! common environmental variance E= Z*Z' ; ! specific environmental variance D= W*W' ; ! dominance variance V= A+C+E+D; ! total variance P= A|C|E|D; ! put parameter estimates in one matrix S= P@V~; ! standardized parameter estimates End Algebra; !Interval @95 S 1 1-S 1 3 ! confidence intervals End G5: female MZ twin pairs Data NInput_vars=5 Missing=-1.00 Rectangular File=Agg10.rec Labels ZYG RB10A AGG10A RB10B AGG10B Select if zyg =3 ; ! select MZF twins Select AGG10A AGG10B ; Begin Matrices = Group 4; M Full nsib nvar Free ! means End Matrices; Start 1 M 1 1 M 2 1 Means M ; ! model for means Covariances ! model for covariances A+C+D+E | A+C+D _ A+C+D | A+C+D+E ; Options RSiduals End G6: female twins Data NInput_vars=5 Missing=-1.00 Rectangular File=Agg10.rec Labels ZYG RB10A AGG10A RB10B AGG10B Select if zyg =4 ; ! select DZF twins Select AGG10A AGG10B ; Begin Matrices = Group 4; M Full nsib nvar Free ! means End Matrices; Start 1 M 1 1 M 2 1 Means M ; ! model for means Covariances ! model for covariances A+C+D+E | H@A+C+Q@D _ H@A+C+Q@D | A+C+D+E ; Option RSiduals End G7: DOS m-f twins Data NInput_vars=5 Missing=-1.00 Rectangular File=Agg10.rec Labels ZYG RB10A AGG10A RB10B AGG10B Select if zyg =5 ; ! select DZF twins Select AGG10A AGG10B ; Begin Matrices; X Lower nvar nvar =X1 ! additive genetic structure Y Lower nvar nvar =Y1 ! common environmental structure Z Lower nvar nvar =Z1 ! specific environmental structure W Lower nvar nvar ! dominance structure A Lower nvar nvar =X4 ! additive genetic structure C Lower nvar nvar =Y4 ! common environmental structure E Lower nvar nvar =Z4 ! specific environmental structure D Lower nvar nvar ! dominance structure H Full 1 1 ! scalar fixed @ .5 F Full 1 1 free ! free, for dos cov A Q Full 1 1 ! scalar fixed @ .25 M Full nsib nvar Free ! means End Matrices; Start 1 M 1 1 M 2 1 Means M ; ! model for means Covariances ! model for covariances X*X' + Y*Y' + W*W' + Z*Z' | F@X*A' +Y*C'+Q@W*D' _ F@A*X'+C*Y'+Q@D*W' | A*A'+C*C'+D*D'+E*E' ; Bound 0 .5 F 1 1 Interval @95 F 1 1 Option RSiduals Option Multiple Issat End save full.mxs ! Fix DOS covariance for A at .5 ! This provides a test of whether the same genes are expressed in males and females DROP @.5 F 7 1 1 end !get full.mxs !Check whether ACE males = ACE females !EQ X 1 1 1 X 4 1 1 !EQ Y 1 1 1 Y 4 1 1 !EQ Z 1 1 1 Z 4 1 1 !end