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-2024.png

Today is the last day to save with the early bird rate! Register today for just $695 - $100 off the standard rate.

 

Plus, pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 1014 views
  • 0 likes
  • 2 in conversation