1
votes

Specs: SAS 9.3 on an old Solaris install. Commenting on mobile; I'm sorry if my formatting gets wonky.

I have some largish datasets (n~=30k patients) and I want to run some 2x2 tables and get chi-square p-values for them. Unfortunately, in its infinite wisdom, SAS has decided to make the Fisher's exact test part of the default output when you ask for chi-square stats for a 2x2 table. Because of the large sample size, SAS throws a warning when it attempts the Fisher's exact test:

"WARNING: Fisher's exact test cannot be computed with sufficient precision for this sample size."

(If anyone from the SAS Institute is reading: there's a reason I didn't request that test, friends!)

I need this warning not to happen because I'm embedding this SAS call in a GNU make script, and make will stop on warnings. I am pretty sure NOWARN only suppresses the "chi square may not be accurate with cell sizes this small" warning and not this one. Is there a way to suppress Fisher's exact test itself in this instance? I also tried calculating chi square by hand, but I need an output dataset that includes the overall N, and I can't use an OUTPUT statement that doesn't call for any statistics besides N.

Edit: Here is one table that causes problems, with {Nij} rounded up.

var1,var2: N
-------------------
P,X: 10000
P,Y: 3600
Q,X: 13000
Q,Y: 1000
1
Can you post your code? When I ask for CHISQ, I don't get the Fisher test as well, so I'm wondering how you're asking for the CHISQ test.Reeza
@Reeza Actually, it will produce it - but only for a 2x2 square, as far as I can tell.Joe
I believe it's based on the number of cells, not the sample size. If it were smart enough to key on sample size, I would hope it would not do one in my case.ErinMcJ
@ErinMcJ Yep - I realized that after I posted the comment (and edited while you were making yours).Joe
@ErinMcJ Can you post your proc freq table so we can generate sample data to replicate your problem. I can't generate the warning with 1000000 sample size, but I recall running into it with a sample size of 20K before as well.Reeza

1 Answers

1
votes

Assuming you're talking about the warning in the table itself (and not one in the log), you can exclude that portion with ODS (dest.) EXCLUDE.

Assuming HTML is your destination (otherwise modify that part to LISTING or PDF or whatnot):

ods html exclude fishersexact;
proc freq data=sashelp.snacks;
  tables advertised*holiday/chisq;
run;
ods html exclude none;