Export group to Excel
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
Export group to Excel
I constructed a group object from panel data objects. When I export the group to Excel with the following statement, the observation ID (date+cross section) is missing. How do I change that?
wfsave(type=excelxml) {%tableloc}state_backtest.xlsx range="forecast!b1" @smpl {%graph_sample} @keep __g_backtest
wfsave(type=excelxml) {%tableloc}state_backtest.xlsx range="forecast!b1" @smpl {%graph_sample} @keep __g_backtest
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13585
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Export group to Excel
Put the id series into the group.
When you tell EViews to just keep a group it literally only keeps the series in that group.
When you tell EViews to just keep a group it literally only keeps the series in that group.
Re: Export group to Excel
If the reason behind export failing to include observation ID is because the group does not retain it, then the following statement should do it:
wfsave(type=excelxml) {%tableloc}state_backtest.xlsx range="actual!a1" @keep {%varlist} @smpl {%graph_sample}
where %varlist is a list of panel data series. But this statement did not produce observation ID either in the Excel table either. The problem seems to lie with exporting panel data to Excel.
wfsave(type=excelxml) {%tableloc}state_backtest.xlsx range="actual!a1" @keep {%varlist} @smpl {%graph_sample}
where %varlist is a list of panel data series. But this statement did not produce observation ID either in the Excel table either. The problem seems to lie with exporting panel data to Excel.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13585
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Export group to Excel
Code: Select all
wfcreate a 1990 2000 10
alpha mycrosssections = "myid" + @str(@crossid)
alpha mydates = @datestr(@date, "YYYY")
series y=@nrnd
group g mydates mycrosssections y
wfsave(type=excelxml) myfile.xlsx @keep g
Re: Export group to Excel
Great. It seems to me that I need to add the date and the cross section explicitly to the group.
Given a panel data series, how do I extract its date and cross section?
Given a panel data series, how do I extract its date and cross section?
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13585
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Export group to Excel
Code: Select all
alpha mycrosssections = "myid" + @str(@crossid)
alpha mydates = @datestr(@date, "YYYY")
Re: Export group to Excel
My panel data series is indexed by state abbreviation and date such as "AK - 50Q1". @crossid gives me index 1, ..., 50, rather than state abbreviation. How do I obtain the latter?
@PAGEIDS gives an error message: @PAGEIDS is not a Genr or series expression function.
@PAGEIDS gives an error message: @PAGEIDS is not a Genr or series expression function.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13585
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Export group to Excel
I'm a bit confused - do you know the name the of your cross-section identifier?
Re: Export group to Excel
The name of my cross section id is _P. For instance if I want to select a sample from the state of Alaska, I issue the following statement:
smpl 2008 2010 if _P="AK"
Eviews documentation on series object does not contain a lot of information on panel data series. Can you point me to some good reference?
smpl 2008 2010 if _P="AK"
Eviews documentation on series object does not contain a lot of information on panel data series. Can you point me to some good reference?
Re: Export group to Excel
I also wish to know how to extract a particular data point from my panel data series X. For instance, I wish to assign the value of the series value at 2010Q2 for the cross section of "AK" to a scalar. How do I reference that data point?
Re: Export group to Excel
For a series without cross section, I can obtain the value at any date with @elem(X, "2010Q2"). When the series is a panel, I get the error message: "Date does not uniquely define observation in panels".
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13585
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Export group to Excel
So just include _p in the group?The name of my cross section id is _P. For instance if I want to select a sample from the state of Alaska, I issue the following statement:
smpl 2008 2010 if _P="AK"
Re: Export group to Excel
Gareth, thank you. That worked!
My mistake is that I kept on thinking that cross section ID is attribute of a panel data series. It is actually an object of the panel data workfile, in which all series have the same cross section ID.
My mistake is that I kept on thinking that cross section ID is attribute of a panel data series. It is actually an object of the panel data workfile, in which all series have the same cross section ID.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13585
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Export group to Excel
There is no @elem for panels, unfortunately. You'll have to set the sample to the observation you want, then use @max or something to extract the value.I also wish to know how to extract a particular data point from my panel data series X. For instance, I wish to assign the value of the series value at 2010Q2 for the cross section of "AK" to a scalar. How do I reference that data point?
Who is online
Users browsing this forum: No registered users and 0 guests
