BookmarkSubscribeRSS Feed
iressa131
Calcite | Level 5

Hi i want to compare the proportion of males between two groups. 

 

first, am I correct in thinking a chi-square is appropriate?

second, how would I compare group by only one level of gender and not by both levels?

 

thanks for any help!

PROC FREQ DATA=_____;
TITLE3 'Chi-Square Test';
TABLES group*gender/CHISQ;
RUN; 
3 REPLIES 3
PGStats
Opal | Level 21

A Chi-square test is appropriate if there are enough cases in every table bin. Otherwise, you might consider using an exact Fisher test.

What is there to compare statistically between males and females in a single group?

 

/* Extract a few observations at random  from SASHELP.HEART dataset */
data heart;
call streaminit(78967896);
set sashelp.heart;
if rand("uniform") < 0.05;
run;

/* Compare the live/death status between males and females, 
   using two tests */
proc freq data=heart;
tables sex*status;
exact Fisher chisq / mc;
run;
PG
Ksharp
Super User
PROC FREQ DATA=_____;
TITLE3 'Chi-Square Test';
TABLES group*gender/CHISQ relrisk riskdiff;
RUN; 
ballardw
Super User
PROC FREQ DATA=_____;
TITLE3 'Chi-Square Test males';
where gender='Male';
TABLES group/CHISQ;
RUN; 

could be one way. Of course without data I do not know your exact values of gender...

 

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!

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