Help using Base SAS procedures

Dividing sum of boolean by number of obs in a period

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 5
Accepted Solution

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,099

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

View solution in original post


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

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 Smiley Wink.

☑ This topic is solved.

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

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