SAS Procedures

Help using Base SAS procedures
BookmarkSubscribeRSS Feed
SAS_ter
Calcite | Level 5

Dear SAS users,

Fisher's Exact test is the appropriate test for me to use to identify whether there is a relationship between two variables: 1) time period (1,2, or 3) and 2)number of visits (0,1,2,3 or 4), I have 523 observations.

When I do a proc freq some cells have less than 5 observations, hence the fisher's exact.

This is the code that I used:

proc freq data=dataset;

tables variable3 timeperiod*numbvisits/fisher;                     

where variable3 in (1);

run;

Now, when I ran this over the weekend, I had to terminate it on Monday because it still had not computed it:

NOTE: There were 523 observations read from the data set

     dataset

      WHERE variable=1;

NOTE: PROCEDURE FREQ used (Total process time):

      real time           95:51:11.37

      cpu time            10:41:30.97

The only other comment in the log was that computing would take a lot of time and memory.

Therefore, I am asking if there is an alternative to Fisher's exact that I can use that would be equally as meaningful? and how I would go about accomplishing it?

Thanks!

6 REPLIES 6
ballardw
Super User

You should post the exact code you attempted as it is hard to provide any specifics without knowing what was attempted.

SAS_ter
Calcite | Level 5

Thank you, I will

SAS_ter
Calcite | Level 5

does the code make sense? its pretty simple, do you have any other suggestions?

Reeza
Super User

With 3 *5 =15 cells and 523 obs I would think that Fisher would be okay to calculate.

1. Post code used and log.

2. If allowed post the crosstab table/result (without fisher).

SAS_ter
Calcite | Level 5

can't really post the table, but its a basic 3*5 table with 508 obs. with 15 missing and 4 cells with <5 obs

Doc_Duke
Rhodochrosite | Level 12

One thing that you could do is to run it without the Fisher option.  If the Pearson's Chi-Square is not significant, then the Fisher won't be either.

Also, consider Monte Carlo simulation of exact p-values:

"Note: PROC FREQ computes exact tests by using fast and efficient algorithms that are superior to direct enumeration. Exact tests are appropriate when a data set is small, sparse, skewed, or heavily tied. For some large problems, computation of exact tests might require a substantial amount of time and memory. Consider using asymptotic tests for such problems. Alternatively, when asymptotic methods might not be sufficient for such large problems, consider using Monte Carlo estimation of exact p-values. You can request Monte Carlo estimation by specifying the MC computation-option in the EXACT statement. See the section Computational Resources for more information."

Doc Muhlbaier

Duke

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 3058 views
  • 0 likes
  • 4 in conversation