BookmarkSubscribeRSS Feed
Dhana18
Obsidian | Level 7

HI I have the data like this and i would like to calculate p-value to  to see if the populations differ statistically in terms of these variable (event). 

 FEMALE
 Alert Non-Alert
 #% #%
TOTAL11  202 
GENDER     
Male00% 00%
Female11100% 202100%
Male to Female00% 00%
Unknown00% 00%
RACE     
     African American11100% 17687%
     White00% 84%
     Other00% 189%
ETHNICITY     
     Hispanic19% 63%
     Non-Hispanic1091% 19195%
Unknown00% 52%
GENDER SP     
     Male982% 16481%
     Female19% 2613%
     Both19% 52%
Unknown00% 73%
SYMPTOMS     
     Dysuria00% 52%
     Discharge436% 4924%
GC History     
     Yes00% 2110%
     No11100% 17989%
Unknown00% 21%
5 REPLIES 5
PaigeMiller
Diamond | Level 26

@Dhana18 wrote:

HI I have the data like this and i would like to calculate p-value to  to see if the populations differ statistically in terms of these variable (event). 



I don't see a variable named EVENT.


Please refer to the exact position(s) in the table that you want to compare via a statistical test.

 

I also don't understand the percents shown, for example, next to unknown, there are 2 "Non-Alert" and 1%? How do you get 1% out of 2 observations?

--
Paige Miller
ballardw
Super User

P-value implies a statistical test. Which specific test do you want to conduct? If you can provide exactly want kind of question you

 

I would guess that the easiest test might be a chi-square but you have so many empty cells or counts < 5 that the test may not be reliable that is one of the least sensitive to small sample size tests.

Dhana18
Obsidian | Level 7
I want to do a Fisher's exact test, Two -tailed. I want to see if the difference in these Alert and non-alert group is significant or not. Below is the example of my data. Please help.

Alert case

Non-Alert case

P value

ETHNICITY







Hispanic

1

3



Non-Hispanic

10

111



Unknown

0

2



GENDER SP







Male

9

93



Female

1

20



Both

1

2



Unknown

0

1



SYMPTOMS







Dysuria

0

3



Discharge

4

31





PaigeMiller
Diamond | Level 26

This p-value can be computed from PROC FREQ, but I think we would need to see a portion of your actual data before we can provide code that you can use. Please follow these instructions to provide a portion of your data for us to see: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat...

--
Paige Miller
Reeza
Super User
Same answer as last time, chi square tests will test if the counts are different between the groups. If you want to identify beyond that you can run a logistic regression on each one and see the outcomes. You may also be able to use the BINOMIAL option on PROC FREQ to get the comparisons. I think there's an example in the past month on here on how to compare the multiple levels via PROC FREQ.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 713 views
  • 0 likes
  • 4 in conversation