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, **statalist.org** is already up and running.

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

From |
Sinan Hastorun <SinanH@remi.com> |

To |
"statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |

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

Date |
Thu, 16 Sep 2010 17:44:41 -0400 |

Thank you very much. This worked very well. Sinan -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Deokrye Baek Sent: Thursday, September 16, 2010 5:34 PM To: statalist@hsphsun2.harvard.edu Subject: Re: RE: RE: RE: Time-Demeaning one's Data Please try this foreach v of varlist em lnrwr lnreo lnpa lnna { bysort id: egen mean_`v'=mean(`v') gen demean_`v'=`v'-mean_`v' drop mean_`v' } ----- Original Message ---- From: Sinan Hastorun <SinanH@remi.com> To: "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> Sent: Thu, September 16, 2010 4:12:22 PM Subject: st: RE: RE: RE: Time-Demeaning one's Data I got another error this time =exp required. Any suggestions? . foreach v of varlist em lnrwr lnreo lnpa lnna { 2. bysort id: egen mean_`v'=mean(`v') 3. drop mean_`v' 4. gen wem wlnrwr wlnreo wlnpac 5. } =exp required r(100); -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Sarah Edgington Sent: Thursday, September 16, 2010 3:42 PM To: statalist@hsphsun2.harvard.edu Subject: st: RE: RE: Time-Demeaning one's Data Sinan, You don't want brackets around the list of variables. -Sarah -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Sinan Hastorun Sent: Thursday, September 16, 2010 12:38 PM To: statalist@hsphsun2.harvard.edu 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 r(100); Sinan * * 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/ * * 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: RE: RE: RE: RE: Time-Demeaning one's Data***From:*Sebastian Kruk <residuo.solow@gmail.com>

**References**:**st: Time-Demeaning one's Data***From:*Sinan Hastorun <SinanH@remi.com>

**Re: st: Time-Demeaning one's Data***From:*Duha Altindag <daltin2@tigers.lsu.edu>

**st: RE: Time-Demeaning one's Data***From:*Sinan Hastorun <SinanH@remi.com>

**Re: st: RE: Time-Demeaning one's Data***From:*Steve Samuels <sjsamuels@gmail.com>

**st: RE: RE: Time-Demeaning one's Data***From:*Sinan Hastorun <SinanH@remi.com>

**st: RE: RE: RE: Time-Demeaning one's Data***From:*"Sarah Edgington" <sedging@ucla.edu>

**st: RE: RE: RE: Time-Demeaning one's Data***From:*Sinan Hastorun <SinanH@remi.com>

**Re: st: RE: RE: RE: Time-Demeaning one's Data***From:*Deokrye Baek <econwhite@yahoo.com>

- Prev by Date:
**st: Illustrate SRS in a graph** - Next by Date:
**Re: st: merge within a range** - Previous by thread:
**Re: st: RE: RE: RE: Time-Demeaning one's Data** - Next by thread:
**Re: st: RE: RE: RE: RE: Time-Demeaning one's Data** - Index(es):