! CCC with age #ngroup 6 Group 1 Compute MZ Correlations Calculation Begin Matrices; A Di 2 2 Free C Di 2 2 Free E Di 2 2 Free B Fu 2 2 I Id 2 2 End Matrices; Specify B ! causal parameter from initiation to progression 0 0 7 0 ! starting values Matrix A .7 .7 Matrix C .5 .5 Matrix E .5 .5 Matrix B 0 0 .4 0 ! parameter bounds Bound 0 1 A 1 1 A 2 2 C 1 1 C 2 2 Begin algebra; X = A*A' ; Y = C*C' ; Z = E*E' ; R = (I@((I-B)~)) & ( X+Y+Z| X+Y _ X+Y| X+Y+Z); End algebra; End group Group 2 Compute DZ Correlation matrix Calculation Begin Matrices=Group 1; H Fu 1 1 ! .5 End Matrices; Matrix H .5 Begin algebra; R = (I@((I-B)~)) &( X+Y+Z| h@X+Y _ h@X+Y| X+Y+Z); End algebra; End Fit model to MZ data Data Ninput=10 Labels zyg agea nicusea nicpc2a canusea canabua nicuseb nicpc2b canuseb canabub Ordinal file=ffpair2.rec Select if zyg = 1 Select agea canusea canabua canuseb canabub ; Definition agea ; Begin matrices; a full 1 1 i zero 1 1 n full 1 1 ! scalar 2.0 o full 9 1 r full 4 4 =R1 ! correlation matrix A1B1A2B2 t full 1 4 ! thresholds abab u full 1 4 ! thresholds abab w zero 1 4 ! means z unit 1 1 end matrices; Specify a agea ! A gets updated with age for each case ! during calculation of covariances and thresholds Matrix n 2 covariance r ; thresholds t+u@a ; option rs end Fit model to DZ data Data Ninput=10 Labels zyg agea nicusea nicpc2a canusea canabua nicuseb nicpc2b canuseb canabub Ordinal file=ffpair2.rec Select if zyg = 2 Select agea canusea canabua canuseb canabub ; Definition agea ; Begin matrices =Group 3; o full 9 1 r full 4 4 =R2 ! correlation matrix A1B1A2B2 End matrices; specify t 10 11 10 11 Matrix t .2 .0 .2 .0 specify a agea specify u 12 13 12 13 matrix u .01 .01 .01 .01 bound -.05 .05 u 1 1 U 1 2 bound -2 3 10 11 Covariance r ; Thresholds t + u@a; End Group 5 - constrain variances = 1 Constraint Ni=1 Begin Matrices = Group 1 U unit 1 2 V iz 4 2 End Matrices; Constraint U = \d2v(R)*V ; End Group 6 - standardize estimates Data calc Begin Matrices; A Di 2 2 = A1 C Di 2 2 = C1 E Di 2 2 = E1 B Fu 2 2 = B1 I Id 2 2 H Fu 1 1 ! .5 J iden 4 4 End Matrices; Begin algebra; X = A*A' ; Y = C*C' ; Z = E*E' ; K = I@((I-B)~); L = \v2d(\sqrt(\d2v((I@((I-B)~))*( X+Y+Z| X+Y _ X+Y| X+Y+Z)* (I@((I-B)~)')))); M = L~*K*L; R = \d2v(X+Y+Z); S = ((\d2v(X))%R)_((\d2v(Y))%R)_((\d2v(Z))%R); End algebra; Labels row S A_A A_B C_A C_B E_A E_B labels row L MZT1Abeta MZT1Bbeta MZT1Abeta MZT1Bbeta Interval B 1 2 1 option mu nd=4 option nag=10 db=1 option func=1.e-8 option th=-2 option multiple issat end !fit submodel without age effect save cccage.mxs drop 12 13 end