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, statalist.org is already up and running.


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

Re: st: first-difference command


From   Fernando Rios Avila <f.rios.a@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: first-difference command
Date   Fri, 16 Sep 2011 15:39:40 -0400

HI Donsaane,
my question is... have you tryed that option?
I think you shouldnt have anyproblem as long as you do it using bysort
country. Otherwise, you will also be obtaining differences across
countries.

On Fri, Sep 16, 2011 at 3:27 PM, donsaane dontsi <donsaane@yahoo.fr> wrote:
> 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
>
>
> dsd
>
> *
> *   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/
>

*
*   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   |   Site index