Page 1 of 1

Write command and dateid

Posted: Tue Jul 30, 2013 9:33 am
by J_Gascoigne
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.

Re: Write command and dateid

Posted: Tue Jul 30, 2013 10:03 am
by EViews Gareth
There's really no reason to be using the write command in EViews 8. You should be using wfsave instead.

Re: Write command and dateid

Posted: Fri Aug 02, 2013 2:59 am
by J_Gascoigne
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.

Re: Write command and dateid

Posted: Fri Aug 02, 2013 8:36 am
by EViews Gareth
ok, then that's a bug :D

Re: Write command and dateid

Posted: Fri Aug 02, 2013 9:47 am
by EViews Gareth
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

Re: Write command and dateid

Posted: Mon Aug 05, 2013 2:15 am
by J_Gascoigne
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!