IMPORT function + Panel

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

tchaithonov
Posts: 168
Joined: Mon Apr 13, 2009 7:39 am
Location: New York City

IMPORT function + Panel

Postby tchaithonov » Fri Mar 12, 2010 3:26 pm

Hi Guys,

I am trying to import some csv files (50 of them in total) containing panel datasets with 10 cross sections each. I tried to do the following:

Code: Select all

import("text") %file_name @freq W %wkbegin
But what I found out is that the data repeat itself 10 times (using the data when crossid = 1). I notice that if you do import in gui mode, there is a choice of specifying balanced panel (Text Read - Step 4 of 4) and identifying the cross id and date series; but in command mode, I can't find anything about inserting number of cross sections in command reference. Would you please enlighten me as to what I should do here? Thanks a lot!

Tchaithonov

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13600
Joined: Tue Sep 16, 2008 5:38 pm

Re: IMPORT function + Panel

Postby EViews Gareth » Fri Mar 12, 2010 3:43 pm

To replicate the dialog (which requires you have both a date series and a cross-id series in the text file) you can use the Match-Merge form of the import function, using two series as the @ID and @DESTID parts, the first being your cross-id and the second being your date ID with an @date( ) surrounding it. One of the examples in the Match-Merge form is a case like this.

tchaithonov
Posts: 168
Joined: Mon Apr 13, 2009 7:39 am
Location: New York City

Re: IMPORT function + Panel

Postby tchaithonov » Fri Mar 12, 2010 3:51 pm

I think I find the match merge example you were referring to (the 3rd one, I suppose). Let me check it out tonight and will let you know if I still need more help. Thanks for now.

tchaithonov
Posts: 168
Joined: Mon Apr 13, 2009 7:39 am
Location: New York City

Re: IMPORT function + Panel

Postby tchaithonov » Mon Mar 15, 2010 9:06 am

You know, I am looking at this:

Code: Select all

import c:\data\stategdp.txt colhead=3 delim=comma @id states @date(year) @destid states @date
and I replaced it with my data and this is the statement I used in eviews:

Code: Select all

import("text") %file_name delim=comma @id region @date(week) @destid region @date
I received the following error message:
Can't match numeric id series with character id series in "...."
I dug in a little bit more, and it seems that the problem is related to region. My region variable is indeed an alpha series, and it makes sense if the problem is related to matching up region with crossid, which is a numeric series. But I don't understand why it affects my REGION but not the STATES in the example, unless yours is a numeric series. Let me know if you have any clues. Thanks.

Tchaithonov

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13600
Joined: Tue Sep 16, 2008 5:38 pm

Re: IMPORT function + Panel

Postby EViews Gareth » Mon Mar 15, 2010 10:00 am

In the example in the manual, States was an alpha series for both the source and the destination.

When you're matching up series, they have to be the same type and have the same information in them. EViews can't match FRANCE with 03, for example.

If you want to post your workfile and your source data, I'll see if I can figure out how to fix it for you.

tchaithonov
Posts: 168
Joined: Mon Apr 13, 2009 7:39 am
Location: New York City

Re: IMPORT function + Panel

Postby tchaithonov » Mon Mar 15, 2010 10:08 am

so, what you are saying is that the alpha destid needs to exist before anything could be matched. My program creates the workfile according to ui input (@uidialog) and import the file according to the directory given. That means I will need to use a different method to get the region id set first. Let me try on that and see if it works; I will come back to you with the program and file if more need is necessary. Thanks for now.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests