Multiformity model. ! You can express B&A if you are above second threshold on A or ! above the second threshold on B ! A & B are otherwise independent. ! ! Control correlation matrix A factor DA CALC NG=8 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 A 0 Matrix H .5 Option RS End G2 CALCULATION GROUP Clinical Correlation matrix A factor 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 Control correlation matrix B factor DA CALC 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 A 0 Matrix H .5 Option RS End G4 CALCULATION GROUP Clinical Correlation matrix B factor DA CALC MATRICES A Lo 1 1 =A3 C Lo 1 1 =C3 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 Compute predicted control group proportions Data CALC Matrices A Full 2 2 =%E1 ! corr between A factors B Full 2 2 =%E3 ! corr between B factors Q Full 1 1 ! scalar 2.0 R Full 1 1 Free ! Positive Deviation of upper from lower Threshold for A S Full 1 1 Free ! Lower Threshold for A T Full 1 1 Free ! Positive Deviation of upper from lower Threshold for B U Full 1 1 Free ! Lower Threshold for B W Zero 1 2 ! + + These are to control integral type X Zi 1 2 ! + - Z Unit 1 2 ! - - Begin Algebra; C = \muln((A_S|S_S|S_Z)) ; ! lower/lower stripe of A D = \muln((A_S|S+R_S|S_Z+X)) ; ! lower/middle stripe of A E = \muln((A_S+R|S_S+R|S_X)) ; ! lower/upper stripe of A F = \muln((A_S+R|S+R_S|S_Z+Z)) ; ! middle/middle stripe of A G = \muln((A_S+R|S+R_S+R|S_X+X)) ; ! middle/upper stripe of A H = \muln((A_S+R|S+R_S+R|S+R_W)) ; ! upper/upper stripe of A I = \muln((B_U|U_U|U_Z)) ; ! lower/lower stripe of B J = \muln((B_U|T+U_U|U_Z+X)) ; ! lower/middle stripe of B K = \muln((B_T+U|U_T+U|U_X)) ; ! lower/upper stripe of B L = \muln((B_T+U|T+U_U|U_Z+Z)) ; ! middle/middle stripe of B M = \muln((B_T+U|T+U_T+U|U_X+X)) ; ! middle/upper stripe of B N = \muln((B_T+U|T+U_T+U|T+U_W)) ; ! upper/upper stripe of B V = C.I _ Q.(C.J) _ Q.(D.I) _ Q.(E.(I+J+K) + D.(J+K) + C.K) _ C.L _ Q.(D.J) _ Q.(E.(J+L+M) + D.(L+M) + C.M) _ F.I _ Q.(G.(I+J+K) +F.(J+K) + D.K) _ H + N - H.N + G.(J+K+L+M+M) + E.(K+M) + G.(J+L+M+K+M) + F.(L+M+M) + D.M + E.(K+M) + D.M; end algebra; compute V ; Matrix Q 2 Matrix R 1 Matrix S 0 Matrix T 1 Matrix U -1 Option RS End G6 Compute predicted clinical group proportions Data CALC Matrices A Full 2 2 =%E1 ! corr between A factors B Full 2 2 =%E3 ! corr between B factors P Full 1 1 Q Full 1 1 free R Full 1 1 =R5 ! Positive Deviation of upper from lower Threshold for A S Full 1 1 =S5 ! Lower Threshold for A T Full 1 1 =T5 ! Positive Deviation of upper from lower Threshold for B U Full 1 1 =U5 ! Lower Threshold for B W Zero 1 2 ! + + These are to control integral type X Zi 1 2 ! + - Z Unit 1 2 ! - - Begin Algebra; C = \muln((A_S|S_S|S_Z)) ; ! lower/lower stripe of A D = \muln((A_S|S+R_S|S_Z+X)) ; ! lower/middle stripe of A E = \muln((A_S+R|S_S+R|S_X)) ; ! lower/upper stripe of A F = \muln((A_S+R|S+R_S|S_Z+Z)) ; ! middle/middle stripe of A G = \muln((A_S+R|S+R_S+R|S_X+X)) ; ! middle/upper stripe of A H = \muln((A_S+R|S+R_S+R|S+R_W)) ; ! upper/upper stripe of A I = \muln((B_U|U_U|U_Z)) ; ! lower/lower stripe of B J = \muln((B_U|T+U_U|U_Z+X)) ; ! lower/middle stripe of B K = \muln((B_T+U|U_T+U|U_X)) ; ! lower/upper stripe of B L = \muln((B_T+U|T+U_U|U_Z+Z)) ; ! middle/middle stripe of B M = \muln((B_T+U|T+U_T+U|U_X+X)) ; ! middle/upper stripe of B N = \muln((B_T+U|T+U_T+U|T+U_W)) ; ! upper/upper stripe of B V = p.(C.J) _ q.(D.I) _ (p+q).(E.(I+J+K) + D.(J+K) + C.K) _ p.(C.L) _ (p+q).(D.J) _ ((p+q)+p).(E.(J+L+M) + D.(L+M) + C.M) _ q.F.I _ (q+(p+q)).(G.(I+J+K) +F.(J+K) + D.K) _ (p+q).(H + N - H.N + G.(J+K+L+M+M) + E.(K+M) + G.(J+L+M+K+M) + F.(L+M+M) + D.M + E.(K+M) + D.M); end algebra; compute V ; Start 1 R 1 1 T 1 1 Start 0 S 1 1 U 1 1 bound 0 5 7 Option RS Matrix P 1 !matrix Q 10.61 End G7 Fit model to control group data Data No=1 NI=1 Matrices O Full 10 1 ! observed data Y Full 1 1 ! Sample size K Full 10 1 =%E5 begin algebra; M = \sum(K); U = M_M_M_M_M_M_M_M_M_M; L = Y@(K%U) ; end algebra; compute \sum((L-O).(L-O)%L) ; Matrix O 244 21 21 15 2 3 1 0 3 3 Matrix Y 313 Option func=.000001 Option RS User-def End G8 Fit model to clinical group data Data No=1 NI=1 Matrices O Full 9 1 ! observed data Y Full 1 1 ! Sample size K Full 9 1 =%E6 ! predicted clinical group proportions begin algebra; M = \sum(K); N = M_M_M_M_M_M_M_M_M; L = Y@(K%N) ; end algebra; compute \sum((L-O).(L-O)%L) ; Matrix O 67 17 79 5 5 20 3 6 10 Matrix Y 212 Bound 0 1 1 2 Bound -2 3 4 6 Bound 0 3 3 5 Option func=.000001 Option RS User-def th=-2 Option multiple Option Th=-30 Start .8 all End !Save multiform.mxs ! multiformity of first variable only, anxiety !Drop @3 7 !End !Get multiform.mxs ! multiformity of second variable, depression !Drop @3 5 !End