turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- weight option in proc means

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

09-10-2008 03:07 AM

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

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to zenvii_vq

09-10-2008 08:56 AM

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?

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?