Reading panel data from excel

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

Reading panel data from excel

Postby Boban7 » Sat Sep 15, 2007 8:21 am

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
Boban7
 
Posts: 2
Joined: Fri Sep 14, 2007 8:56 am

Postby TomM » Mon Nov 05, 2007 3:45 pm

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
TomM
 
Posts: 21
Joined: Tue Oct 24, 2006 3:34 pm
Location: Evanston, IL

Re: Reading panel data from excel

Postby luching » Thu Jan 06, 2011 8:54 pm

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?
luching
 
Posts: 31
Joined: Mon Jun 07, 2010 4:05 pm

Re: Reading panel data from excel

Postby moderator » Fri Jan 07, 2011 10:32 am

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: 306
Joined: Thu Oct 19, 2006 4:33 pm

Re: Reading panel data from excel

Postby moderator » Fri Jan 07, 2011 12:32 pm

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
moderator
Site Admin
 
Posts: 306
Joined: Thu Oct 19, 2006 4:33 pm


Return to Data: Reading, Writing, Transforming

Who is online

Users browsing this forum: No registered users and 0 guests