[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Kit Baum <email@example.com>
Thu, 23 Oct 2008 06:45:27 -0400
egen newvar = wtmean(price), weight(quantity) if contract=="S", by(date)
but doesn't work.
You have the syntax wrong. If you -ssc desc _gwtmean- you will see
that weight() is an option, so it must come after the comma.
. egen junk = wtmean(price) if foreign, weight(displacement) by(rep78)
(52 missing values generated)
Kit Baum, Boston College Economics and DIW Berlin
An Introduction to Modern Econometrics Using Stata:
* For searches and help try: