Programming the statistical procedures from SAS

Proc Means

Reply
Contributor
Posts: 35

Proc Means

Hi all,

Is there a syntax in PROC MEANS to calculate the mean of positive numbers and negative numbers separately . it is not the count but the mean calculation.

Respected Advisor
Posts: 2,655

Re: Proc Means

If you preprocess your data set to have a variable that indicates positive or negative, then you could implement a CLASS statement to get this.

data want;

set have;

flag=sign(variable);

run;

proc means data=want;

class flag;

var variable;

run;

This should at least get you started.

Steve Denham

Message was edited by: Steve Denham

Contributor
Posts: 35

Re: Proc Means

Thanks Steve Denham ,

This is quite helpful .

Ask a Question
Discussion stats
  • 2 replies
  • 219 views
  • 1 like
  • 2 in conversation