New Contributor
Posts: 4

# need help in calculating percentage

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

Super User
Posts: 5,882

## Re: need help in calculating percentage

PROC FREQ?

Data never sleeps
Super User
Posts: 13,563

## Re: need help in calculating percentage

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.

New Contributor
Posts: 4

## Re: need help in calculating percentage

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

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