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

My data is as follows:

data test;
input facilities_name $ sex totalpatients;
datalines;
ABCD 1 1850
CDXF 0 1234
XYZ 1 34567
qwerty 1 123
ASDF 0 1345567
rtyu 0 45
;
run;

 

I have to populate following table:

 

Sex

Total no of male(1)

3

Total no of female(0)

3

Facility rank by Totalpatients

 

       Quartile 1 (25)(mean N = XXX)

(No of facilities)

       Quartile 2 (50)

 

       Quartile 3 (75)

 

       Quartile 4 (100)

 

 

All suggestions are welcomed! 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

1. Use PROC RANK with GROUPS=4 to get the quartile. 

2. Use that data set with PROC MEANS to get the N and Mean

 


@pmpradhan wrote:

My data is as follows:

data test;
input facilities_name $ sex totalpatients;
datalines;
ABCD 1 1850
CDXF 0 1234
XYZ 1 34567
qwerty 1 123
ASDF 0 1345567
rtyu 0 45
;
run;

 

I have to populate following table:

 

Sex

Total no of male(1)

3

Total no of female(0)

3

Facility rank by Totalpatients

 

       Quartile 1 (25)(mean N = XXX)

(No of facilities)

       Quartile 2 (50)

 

       Quartile 3 (75)

 

       Quartile 4 (100)

 

 

All suggestions are welcomed! 


 

View solution in original post

4 REPLIES 4
Reeza
Super User

1. Use PROC RANK with GROUPS=4 to get the quartile. 

2. Use that data set with PROC MEANS to get the N and Mean

 


@pmpradhan wrote:

My data is as follows:

data test;
input facilities_name $ sex totalpatients;
datalines;
ABCD 1 1850
CDXF 0 1234
XYZ 1 34567
qwerty 1 123
ASDF 0 1345567
rtyu 0 45
;
run;

 

I have to populate following table:

 

Sex

Total no of male(1)

3

Total no of female(0)

3

Facility rank by Totalpatients

 

       Quartile 1 (25)(mean N = XXX)

(No of facilities)

       Quartile 2 (50)

 

       Quartile 3 (75)

 

       Quartile 4 (100)

 

 

All suggestions are welcomed! 


 

pmpradhan
Quartz | Level 8

Can you please post code as well. Thank you!

PaigeMiller
Diamond | Level 26

I think you need to give it a try yourself, and if you can't get it to work, show us the code and log.

 

You can look up PROC RANK and PROC MEANS in the documentation, they are relatively simple by SAS standards.

--
Paige Miller

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