Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Maarten Buis <maartenlbuis@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: averaging variables for regression model |
Date | Wed, 16 May 2012 15:52:23 +0200 |
On Wed, May 16, 2012 at 3:41 PM, FredVer wrote: > when in a paper says: Country level variables are > averaged by country over the period under study. does the command then mean: > > sort country year > by country year: egen new = mean(oldvar) I would read that as: bys country : egen new = mean(oldvar) -- Maarten -------------------------- Maarten L. Buis Institut fuer Soziologie Universitaet Tuebingen Wilhelmstrasse 36 72074 Tuebingen Germany http://www.maartenbuis.nl -------------------------- * * 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/