data table542 ; length treatment $ 9 ; input status $ treatment $ count @@ ; cards ; NS Physician 2 NS Self 0 SS Physician 2 SS Self 1 VS Physician 0 VS Self 2 ; * The usual Pearson chi-square test ; proc freq data = table542 ; tables treatment*status / chisq expected nopercent norow nocol cellchi2 ; weight count ; run ; * An exact Pearson chi-square test ; proc freq data = table542 ; tables treatment*status / chisq expected nopercent norow nocol cellchi2 ; exact pchi ; weight count ; run ; * An estimate of the exact Pearson chi-square P value via simulation ; proc freq data = table542 ; tables treatment*status / chisq expected nopercent norow nocol cellchi2 ; exact pchi /mc n = 20000 ; weight count ; run ;