! SCRIPT NAME : ctSATut2.mx (cb) ! GOAL : To calculate tetrachoric correlations ! DATA : ordinal ! INPUT : contingency tables ! UNI/BI/MULTI : uni ! DATA-GROUPS : MZ DZ ! MEANS MODEL : - ! VARIANCE COVARIANCE MODEL(S) : ! 1. no model ! 2. as 1, plus thresholds same for twin 1 and twin 2 ! 3. as 2, plus thresholds same for MZ and DZ ! ! Downloading Mx software: http://www.vcu.edu/mx ! Mx script's library: http://www.psy.vu.nl/mxbib !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! #define ncat 3 ! number of categories per variable ! this depends on the dimensions of your contingency table! #define nthres 2 ! number of thresholds = ncat - 1 G1: MZ Data NGroups=2 NI=2 CTABLE ncat ncat 368 24 46 26 15 21 54 22 209 Begin Matrices ; R Stand 2 2 Free ; ! this will contain the tetrachoric correlation T Full nthres 2 Free ; ! this will contain nthres thresholds for twin2 (reflects prevalences) L Lower nthres nthres Fixed ; ! this matrix is needed if ntrhres > 1: will be used to make sure that each ! subsequent threshold is larger than the former End Matrices ; Value 1 L 1 1 - L nthres nthres Thresholds L*T; ! row 1: all thresholds of twin 1 ! row 2: all thresholds of twin 2 Covariances R ; ! tetrachoric correlation Start 0.8 R 2 1 Start .1 T 1 1 T 2 1 ! starting values for the thresholds start .2 T 1 2 T 2 2 Bound 0.1 5 T 1 2 T 2 2 Bound -0.999 0.999 R 2 1 End G2: DZ Data NI=2 CTABLE ncat ncat 203 22 63 17 5 16 65 12 133 Begin Matrices ; R Stand 2 2 Free ; T Full nthres 2 Free ; L Lower nthres nthres Fixed ; End Matrices ; Value 1 L 1 1 - L nthres nthres Thresholds L*T ; Covariances R ; Start 0.5 R 2 1 Start .1 T 1 1 T 2 1 ! starting values for the thresholds start .2 T 1 2 T 2 2 Bound 0.1 5 T 1 2 T 2 2 Bound -0.999 0.999 R 2 1 End