importing from mixed numerical and alpha files

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator

tgoodwin
Posts: 13
Joined: Fri Oct 23, 2009 1:58 pm

importing from mixed numerical and alpha files

Postby tgoodwin » Thu Oct 29, 2009 9:14 am

I am having trouble importing tab delimited files either in .txt or .xls formats. The data has 25 columns with no headers. Some columns are alpha and some numeric. There must be some simple command lines to do this but the user's guide doesn't have much on alpha data.

EViews Glenn
EViews Developer
Posts: 2672
Joined: Wed Oct 15, 2008 9:17 am

Re: importing from mixed numerical and alpha files

Postby EViews Glenn » Thu Oct 29, 2009 10:19 am

From the Command Reference entry for read:
To import data into alpha series, you must specify the names of your series, and should enter the tag "$" following the series name (e.g., "NAME $ INCOME CONSUMP").

tgoodwin
Posts: 13
Joined: Fri Oct 23, 2009 1:58 pm

Re: importing from mixed numerical and alpha files

Postby tgoodwin » Thu Oct 29, 2009 10:47 am

I am working through the GUI. I have a work file set up as "series alpha." When I use the ACII Text Import on the text file data and insert NAME $ x1 x2 etc. it imports everything in NA. When I use the proc excel spreadsheet import on the data in excel using that naming line it imports everything as series and so the alpha data is all NA.

EViews Glenn
EViews Developer
Posts: 2672
Joined: Wed Oct 15, 2008 9:17 am

Re: importing from mixed numerical and alpha files

Postby EViews Glenn » Fri Oct 30, 2009 8:25 am

I'm not certain what's going on in your case, but my suggestion should work. I just tested a read of a file containing two rows:

1.2 <tab> abc <tab> 3.4
2.2 <tab> efg <tab> 5.5


Creating a new workfile using the "File/Open/Foreign Data as workfile" reads in three series (SERIES01, SERIES02, SERIES03), with the first and third series numeric and the second an alpha series.

Similarly, I can create a two observation workfile and use "Proc/Import/Read Text/Lotus/Excel...". I set the number of header lines to 0, and enter
"X Y $ Z" as the name string for the series, I obtain three series X Y and Z, where the first and third series are again numeric and the second is an alpha series.

tgoodwin
Posts: 13
Joined: Fri Oct 23, 2009 1:58 pm

Re: importing from mixed numerical and alpha files

Postby tgoodwin » Fri Oct 30, 2009 11:14 am

The File/Open/Foreign Data as workfile works perfectly. Thanks! :D

The Proc/Import/Read Text-Lotus-Excel did not work. I must have the naming syntax wrong. I listed the names as:
x01 $ x02 x03 x04 x05 x06 x07 x08 x09m x10 x11 x12 x13 x14 x15 $ x16 $ x18 $ x19 $ x20 $ x21 $ x22 $ x23 $ x24 x25
The intention is to read x01 and x15-x23 as alpha and the rest numeric. What am I doing wrong?

EViews Glenn
EViews Developer
Posts: 2672
Joined: Wed Oct 15, 2008 9:17 am

Re: importing from mixed numerical and alpha files

Postby EViews Glenn » Fri Oct 30, 2009 3:53 pm

That should be fine. I'm assuming that those series don't already exist in your workfile...


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 24 guests