Write command and dateid

For notifying us of what you believe are bugs or errors in EViews.
Please ensure your copy of EViews is up-to-date before posting.

Moderators: EViews Gareth, EViews Moderator

J_Gascoigne
Posts: 13
Joined: Wed Apr 10, 2013 8:56 am
Location: London, UK

Write command and dateid

Postby J_Gascoigne » Tue Jul 30, 2013 9:33 am

Hi, this is a really tiny bug, but thought I would post it.

When using a balanced pannel workfile with integer dates (EViews 8, 32 bit), I can write to a csv using a command like this:

write(t=txt,na="",d=c,dates) “C:\My_CSV.csv” Var1 Var2 Var3

However, this doesn't give me a CSV with 4 "columns" - the date and the three variables. Ideally, I would like the first "column" to be the cross section, then the date, then the variables, i.e exactly the format you get if you used the write command from a pool object with cross section identifiers in a time seires file. (I can't find an option to do this with the workfile write command, apologies if there is a simple one I have missed).

My solution was to try:

write(t=txt,na="",d=c,nodates) “C:\My_CSV.csv” Crossid Dateid Var1 Var2 Var3

However, the dateid doesn't come out as expected, I get a lot of numbers slightly higher than -1 (to 4dps). My work around is to use:

series trend=@trend+1
write(t=txt,na="",d=c,nodates) “C:\My_CSV.csv” Crossid trend Var1 Var2 Var3

And this works fine, gives exactly the same format as with the Pool write function. So it is hardly a huge problem but thought I would report nonetheless incase others have similar problems trying to get a harmonised output across the two different formats for time-series/cross-section data.

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

Re: Write command and dateid

Postby EViews Gareth » Tue Jul 30, 2013 10:03 am

There's really no reason to be using the write command in EViews 8. You should be using wfsave instead.
Follow us on Twitter @IHSEViews

J_Gascoigne
Posts: 13
Joined: Wed Apr 10, 2013 8:56 am
Location: London, UK

Re: Write command and dateid

Postby J_Gascoigne » Fri Aug 02, 2013 2:59 am

Thanks for this suggestion (I'm revisiting coding in EViews after not having done much since EViews 6 so not terribly familiar with the version changes).

However, the dateid series still does not export correctly. For a balanced pannel with integer dates, the dateid series correctly goes through 1, 2, 3, 4 etc and then repeats for the next cross section. When exported afterwards using wfsave it still has -1 in every field, as with the write command.

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

Re: Write command and dateid

Postby EViews Gareth » Fri Aug 02, 2013 8:36 am

ok, then that's a bug :D
Follow us on Twitter @IHSEViews

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

Re: Write command and dateid

Postby EViews Gareth » Fri Aug 02, 2013 9:47 am

Might take us a while to fix this one. Best bet in the mean time is to create your own id:

Code: Select all

create u 1 100 10
series myid = @cellid
wfsave(t=excel) c:\temp\myfile.xls @drop dateid
Follow us on Twitter @IHSEViews

J_Gascoigne
Posts: 13
Joined: Wed Apr 10, 2013 8:56 am
Location: London, UK

Re: Write command and dateid

Postby J_Gascoigne » Mon Aug 05, 2013 2:15 am

Hi - thanks for the work around. Like I say it is a really tiny bug, hardly a huge problem but thought I would post it nonetheless.

The value for me in it is that, if fixed, it is easy to get an identical output of data, whether you are using a pooled model with series that have cross sectional identifiers, or using the pannel workfile format. Of course, the work around is not massively arduous!


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 45 guests