Statalist


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

st: lag operator and "not sorted" problem


From   Johannes Geyer <[email protected]>
To   [email protected]
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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index