Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Why can't I egen means with pweights?


From   n j cox <[email protected]>
To   [email protected]
Subject   Re: st: Why can't I egen means with pweights?
Date   Wed, 23 Apr 2003 23:23:45 +0100

Laura Schechter wrote

This is a response to Nick Cox's advice. The code you suggested actually
doesn't work because su doesn't allow for pweights either!
Shucks. I should have remembered the First Law of -svy- and Statalist:
Even when the answer to a -svy- question appears obvious, you will probably be wrong.

svymean varname [pweight=x], by(month)
matrix e=e(est)
generate ET= .
qui forval i = 1/12 {
replace ET=el(e,1,`i') if month==`i'
}

Nick
[email protected]

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index