Reading panel data from excel

For questions and discussion related to reading in and working with data.
Boban7

Reading panel data from excel

Unread post by Boban7 »

Hi,
I have a problem with RATS.
I want to read a panel from excel in rats.
the panel have a form:

x y
A 1977 1 2
A 1978 3 4
A 1979 5 6
.
.
B 1977 2 3
B 1978 1 4
.
.
I have 25 countries and each country have observations fro the varaibles x and y from 1977-1994.

If I used the wizard, then i get the following message:

DATA(FORMAT=XLS,ORG=COLUMNS) 1//1977:01 7//1994:01 x y
## IO40. Expected SERIES NAME. Got "BLANKS".
## IO30. There is no series X on the file
## IO30. There is no series Y on the file

What should I do?
It would be of great help If I can get a solution!
Regards,
Boban7
TomM
Posts: 20
Joined: Tue Oct 24, 2006 3:34 pm

Unread post by TomM »

You've probably already figured this out, but based on your description of the file, it appears that you have 4 columns of information, but only 2 of those columns have series names.

If you add "series" names for the first two columns, such as "name" and "year", the error should go away.

Note that you can't read non-numeric data into series, so you should set up your DATA command to ignore that first column of labels. An even better solution would be to replace the text labels with numeric labels. This would allow you to read in these identifiers as a series.
Tom Maycock
Estima

support@estima.com
luching
Posts: 64
Joined: Mon Jun 07, 2010 4:05 pm

Re: Reading panel data from excel

Unread post by luching »

I have a similar situation. I loaded the data correctly by removing the identifiers. But, I am trying to "read" (or load) the variable names separately as strings to label them later, say from a separate excel sheet/file. Is it possible?
moderator
Site Admin
Posts: 269
Joined: Thu Oct 19, 2006 4:33 pm

Re: Reading panel data from excel

Unread post by moderator »

You can use the READ instruction to read in labels. Older versions can read the information from text files, with more recent versions, READ supports more formats, including spreadsheets.
moderator
Site Admin
Posts: 269
Joined: Thu Oct 19, 2006 4:33 pm

Re: Reading panel data from excel

Unread post by moderator »

Sorry, to clarify: the changes to READ (adding the ability to read spreadsheets and other formats) was just added in the new version 8 release.

In version 8, you can also use the Data Wizard (or the new NOLABELS option on the DATA instruction) to ignore existing labels on a spreadsheet, and provide your own names. This might be easier than having to modify the file and read the labels in separately, although there may be cases where using READ to pull in the labels is preferable.

Regards,
Tom Maycock
Post Reply