Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: lag operator and "not sorted" problem


From   Johannes Geyer <JGeyer@diw.de>
To   statalist@hsphsun2.harvard.edu
Subject   st: lag operator and "not sorted" problem
Date   Tue, 18 Sep 2007 15:07:14 +0200

Dear Statalisters,

I have a problem with the lag operator:
*****
tsset id time
sort id time
replace X = l.X if X == . & l.X != . 
*****
produces the following error:
****
not sorted
r(5);
****

What is the problem with this code? Does *tsset* not ensure that we do not 
have to sort and use by... again?

Thanks for your help,

Johannes


----------------------
Johannes Geyer
Deutsches Institut für Wirtschaftsforschung (DIW Berlin)
German Institute for Economic Research 
Department of Public Economics
DIW Berlin
Mohrenstraße 58
10117 Berlin
Tel: +49-30-89789-258

*
*   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