! ! Ascertainment correction, estimating pi ! G1: Model parameters Data Calc NGroups=4 Begin Matrices; H Full 1 1 Q Full 1 1 U unit 1 1 W Lower 1 1 O Zero 1 1 P full 1 1 ! ascertainment probability p T full 1 1 ! threshold X Lower 1 1 Free ! a Y Lower 1 1 Free ! c Z Lower 1 1 Free ! e End Matrices; Matrix H .5 Matrix Q .25 Start .6 all Begin Algebra; A= X*X'; C= Y*Y'; E= Z*Z'; D= W*W'; S= (P) _ (P) _ P+P-P*P ; ! Vector of ascertainment probabilities L= A+C+D+E | H@A+C+Q@D _ H@A+C+Q@D | A+C+D+E ; ! DZ cov matrix M= A+C+D+E | A+C+D _ A+C+D | A+C+D+E ; ! MZ cov matrix J= (P+P)*\mnor(A+C+D+E_O_T_T_U)-P*P*\mnor(M_O|O_T|T_T|T_U|U); K= (P+P)*\mnor(A+C+D+E_O_T_T_U)-P*P*\mnor(L_O|O_T|T_T|T_U|U); End Algebra: End G2: MZ twin pairs Data Ninput=9 Labels studyid studyyr zygosity twin1 twin2 asc freq pihat threshold Ordinal File=mzpitest.ord Select if studyid = 1; Select if zygosity = 1; Select twin1 twin2 asc freq pihat threshold ; Definition Asc Pihat Freq Threshold ; Begin Matrices= Group 1; F full 1 1 ! Frequency G full 1 4 ! to select ascertainment prob End Matrices; Specify F Freq Specify P Pihat Specify T threshold Matrix G 1 1 1 1 Specify G asc 0 asc 0 Covariances M; Thresholds T|T ; Frequency F ; Weight \part(S,G)%J ; Options RSidual End G3: DZ twin pairs Data Ninput=9 Labels studyid studyyr zygosity twin1 twin2 asc freq pihat threshold Ordinal File=mzpitest.ord Select if studyid = 1; Select if zygosity = 2; Select twin1 twin2 asc freq pihat threshold ; Definition Asc Pihat Freq Threshold ; Begin Matrices= Group 1 ; F full 1 1 ! Frequency G full 1 4 =G2 ! To select ascertainment probability End Matrices; Specify F Freq Matrix G 1 1 1 1 Specify G asc 0 asc 0 Covariances L; Thresholds T|T ; Frequency F ; Weight \part(S,G)%K ; Options RSidual NDecimals=4 End Group 4: constrain variance to 1 Constraint NI=1 Begin Matrices = Group 1 ; I unit 1 1 End Matrices; Constraint I = A+C+E+D ; Option Multiple issat nag=10 db=1 End