BookmarkSubscribeRSS Feed
SB15
Calcite | Level 5

 

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

2 REPLIES 2
Rick_SAS
SAS Super FREQ

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."

 

SB15
Calcite | Level 5

Hi Rick,

 

Thanks for your responds 🙂 and help !

 

Dileep

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 2 replies
  • 2229 views
  • 0 likes
  • 2 in conversation