Hi,
I have been trying to program a specific bootstrap in stata, and need
to use the weighted means of certain variables over time. Unfortunately,
it seems to me that the egen command doesn't work with weights. For now, I
have just been using the series of commands
svymean varname [pweight=x], by(month)
matrix e=e(est)
generate ET=el(e,1,1) if month==1
replace ET=el(e,1,2) if month==2
etc. etc. etc.
But this is really slow, and it would be so convenient if the egen command
would work with weights so I could just say something like
egen ET=mean(varname) [pweight=x], by(month)
Does anyone know a way of doing this??
Thank you so so much!
Laura (Schechter) (from UC Berkeley)
*
* 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/