data severe;
input treat $ outcome $ count;
datalines;
Test f 10
Test u 2
Control f 2
Control u 4
;
proc freq order=data;
weight count;
tables treat*outcome / chisq nocol;
run;
fisher 的结果如下:
Fisher’s Exact Test
-------------------------------------- -------
Cell (1,1) Frequency (F) 10
Left-sided Pr <= F 0.9961
Right-sided Pr >= F 0.0573
Table Probability (P) 0.0533
Two-sided Pr <= P 0.1070
可以看出单侧,双侧的概率跟我们计算的一样。
还有,值得注意的时,left-side 与right-side的P相加并不等于1,因为多计算了一个0.0533
^_^ 希望对大家有所用。
reference:categorical data analysis using in the sas system.