Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, is already up and running.

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

st: first-difference command

From   donsaane dontsi <>
To   "" <>
Subject   st: first-difference command
Date   Fri, 16 Sep 2011 20:27:14 +0100 (BST)

Thanks Austin, 
Maybe I was misunderstood. My panel dataset is sort by
year, so I have : 
firmcode year 
1        2006
1        2009
2        2006
2        2009
I want to first-difference all my variables in order to
be x[2006-2009]
Can I just do: gen dx=x-x[_n-1]
Thanks for the help


*   For searches and help try:

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