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

Hi Xia,

Thank you for the suggestion, i will use Fisher Exact test to calculate the P-value. here i am getting the overall P-value i.e 0.0109

Also, i am getting warning saying that Chi Square may not be a valid test . Please advice.

Capture.JPG

How would i calculate the individual p value for each category, One p-value for Strongly Agree, one p-value for Disagree etc. (Sorry to bother u so much)

Capture.JPG

Regards,

Ratan

Ksharp
Super User

Oh , that is not Fish 's p-value that is still chi-squre's p-value , see Fisher's Exact Test Part of output , and also try to run my second code.

" individual p value for each category, One p-value for Strongly Agree, one p-value for Disagree"

I don't understand what you mean , do you mean Risk for the first column1. I would like to leave it to

SteveDenhamSteveDenham

  . He is an expert about statistical theory . I am going to sleep now. Bye .

Have a nice day.

Xia Keshan

Reeza
Super User

What you're asking for doesn't seem to make statistical or logical sense, though perhaps its simply not clear.

The way to get multiple p-values is multiple tests, which have its own issues, from a statistical perspective.

Assuming you understand what you want to do, and it makes some sense to you here's how you might calculate it in SAS:

proc sort data=have;

by var1 var2 var3;

run;

proc freq data=have;

by var1 var2 var3;

table var4/chisquare;

run;

Ratanroy
Calcite | Level 5

Hi Reeza,

I have the below table. i have two machines A, B. for Felt pain field, patients are giving the feedback that how convenient the screening was.

So, here i have to calculate the p value for individual fields. i.e strongly Agree, Agree etc. I am new to statistics so i am not able to interpret which test i have top use for this.

Capture.JPG

Regards,

Ratan

Ksharp
Super User

You could try this , since you only care about row variable .

NOTE: it tested the H0 :  proportion is 0.5

And you'd better post it at   SAS Statistical Procedures

Steve will help you a lot .

data have;
do a='S' ,'D', 'A', 'N';
 do b='A', 'B';
  input count @@; output;
 end;
end;
cards;
7 7 3 3  7 9 2 2
;
run;

proc freq data=have order=freq;
tables a / binomial(ac wilson exact level=1) alpha=.1;
tables a / binomial(ac wilson exact level=2) alpha=.1;
tables a / binomial(ac wilson exact level=3) alpha=.1;
tables a / binomial(ac wilson exact level=4) alpha=.1;
weight Count;
run;


Xia Keshan

Reeza
Super User

A best practice for statistical analysis is first determine what type of test you need based on your hypothesis and then figure out how to do it in whatever application you have, SAS, R, SPSS.

Step 1. What is your hypothesis?

Step 2. What type of data do you have?

Step 3. What type of statistical tests are available/appropriate?

You're jumping straight to step 3.

Ratanroy
Calcite | Level 5

Hi Reeza,

1.  Here The primary hypothesis is to be tested is that Machine A is superior to Machine B in terms of “Recommendation”:

    machine were recommended which got feedback "Strongly Agree" or "Agree". We are assuming significance level 0.05.

2.Most of the data are ordinal here

Attached the data for reference. kindly suggest.

Regards,

Ratan

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 21 replies
  • 54370 views
  • 7 likes
  • 4 in conversation