Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

st: RE: RE: RE: Time-Demeaning one's Data

From   "Sarah Edgington" <>
To   <>
Subject   st: RE: RE: RE: Time-Demeaning one's Data
Date   Thu, 16 Sep 2010 12:42:01 -0700

You don't want brackets around the list of variables.

-----Original Message-----
[] On Behalf Of Sinan Hastorun
Sent: Thursday, September 16, 2010 12:38 PM
Subject: st: RE: RE: Time-Demeaning one's Data

Sure, I inserted the variables and entered the commands as follows:

. foreach v of varlist  [em lnrwr lnreo lnpac] {
  2. bysort id: egen mean_`v'=mean(`v')
  3. drop mean_`v'
  4. gen wem wlnrwr wlnreo wlnpac
  5. }
varlist required


*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index