## Dividing sum of boolean by number of obs in a period

Solved
Occasional Contributor
Posts: 5

# Dividing sum of boolean by number of obs in a period

I have a problem with quite a simple proc step.

proc tabulate data=some_data;

class time;

var boolean1;

table time, n boolean

TimeNumber of obs in a given time (n)sum of boolean variableWhat i want
110010(10/100)*100%
220050(50/200)*100%
330060(60/300)*100%
440080(80/400)*100%
........

But actually, I want to get the percent of the sum of boolean variable over a number of observations in a given period.

I tried boolean*rowpctn, different denominators for pctn<>, but none of this worked.

Could you please help me?

Accepted Solutions
Solution
‎12-29-2012 11:45 AM
PROC Star
Posts: 1,317

## Re: Dividing sum of boolean by number of obs in a period

To me, it looks like you're asking for

TABLE time, boolean1 * (N Sum Mean);

Tom

All Replies
Solution
‎12-29-2012 11:45 AM
PROC Star
Posts: 1,317

## Re: Dividing sum of boolean by number of obs in a period

To me, it looks like you're asking for

TABLE time, boolean1 * (N Sum Mean);

Tom

Occasional Contributor
Posts: 5

## Re: Dividing sum of boolean by number of obs in a period

Thanks. I tried this before, but somehow I didn't notice that I have to apply "percent" format and I thought the figures are wrong .

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
• 2 replies
• 174 views
• 0 likes
• 2 in conversation