Statalist


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

RE: st: bys and [_N] within replace


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: bys and [_N] within replace
Date   Wed, 18 Mar 2009 13:36:50 -0000

You may be confusing _n and _N. 

_n indicates the current observation, _n + 1 the next and _n - 1 the
previous one. 

_N indicates, depending on context, the last observation or the number
of observations. 

Nick 
n.j.cox@durham.ac.uk 

Alexander.Severinsen@telenor.com

I am still puzzled about why my code did not work. I thought that I
could use _N to look forward and _N-1 to look backwards, within Id and
Commdate.


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



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