BookmarkSubscribeRSS Feed
javvadi
Calcite | Level 5

dear friends

i have dataset and i need to calculate the percentages ....

Pt Aebodsys aedecod

1 Soc1   pt1

1 soc1 pt1

1 soc2 pt1

2 soc1 pt1

2 soc1 pt2

I have a dataset like this and I want to create percentage like this..

Denominator is aebodsys count-group

Nominator is aedecod count-subgroup

Aebodsys aedecod n percent

Soc1                     2                2/2=100

                Pt1         2              2/2=100

                Pt2         1              ½=50

Soc2                       1              1/1=100

                Pt1         1              1/1=100

               

thank you

3 REPLIES 3
LinusH
Tourmaline | Level 20

PROC FREQ?

Data never sleeps
ballardw
Super User

What does this line represent?

Soc1                     2                2/2=100

Your example data has 4 records with Soc1, so how does it get an n of 2? and what is the denominator? I think you might want to provide a few more example records as 2 is showing in so many places we can't tell where the 2 is coming from.

javvadi
Calcite | Level 5

hear N is count of the subjcts (pt) ...i done the answer by using retain statement ...thank you ballardw and linusH for quick respose

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!

New Learning Events in April

 

Join us for two new fee-based courses: Administrative Healthcare Data and SAS via Live Web Monday-Thursday, April 24-27 from 1:00 to 4:30 PM ET each day. And Administrative Healthcare Data and SAS: Hands-On Programming Workshop via Live Web on Friday, April 28 from 9:00 AM to 5:00 PM ET.

LEARN MORE

Discussion stats
  • 3 replies
  • 2255 views
  • 0 likes
  • 3 in conversation