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

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!

Health and Life Sciences Learning

 

Need courses to help you with SAS Life Sciences Analytics Framework, SAS Health Cohort Builder, or other topics? Check out the Health and Life Sciences learning path for all of the offerings.

LEARN MORE

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