turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- proc freq - chisq test resuls for zero counts...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

12-21-2016 04:14 AM

hi all,

below is my data, I want generate chisq p-value for 5 tests together. I have data for 3 tests (1,2,3) but don’t have counts for test 4 and 5. these should include in the model to get pvalue. any one could suggest what I have to do? the below is the dummy data for your reference!

data test;

test=1; trt=1; count=6;output;

test=1; trt=2; count=6;output;

test=2; trt=1; count=10;output;

test=2; trt=2; count=6;output;

test=3; trt=1; count=8;output;

test=3; trt=2; count=6;output;

test=4; trt=1; count=0;output;

test=4; trt=2; count=0;output;

test=5; trt=1; count=0;output;

test=5; trt=2; count=0;output;

run;

proc sort data=test;by test trt;run;

proc freq data=test order=data;

table test*trt/chisq;

weight count/zeros;

run;

*when i run this code i am getting below warning not getting chisqure pvalue;

Statistics for Table of test by trt

Row or column sum zero. No statistics computed for this table.

Sample Size = 42

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

12-21-2016 05:20 AM

In the chi-square test, you compute the quantities

(Observed - Expected) / Expected

for each cell, where Expected is the exoected value in the cell under the null hypothesis. For these data, the expected values for the cells in rows 4 and 5 are zero. Since 0/0 is mathematically undefined, it is not possible to compute the chi-square test. Consequently, what you are asking for doesn't make sense.

What to do? You can

1. Collect more data until to observe counts in rows 4 and 5

2. Drop rows 4 and 5 from the analysis

3. Combine small categories into larger ones. For example, if the rows represent the categories "small", "medium", "large", "extra-large", and "huge", you can merge the last three categories into a new categoriy called "Big."

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

12-21-2016 05:40 AM

Hi Rick,

Thanks for your responds and help !

Dileep