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

Hello,

 

I am new to SAS, so this is probably a simple solution. Attached is the PROC CONTENTS of my data and the results from PROC FREQ. Below is the code I used.

proc freq data=Homework.inpatientAmountoregon;
	table bene_sex_ident_cd*inpatientTotalAmount;
title "Gender Total Payments";
run;

I don't really care about the frequency within each interval of inpatientTotalAmount. I only want the total payments made for each gender. How would I go about making a 2x2 table to display that? 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

 

proc freq data=Homework.inpatientAmountoregon;
	table bene_sex_ident_cd;
    weight inpatientTotalAmount;
title "Gender Total Payments";
run;

 

 

--
Paige Miller

View solution in original post

4 REPLIES 4
PaigeMiller
Diamond | Level 26

I only want the total payments made for each gender.

How about this?

 

proc freq data=Homework.inpatientAmountoregon;
	table bene_sex_ident_cd;
title "Gender Total Payments";
run;

 

 

 

--
Paige Miller
amarikow57
Obsidian | Level 7

Wouldn't that only get me the number of males and females in dataset?

PaigeMiller
Diamond | Level 26

 

proc freq data=Homework.inpatientAmountoregon;
	table bene_sex_ident_cd;
    weight inpatientTotalAmount;
title "Gender Total Payments";
run;

 

 

--
Paige Miller
amarikow57
Obsidian | Level 7

Yes! I figured out how to do it with PROC SUMMARY too, and the numbers match up. Thank you!

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