DATA Step, Macro, Functions and more

Weighted average

Reply
New User
Posts: 1

Weighted average

I am trying to find the weighted average of group of returns.  I want to weight based on another column value (account value).  I'm having trouble figuring out how to do this, and any help would be appreciated.

Super User
Posts: 17,963

Re: Weighted average

Look at PROC MEANS and the WEIGHT statement. 

 

In certain cases you may want PROC SURVEYMEANS depending on how complex your weighting is and if you need the standard deviations. 

SAS Super FREQ
Posts: 3,489

Re: Weighted average

For an example and explanation, see the article "Compute a weighted mean in SAS."

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