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" <[email protected]>
To   <[email protected]>
Subject   Re: st: upper case to lower case for all variable names
Date   Wed, 16 Nov 2005 12:57:39 -0500

"Caleb Southworth" <[email protected]>  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
[email protected]

*
* 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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index