How to Apply Fishers Exact Test in SAS Using PROC FREQ Procedure
Stay updated with latest technology trends
Join DataFlair on Telegram!!
We looked at t-tests, correlation, and regression, Bland-Altman analysis, chi-square test in the previous tutorials, today we will be looking at another process called SAS Fishers Exact test and how they can be created in SAS Programming Language with using PROC FREQ Procedure. We will also study Fisher exact test SAS Syntax and also get Proc Freq fisher exact test output.
So, let’s start with SAS Fishers Exact Test.
2. What is SAS Fishers Exact Test
The Fisher Exact test in SAS is a test of significance that is used in the place of chi-square test SAS in 2 by 2 tables, especially in cases of small samples. If the assumptions for using the chi-square test are not met (i.e., small expected numbers in one or more cells), then an alternative hypothesis test to use is Fisher exact test.
This non-parametric test assumes that the row and column totals are fixed and considers the possible distributions of data values within the table.
3. The PROC FREQ Procedure
We saw the use of PROC FREQ, to create frequency distribution tables, and to create chi-square tests, but it can also be used to create a SAS Fisher exact test.
A Syntax of PROC FREQ Procedure-
PROC FREQ DATA = dataset; TABLES Variable1*Variable2 / fisher;
Here the syntax looks similar to the one we used for cross tabulation except for the fisher option that gives us a fisher exact test result.
4. Applying Fishers Exact Test in SAS
SAS Fishers Exact Test is a very simple test, in the example below, we choose two categorical variables a1 and a2 and apply test on them using Proc Freq.
Example of SAS Fishers Exact Test-
data new; input a1 a2 Result @@; datalines; 2 3 4 4 1 1 2 7 5 6 7; proc freq; tables a1*a2 / fisher; run;
Hence, we hope you all understood what is SAS Fishers exact test and how can we create Fishers exact test in SAS Programming Language. In conclusion, we saw PROC FREQ Procedure. Furthermore, if you have any query feel free to ask in a comment section and stay tuned to learn more interesting things in SAS.
Related Topic- SAS Numeric Format