How to Apply Fishers Exact Test in SAS Using PROC FREQ Procedure

Stay updated with the latest technology trends while you're on the move - Join DataFlair's Telegram Channel

1. Objective

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.

SAS fiishers exact test

SAS fiishers 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.

Do you Know How to Calculate SAS Arithmetic Mean using SAS PROC MEANS 

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;

 

SAS Fishers Exact Test

Fishers Exact Test in SAS Using PROC FREQ Procedure

 

SAS

Output – SAS Fisher Exact Test

5. Conclusion

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 

For reference 

1 Response

  1. Turner says:

    Wow this is worthless. I understand what fisher’s exact is. I have know idea how to read the output from SAS. which of the two lines pertains to the null hypothesis?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.