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
[email protected]
[email protected]
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/