The SAS Output Delivery System and reporting techniques

calculate means

Reply
N/A
Posts: 0

calculate means

Hi!

I think this is a simple question, but I cannot find the answer. Here is what I have:

day depth
1 50
1 58
1 72
2 46
2 78
2 34
2 75
etc...

How can I calculate a single value (mean of each depth value) for each day?

thank you!
ES
SAS Employee
Posts: 22

Re: calculate means

Posted in reply to deleted_user
Try the following:

proc means nway mean;
class day;
var depth;
output out=new / autoname;
run;

proc print data=new;
run;
SAS Employee
Posts: 22

Re: calculate means

Posted in reply to deleted_user
Note the revised code below:

proc means nway mean;
class day;
var depth;
output out=new mean= / autoname;
run;

proc print data=new;
run;
N/A
Posts: 0

Re: calculate means

Posted in reply to deleted_user
Perfect!

Thank you very much!!!

ES
Ask a Question
Discussion stats
  • 3 replies
  • 150 views
  • 0 likes
  • 2 in conversation