Nirmala Ravishankar
>
> I am a first-time Stata user, and have a relatively basic
> question. Is
> there some way to calculate the weighted mean and median of
> a variable
> without using the "collapse" command? As part of a
> program, I need to
> calculate the weighted mean and median to perform other
> operations on the
> dataset, but using "collapse" clears the original variables from the
> workspace. I tried "egen" but that doesn't allow for weighted means.
>
Nevertheless David Kantor wrote a work-around
-egen- function for weighted means.
Type
. findit egen weighted mean
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/