DATA Step, Macro, Functions and more

Calulate Grand Avereage function in SAS

Reply
Occasional Contributor PU1
Occasional Contributor
Posts: 14

Calulate Grand Avereage function in SAS

How to calculate Grand Average in SAS?

 

 

Trusted Advisor
Posts: 1,137

Re: Calulate Grand Avereage function in SAS

please try to use the mean() function in datastep or avg() function in proc sql. The mean() function will give you the average of all the variables so it works across multiple variables per observation and avg() functions works vertically for the single variable.
Thanks,
Jag
Super User
Posts: 5,509

Re: Calulate Grand Avereage function in SAS

A simple way:

 

proc means data=have;

var a list of some variables here;

run;

 

This is a tool you will need to study if you're going to use SAS.

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