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: 19,870

Re: Weighted average

Posted in reply to sarahknuth

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

Re: Weighted average

Posted in reply to sarahknuth

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

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