BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
AnalytX
Fluorite | Level 6

Hi,

I would like to perform Chi-square and Fisher exact test on a simple contingency table. If I use for instance the following code:

data yesno;

    input gender $ numyes total;

    response="Yes"; count=numyes;       output;

    response="No "; count=total-numyes; output;

    datalines;

  Men   0 100

  Women 45.2 100

  ;

 

proc freq data=yesno;

  weight count;

  table gender * response / chisq fisher;

run;

I obtain the following "WARNING: Fisher's exact test is not computed because of non-integer frequencies."

Do you have an idea how to proceed?

Thanking you in advance for your answer.

Best,

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

For a true comparison you need the true denominator, not 100.

View solution in original post

5 REPLIES 5
Reeza
Super User

Well, the log is correct, you can't have a decimal in contingency tables, because they're counts.

Can you explain some more about what you're trying to do?

It looks like you have 2 percentages and want to compare them, so you've put them over 100. You could put it out of 1000 to remove the decimal but that can change the results.

AnalytX
Fluorite | Level 6

Hi Reeza, thanks for your prompt reply. To be more precise, I try to compare two (or more) percentages. A more concrete case. I have the following percentages to compare: 7.5, 6.2, 5.3 and 9.9.

Reeza
Super User

For a true comparison you need the true denominator, not 100.

Ksharp
Super User

Did you mean

weight total ;

Ksharp

AnalytX
Fluorite | Level 6

Thanks a lot for your answer!

@Ksharp: it is well "weight count";

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 3577 views
  • 3 likes
  • 3 in conversation