Page 1 of 1

Reading panel data from excel

Posted: Sat Sep 15, 2007 8:21 am
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

Posted: Mon Nov 05, 2007 2:45 pm
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.

Re: Reading panel data from excel

Posted: Thu Jan 06, 2011 7:54 pm
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?

Re: Reading panel data from excel

Posted: Fri Jan 07, 2011 9:32 am
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.

Re: Reading panel data from excel

Posted: Fri Jan 07, 2011 11:32 am
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