data ecg; input cardx cardy count; datalines; 1 1 90 1 2 30 1 3 0 2 1 0 2 2 20 2 3 20 3 1 10 3 2 10 3 3 20 run; proc format; value cardxfm 1='normal' 2='possible abnormal' 3='definite abnormal'; value cardyfm 1='normal' 2='possible abnormal' 3='definite abnormal'; proc freq; weight count; tables cardx*cardy/norow nocol nopercent agree; format cardx cardxfm. cardy cardyfm.; title 'Example of Kappa Coefficient'; title2 'Example of table 8.4 cardiogram diagnosis'; run;