Statalist


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

st: First difference in multidimensional panel


From   mm3040@columbia.edu
To   statalist@hsphsun2.harvard.edu
Subject   st: First difference in multidimensional panel
Date   Fri, 24 Apr 2009 11:29:46 -0400

Dear stata list members,

I have a panel data of share of intra-firm imports (s_{ict}) where observations vary over industry (i), country (c) and time (t). I need to calculate the first difference of s_{ict}:
Delta_s_{ict}=s_{ict}-s_{ic(t-1)}.
I am not sure how to do this since I do not have a unique panel variable.
Also when using tsset how do I create unique id for each industry-country pair (where both industry and country are string variables). Any help would be appreciated.

My data is of the following form: Industry(Ind) and Country (Cty) are both string variables
Ind Cty Yr
1 A 2000
1 B 2000
1 C 2000
1 A 2001
1 B 2001
1 C 2001
1 A 2002
2 A 2000
2 B 2000
2 D 2000
2X B 2001
2X A 2002
2X B 2002

Thanks in advance,
Best,
Modhura.

*
*   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   |   What's new   |   Site index