/* Simulated polygraph data using 3 judges to score session 1 */ /* Used here to model symmetry and quasi-symmetry */ proc format; value respfmt 1='Deceptive' 2='Truthful' 3='No Opinion'; data polygraph; input J1T1 J2T1 count symm qi; format J1T1 J2T1 respfmt.; datalines; 1 1 148 1 1 1 2 217 2 4 1 3 99 3 4 2 1 94 2 4 2 2 143 4 2 2 3 65 5 4 3 1 66 3 4 3 2 105 5 4 3 3 63 6 3 run; /* Three-by-three table */ proc freq data=polygraph; weight count; table j1t1*j2t1; run; /* Symmetry model */ proc genmod data=polygraph; class symm; model count=symm/dist=poi link=log; run; /* Quasi-symmetry */ proc genmod data=polygraph; class j1t1 j2t1 symm; model count=j1t1 j2t1 symm/dist=poi link=log; run; /* Quasi-independence */ proc genmod data=polygraph; class j1t1 j2t1 qi; model count=qi j1t1 j2t1; dist=poi link=log; output out=qiout p=phat; run; proc print data=qiout; run; /* Marginal Homogeneity */ proc catmod data=polygraph; weight Count; response marginals; model j1t1*j2t1=_response_; repeated test 2; run; *Kappa statistic example; data table; input A B count @@; datalines; 1 1 22 1 2 2 1 3 2 1 4 0 2 1 5 2 2 7 2 3 14 2 4 0 3 1 0 3 2 2 3 3 36 3 4 0 4 1 0 4 2 1 4 3 17 4 4 10 ; proc freq order=data; weight count; tables A*B / plcorr agree; run;