BookmarkSubscribeRSS Feed
Strs1309
Fluorite | Level 6
Hello guys! I have got a problem which is really widespread I guess.
How can I output p-value for each cell in total column in proc freq procedure? Is it possible to output p-value for each row in cell in 2x2 frequency table?
5 REPLIES 5
ballardw
Super User

P-values are the result of a statistical test. What test are you running on "each cell"?

 

Basically a "cell" isn't going to have a p-value at all because you aren't running a test on the cell. Some tests, such as Chi-square allow you to get the contribution to the overall test statistic.

Strs1309
Fluorite | Level 6
I have only this kind of table (amount of people with different types of blood in 2003 and 2022)
2003 2022 p-value
O(I) 2345 1028 ?
A(II) 3402 4093 ?
B(III) 9807 3988 ?
AB(IV) 1008 1982 ?

Is it possible to get p-value in the last column ?
PaigeMiller
Diamond | Level 26

Repeating essentially what @ballardw said

 

If you are talking about a chi-squared test, you would not get a p-value for each row of the table. So I guess you are not talking about a chi-squared test. So please be specific: what test are your performing that will produce a p-value?

--
Paige Miller
ballardw
Super User

@Strs1309 wrote:
I have only this kind of table (amount of people with different types of blood in 2003 and 2022)
2003 2022 p-value
O(I) 2345 1028 ?
A(II) 3402 4093 ?
B(III) 9807 3988 ?
AB(IV) 1008 1982 ?

Is it possible to get p-value in the last column ?

In your first post you had:

Is it possible to output p-value for each row in cell in 2x2 frequency table?

And then you show a 4x2 table. So is it a 2x2 or 4x2 or yet something else?

Still have not mentioned what the test is supposed to be either.

mkeintz
PROC Star

Does it make sense to get a probability for every cell in a crosstabulation.  I think you could not treat all those probabilities as independent.

 

For example, in the case of a 2*2 table, I believe that getting a "p-value" for a single cell will generate the same "p-value" for each of the other cells.  After all, given you start with row totals and columns totals, knowing the frequency of any single cell means you can calculate the frequency of any other cell.  After all, chi-square for a 2*2 table has degrees of freedom=1.

 

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

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
  • 5 replies
  • 1115 views
  • 0 likes
  • 4 in conversation