Check out
1. David Kantor's -wtmean()- function for -egen- from
. ssc inst _gwtmean
And
2. The FAQ
FAQ . . Calculating variables containing weighted group summary
statistics
. . . . . . . . . . . . . . . . . . . . . N. J. Cox and S. P.
Jenkins
1/03 I want to calculate a variable containing weighted
group summary statistics, but I do not want to
collapse the data and egen does not support weights.
How can I do this?
http://www.stata.com/support/faqs/data/weighted.html
Nick
[email protected]
[email protected]
I have to create a variable that compute the mean of varname (y) for a
particular area (area=1)and conditioned to an other variable (x, that
assumes value equals to 1,2,3,4,6),so I would calculate the mean of
y|x=1 in area=1, the mean of y|x=2 in area=1, and so on. I typed
egen mean=mean(y) if area==1, by (x)
but I have to introduce aweight to this computation, how can I do?
*
* 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/