Panel data form

Questions related to panel (pooled cross-section time series) data.

Panel data form

Postby Gibbson » Tue Mar 06, 2007 9:39 pm

Dear All,


I have a data set is panel data form, but the order of year is from big to small.
For example;

Comapny Year EPS
A 2005 2
A 2004 1
A 2003 1.5
B 2005 3
B 2004 2
B 2003 4.1

Is there any Rats Code to transform the panel data form into new that the order of year is from small to big.
Like the following form:

Comapny Year EPS
A 2003 1.5
A 2004 1
A 2005 2
B 2003 4.1
B 2004 2
B 2005 3

Thank you very much for your help in advance!

C. M. Wang
Gibbson
 
Posts: 3
Joined: Tue Feb 27, 2007 3:57 am

Postby TomM » Wed Mar 21, 2007 10:23 am

Sorry, didn't see this post earlier.

The PFORM instruction can do this easily. The easiest approach would be to change your company codes from letters to series, so RATS can process them as series. Then, just do a single PFORM command per series to reorder the data. For example:

allocate 6
data(unit=input,org=cols) / Company Year EPS
1 2005 2
1 2004 1
1 2003 1.5
2 2005 3
2 2004 2
2 2003 4.1

pform(indiv=company,time=year) companypan
# company
pform(indiv=company,time=year) yearpan
# year
pform(indiv=company,time=year) epspan
# eps

calendar(panelobs=3)
print / companypan yearpan epspan


ENTRY COMPANYPAN YEARPAN EPSPAN
1//1 1 2003 1.5
1//2 1 2004 1.0
1//3 1 2005 2.0
2//1 2 2003 4.1
2//2 2 2004 2.0
2//3 2 2005 3.0
Tom Maycock
Estima

support@estima.com
TomM
 
Posts: 21
Joined: Tue Oct 24, 2006 3:34 pm
Location: Evanston, IL


Return to Panel Data

Who is online

Users browsing this forum: No registered users and 1 guest