Help using Base SAS procedures

weight option in proc means

Posts: 1

weight option in proc means

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
Super Contributor
Posts: 281

Re: weight option in proc means

The method of computing weighted variances is spelled out here:

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?
Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation