I have two categorical variables. One variable has 5 categories, the other has 7 (a 5x7 table) B/c there were less than 5 frequencies in each cell, instead of doing a chi square I want to do a fisher's. However, when I try to run the code in SAS, I get a warning that it will take a long time. It has been now 30 mins and it's still running.

I don't think there is anything wrong with the program/computer, I think it's b/c I have 2 categorical variables that have MORE THAN 2 categories. So it's more of a 5x5 table.

Can someone please tell me if: a) I am running the correct test? b) what can I do to actually run the test in SAS. It is taking way to long and I don't think it will actually run. Is there an alternative?

  • $\begingroup$ Check if you're using Monte Carlo. If so, change the default iterations to something smaller. $\endgroup$
    – SmallChess
    Commented Feb 1, 2017 at 22:31
  • $\begingroup$ oh god, what does that mean. Can you please explain a little more. I really suck at stats. $\endgroup$ Commented Feb 1, 2017 at 22:38
  • $\begingroup$ stats.stackexchange.com/questions/1805/… $\endgroup$
    – SmallChess
    Commented Feb 1, 2017 at 22:43
  • 1
    $\begingroup$ Provide the actual table with actual counts $\endgroup$ Commented Feb 2, 2017 at 6:33
  • $\begingroup$ I've not used SAS personally, though it was the most common platform in my last place of work. I've coded fishers exact test in Matlab and it is a relatively simple piece of code and shouldn't be that resource heavy for such a low dimensional problem. Why Monte Carlo would be involved would be beyond me as it is an exact test. You may need to provide more details, what is the code you use? How are you sure it is the fishers that is the cause of the slow down? Is it the only thing you are running? $\endgroup$
    – ReneBt
    Commented Apr 16, 2018 at 2:31

1 Answer 1


sas can do fisher's exact for r x c tables: "Fisher’s exact test was extended to general tables by Freeman and Halton (1951), and this test is also known as the Freeman-Halton test" (sas help ref). It can take time to run however. Wikipedia also mentions this: wiki fisher exact. If your variable has ordered categories then consider the cmh option instead (cmh in proc freq)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.