G1 Alternate forms model ! ! If you are above threshold on L, you get disorder A with prob p ! If you are above threshold on L, you get disorder B with prob r ! Note: (q=1-p and s=1-r). ! If you are below threshold on L you are immune to A&B ! ! control group correlation matrix DA CALC NG=4 MATRICES A Lo 1 1 Fixed C Lo 1 1 Free H fu 1 1 I id 1 1 begin algebra; X = A*A' ; Y = C*C' ; end algebra; COMPUTE I|H@X+Y_ H@X+Y|I; Matrix H .5 Matrix A 0 Option RS SE End G2 CALCULATION GROUP clinical group correlation matrix DA CALC MATRICES A Lo 1 1 =A1 C Lo 1 1 =C1 H fu 1 1 I id 1 1 begin algebra; X = A*A' ; Y = C*C' ; end algebra ; COMPUTE I|H@X+Y_ H@X+Y|I ; Matrix H .5 Option RS End G3 Evaluate model control group Data NI=6 ordinal fi=control.dat Labels age1 age2 sex1 sex2 type dummy Definition_variables age1 age2 sex1 sex2 type / Matrices A Full 2 2 = %E1 ! corr between A factors I Iden 1 1 P Full 1 1 free! probability of getting A if above threshold R Full 1 1 free! probability of getting B if above threshold H Full 1 2 ! matrix for age definition variable Y Full 1 2 ! matrix for sex definition variable L Full 1 2 ! estimated threshold for A O Full 1 2 ! age difference in threshold N Full 1 2 ! sex difference in threshold M Full 1 1 ! mean of dummy variable V Full 1 1 ! variance of dummy variable J Full 4 1 ! for extracting right part of K W Full 1 1 ! 0 + + These are to control integral type Z Full 1 1 ! 1 - - Begin Algebra; T = L+(H.O)+(Y.N); ! Threshold = estimated threshold + (age * age difference in threshold) + (sex * sex difference in threshold) D = \muln((A_T_T_Z|Z)) ; !lower/lower (sibling 1 and sibling 2 are below threshold) E = \muln((A_T_T_Z|W)) ; !lower/upper (sibling 1 is below threshold and sibling 2 is above threshold) F = \muln((A_T_T_W|Z)) ; !upper/lower (sibling 1 is above threshold and sibling 2 is below threshold) G = \muln((A_T_T_W|W)) ; !upper/upper (sibling 1 and sibling 2 are above threshold) Q = I - P; S = I - R; K = D + F.Q.S + E.Q.S + G.Q.Q.S.S_ ! 1 (expected probability of 0000) F.R.Q + G.R.Q.Q.S_ ! 2 (expected probability of 0100) E.R.Q + G.R.Q.Q.S_ ! 3 (expected probability of 0001) F.P.S + G.P.Q.S.S_ ! 4 (expected probability of 1000) E.P.S + G.P.Q.S.S_ ! 5 (expected probability of 0010) F.P.R + G.P.R.Q.S_ ! 6 (expected probability of 1100) E.P.R + G.P.R.Q.S_ ! 7 (expected probability of 0011) G.R.R.Q.Q_ ! 8 (expected probability of 0101) G.P.R.Q.S_ ! 9 (expected probability of 1001) G.P.R.Q.S_ ! 10 (expected probability of 0110) G.P.R.R.Q_ ! 11 (expected probability of 1101) G.P.R.R.Q_ ! 12 (expected probability of 0111) G.P.P.S.S_ ! 13 (expected probability of 1010) G.P.P.R.S_ ! 14 (expected probability of 1110) G.P.P.R.S_ ! 15 (expected probability of 1011) G.P.P.R.R; ! 16 (expected probability of 1111) end algebra; Matrix J 1 1 1 1 Matrix M 0 Matrix V .159154943 Matrix P .5 Matrix R .5 Matrix W 0 Matrix Z 1 Specify L 100 100 Specify O 101 101 Specify N 102 102 Matrix L 1.5 1.5 SP H age1 age2; SP Y sex1 sex2; SP J -5 0 -5 0; Means M; Covariance V; Weight (\part(K,J)) / !Option user-defined RS Option RS End G4 Evaluate model clinical group Data NI=6 ordinal fi=clinical.dat Labels age1 age2 sex1 sex2 type dummy Definition_variables age1 age2 sex1 sex2 type / Matrices A Full 2 2 = %E2 ! corr between A factors, DZ I Iden 1 1 P Full 1 1 =P3! probability of getting A if above thresh R Full 1 1 =R3! probability of getting B if above thresh H Full 1 2 ! matrix for age definition variable Y Full 1 2 ! matrix for sex definition variable L Full 1 2 =L3! estimated threshold for A O Full 1 2 =O3! age difference in threshold N Full 1 2 =N3! sex difference in threshold M Full 1 1 ! mean of dummy variable V Full 1 1 ! variance of dummy variable J Full 4 1 ! for extracting right part of K W Full 1 1 ! 0 + + These are to control integral type Z Full 1 1 ! 1 - - b full 1 1 ! ascertainment parameter for illicit drug dependence c full 1 1 free ! ascertainment parameter for alcohol dependence Begin Algebra; T = L+(H.O)+(Y.N); D = \muln((A_T_T_Z|Z)) ; !lower/lower E = \muln((A_T_T_Z|W)) ; !lower/upper F = \muln((A_T_T_W|Z)) ; !upper/lower G = \muln((A_T_T_W|W)) ; !upper/upper Q = I - P; S = I - R; K = b.(F.R.Q + G.R.Q.Q.S)_ ! 2 (expected probability of 0100) c.(F.P.S + G.P.Q.S.S)_ ! 4 (expected probability of 1000) (b+c).(F.P.R + G.P.R.Q.S)_ ! 6 (expected probability of 1100) b.(G.R.R.Q.Q)_ ! 8 (expected probability of 0101) c.(G.P.R.Q.S)_ ! 9 (expected probability of 1001) b.(G.P.R.Q.S)_ ! 10 (expected probability of 0110) (b+c).(G.P.R.R.Q)_ ! 11 (expected probability of 1101) b.(G.P.R.R.Q)_ ! 12 (expected probability of 0111) c.(G.P.P.S.S)_ ! 13 (expected probability of 1010) (b+c).(G.P.P.R.S)_ ! 14 (expected probability of 1110) c.(G.P.P.R.S)_ ! 15 (expected probability of 1011) (b+c).(G.P.P.R.R); ! 16 (expected probability of 1111) end algebra; Matrix J 1 1 1 1 Matrix M 0 Matrix V .159154943 Matrix W 0 Matrix Z 1 Matrix b 1 Matrix c .5 SP H age1 age2; SP Y sex1 sex2; SP J -5 0 -5 0; Means M; Covariance V; Weight (\part((K%(\sum(K)_ \sum(K)_ \sum(K)_ \sum(K)_ \sum(K)_ \sum(K)_ \sum(K)_ \sum(K)_ \sum(K)_ \sum(K)_ \sum(K)_ \sum(K))),J)) / Option RS Option Th=-3 End