!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 ! Fit the wrong model to the simulated data: rg=1 ! Use the constraint option in Mx to constrain the genetic correlation at 1 G1: model parameters Data Calc NGroups=4 Begin Matrices; X Lower 2 2 Fr ! genetic structure Y Lower 2 2 Fr ! common environmental structure Z Lower 2 2 Fr ! specific environmental structure I full 2 2 Fi ! to be used in constraint group End Matrices; Start .3 X 1 1 1 X 1 2 2 Start .1 Y 1 1 1 Y 1 2 2 Start .5 Z 1 1 1 Z 1 2 2 Begin Algebra; A= X*X' ; C= Y*Y' ; E= Z*Z' ; k=\stnd(X*X'); ! genetic correlation (used in the constraint) l=\stnd(C); ! common E correlation m=\stnd(E); ! unique E correlation End Algebra; matrix I 1 0 0 1 ! I has '1' on the diagonal and off-diagonal elements End G2: MZ twin pairs Data NInput_vars=4 NObservations=100 CMatrix Full File=mzsim.cov Matrices= Group 1 Covariances A+C+E | A+C _ A+C | A+C+E / Option RSiduals End G3: DZ twin pairs Data NInput_vars=4 NObservations=100 CMatrix Full File=dzsim.cov Matrices= Group 1 H Full 1 1 Covariances A+C+E | H@A+C _ H@A+C | A+C+E / Matrix H .5 Options RSiduals Power= .05,1 ! .05 sig level & 1 df End G4: CONSTRAINT GROUP TO ENSURE genet corr=1 CONSTRAINT_GROUP MATRICES = group 1 CO I - K ; !constraint value should be zero Option rs End