Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: upper case to lower case for all variable names


From   "Michael Blasnik" <michael.blasnik@verizon.net>
To   <statalist@hsphsun2.harvard.edu>
Subject   Re: st: upper case to lower case for all variable names
Date   Wed, 16 Nov 2005 12:57:39 -0500

"Caleb Southworth" <caleb@twinky.uoregon.edu>  wrote:
Within SIC lags:
sort SIC
by SIC: gen CF_1=CF[_n-1]
by SIC: gen CF_2=CF[_n-2]
etc.

This approach should not be used to create lagged values because Stata randomly breaks ties during a sort. You must specify the time variable using -bysort SIC (time): gen ...- or else use Stata's built-in time series operators which are much smarter and more careful.

Michael Blasnik
michael.blasnik@verizon.net

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




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