Dear Stata Users:
Is the following behavior of -replace- documented anywhere?
. set obs 10
obs was 0, now 10
. gen x = _n
. replace x = x - x[1]
(1 real change made)
. fl
+------------+
| x |
|------------|
1. | 0 |
2. | 2 |
3. | 3 |
4. | 4 |
5. | 5 |
|------------|
6. | 6 |
7. | 7 |
8. | 8 |
9. | 9 |
10. | 10 |
+------------+
I would have expected -replace- to subtract 1 from each observation, not
just the first one.
Thanks.
Sergey
*
* 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/