From | Kit Baum <[email protected]> |
To | [email protected] |
Subject | st: differencing |
Date | Mon, 14 Nov 2005 08:30:51 -0500 |
You were close but your generate (gen) statement wasn't quite right.
. bysort year state county: gen employdiff = employment - employment [_n - 1]
(2 missing values generated)
. l, noobs
+---------------------------------------------+
| year state county employ~ employ~f |
|---------------------------------------------|
| 1 1 1 10 . |
| 1 1 1 15 5 |
| 2 2 1 20 . |
| 2 2 1 30 10 |
+---------------------------------------------+
Eric
* * 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 |