!job for Falconer GxE model !first simulate the bivariate data and then analyze the data !next test if the genet corr is different from 1 or 0 !Simulate the data title card: Group 1: model parameters Data Calculation NGroups=3 Begin Matrices; X Lower 2 2 Fixed ! genetic structure Y Lower 2 2 Fixed ! common environmental structure Z Lower 2 2 Fixed ! specific environmental structure End Matrices; Matrix X .50 !genetic correlation is determined by off-diagonal element .20 .45 !and the genetic variances of the two traits Matrix Y .05 .05 0 ! rc is 1 in this model Matrix Z .45 0 .45 ! re is 0 in this model Begin Algebra; A= X*X' ; !genetic variance and covariance C= Y*Y' ; E= Z*Z' ; k=\stnd(A); ! compute genetic correlation l=\stnd(C); ! common E correlation m=\stnd(E); ! unique E correlation End Algebra; End G2: simution for MZ twin pairs Data Calc NInput_vars=4 Matrices= Group 1 Covariances A+C+E | A+C _ A+C | A+C+E / Options MX%E=mzsim.cov ! write the MZ matrix to a file Options rs ! show the MZ matrix End G3: simulation for DZ twin pairs Data Calc NInput_vars=4 Matrices= Group 1 H Full 1 1 Covariances A+C+E | H@A+C _ H@A+C | A+C+E / Matrix H .5 Options MX%E=dzsim.cov Options rs End