! Script for estimating tetrachoric correlations : correlation between two dichotomised variables using freq weights ! 2 categories: 1 Threshold per variable, one for twin1 and one for twin2 ! 0 = bottom 88% (non-agressive) ! 1 = top 12% (agressive) ! Equality in Thresholds are tested across twins within each groups and across zygosity group. ! THRESHOLD MATRIX 1x2 : ! T(1,1) = threshold twin1 ! T(1,2) = threshold twin2 #define nvar 2 ! number of variables #define nthresh 1 ! number of thresholds G1: Data and model for MZ correlation DAta NGroups=2 NInput_vars=4 Missing=. Ordinal File=binF.dat Labels zyg bin1 bin2 freq SELECT IF zyg = 1 SELECT bin1 bin2 freq / DEFINITION freq / BEGIN MATRICES; R STAN 2 2 FREE !Correlation matrix T FULL nthresh nvar FREE !thresh tw1, thresh tw2 L Lower nthresh nthresh F FULL 1 1 End matrices; Value 1 L 1 1 to L nthresh nthresh ! initialize L COV R / !Predicted Correlation matrix for MZ pairs Thresholds L*T / !to ensure t1>t2>t3 etc....... FREQ F / SP F -1 Matrix T 1.2 1.2 !starting values for the thresholds MA R .6 !starting value for the correlation interval @95 R 2 1 !requests the 95%CI for the MZ correlation Option rs END G2: Data and model for DZ correlation DAta NInput_vars=4 Missing=. Ordinal File=binF.dat Labels zyg bin1 bin2 freq SELECT IF zyg = 2 SELECT bin1 bin2 freq / DEFINITION freq / BEGIN MATRICES; R STAN 2 2 FREE !Correlation matrix T FULL nthresh nvar FREE !thresh tw1, thresh tw2 L Lower nthresh nthresh F FULL 1 1 End matrices; Value 1 L 1 1 to L nthresh nthresh ! initialize L COV R / !Predicted Correlation matrix for MZ pairs Thresholds L*T / !to ensure t1>t2>t3 etc....... FREQ F / SP F -1 Matrix T 1.2 1.2 !starting values for the thresholds MA R .6 !starting value for the correlation interval @95 R 2 1 !requests the 95%CI for the MZ correlation Option func=1.E-10 !function precision is less than usual Option rs issat Multiple End Group; Save cor.mxs !this saves the full model so you can make reduced models Get cor.mxs EQ T 1 1 1 T 1 1 2 !constrain TH to be equal across MZ twins (twin1/twin2) end group; Get cor.mxs EQ T 2 1 1 T 2 1 2 !constrain TH to be equal across DZ twins (twin1/twin2) end group; !constrain TH to be equal across twins and zygosity Get cor.mxs EQ T 1 1 1 T 1 1 2 T 2 1 1 T 2 1 2 end group;