Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down at the end of May, and its replacement, **statalist.org** is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
Lindsay Newman <lrshorr@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
st: Aggregated Weighted Summary Statistics Using Probability Weights |

Date |
Tue, 13 Jul 2010 11:17:09 -0400 |

I am using survey data with probability weights. I want to compute various summary statistics, including the mean and standard deviation, of the data at an aggregated level. In particular, I want to use individual responses to certain questions to calculate the country year weighted mean and standard deviation of the response. For instance, if 200 individuals responded to a particular question, what is the weighted average response for that country year? What is the weighted standard deviation of the responses for that country year? When I sort by country year and use the following code: (1) by countryyear: summarize (response variable) [aw=weight variable] I get different results for the standard deviations than when I either run: (2) summarize (response variable) if countryyear ==x [aw=weight variable] or when I calculate the standard deviation manually using: (3) di sqrt(e(N) * el(e(V_srs),1,1)) When I analyze the responses for just one country year (i.e. deleting all but responses from a single country year) using: (4) svy: mean (response variable) estat sd, the standard deviations match 2 and 3 but not 1. Why is this? Thank you. * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**Re: st: Aggregated Weighted Summary Statistics Using Probability Weights***From:*Steve Samuels <sjsamuels@gmail.com>

- Prev by Date:
**Re: st: "vertical filter and sum of data"** - Next by Date:
**Re: st: is something wrong with fvvarlist "i(3 4).role"?** - Previous by thread:
**st: "vertical filter and sum of data"** - Next by thread:
**Re: st: Aggregated Weighted Summary Statistics Using Probability Weights** - Index(es):