Page 1 of 1
IMPORT function + Panel
Posted: Fri Mar 12, 2010 3:26 pm
by tchaithonov
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
Re: IMPORT function + Panel
Posted: Fri Mar 12, 2010 3:43 pm
by EViews Gareth
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.
Re: IMPORT function + Panel
Posted: Fri Mar 12, 2010 3:51 pm
by tchaithonov
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.
Re: IMPORT function + Panel
Posted: Mon Mar 15, 2010 9:06 am
by tchaithonov
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
Re: IMPORT function + Panel
Posted: Mon Mar 15, 2010 10:00 am
by EViews Gareth
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.
Re: IMPORT function + Panel
Posted: Mon Mar 15, 2010 10:08 am
by tchaithonov
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.