BookmarkSubscribeRSS Feed
zenvii_vq
Calcite | Level 5
Hi,
I am trying to use proc means to calculate my weighted mean and weighted standard deviation. For the weighted mean, it seems to be right but for the weighted standard deviation, Sas just gives me a inflated figuire and I dont know how does it come up with this figure. Specifically, when I use proc means without specifying the weight, the standard deviation is 0.77 but when I use the weight option, the standard deviation is 44. I expect some difference between the equal weighted and value weighted method but not such drastic difference. I've heard of the vardef option in proc means and I just dont know it is correct if I specify the vardef=weight in the proc means to get an weighted standard deviation.
Thanks very much
1 REPLY 1
Paige
Quartz | Level 8
The method of computing weighted variances is spelled out here:

http://support.sas.com/documentation/cdl/en/proc/59565/HTML/default/a002473330.htm

Without seeing your data (don't post it if it is a large data set), there is no way we can explain what happened when you got a weighted std dev of 44. I will guess that one of your weights is very large compared to the other weights, and that it might be associated with a value that is very far from the mean. Do you have any major outliers in your data?

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 1207 views
  • 0 likes
  • 2 in conversation