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

From |
Jared Delisle <rjd1867@fsu.edu> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: Weighted mean of prices with quantities as weight |

Date |
Wed, 22 Oct 2008 22:31:47 -0400 |

-findit _gwtmean-

- egen newvar = wtmean(price), weight(quantity) - Thanks to David Kantor for this code. Take care, Jared Beatrice Crozza wrote:

Dear all, I would like to construct a weighted mean of prices, taking as weight the quantity for each price. I am using the command egen(mean) How can I instruct Stata to use quantities for each price as weight? Thank you very much. Best, Bea * * 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/

* * 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: Weighted mean of prices with quantities as weight***From:*"Beatrice Crozza" <beatrice.crozza@gmail.com>

**References**:**st: Weighted mean of prices with quantities as weight***From:*"Beatrice Crozza" <beatrice.crozza@gmail.com>

- Prev by Date:
**st: doubt how to avoid some problems with do files** - Next by Date:
**Re: st: RE: expanding on -egen rowmin()-** - Previous by thread:
**st: Re: Weighted mean of prices with quantities as weight** - Next by thread:
**Re: st: Weighted mean of prices with quantities as weight** - Index(es):

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