Exporting R-SQU to Excel

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator

BCNAV
Posts: 17
Joined: Tue Oct 31, 2017 9:06 am

Exporting R-SQU to Excel

Postby BCNAV » Tue Nov 14, 2017 9:28 am

I am running a batch of ARIMAs:

Code: Select all

genr tot_ecu_hf=0
group a_results
for %series {%vars}
   smpl @first %history_end_date
   freeze(mode=overwrite,{%series}_stats) {%series}.autoarma(tform=auto,diff=2,select=aic,periods=12,kpsssig=5,eqname={%series}_eq,maxar=4,maxma=3,maxsar=1,maxsma=1,seed=131071,forclen={!fcst_length},etable,agraph,atable,fgraph) forecast
   
   'Tidy up variable names so that they are named properly and all data stored where you want, could have done {%series}_f above instead of forecast, but below permits custom variable names and content
   smpl %forecast_start_date %forecast_end_date
      genr {%series}_f=forecast
   smpl @all
      genr {%series}_hf={%series}
   smpl %forecast_start_date %forecast_end_date
      {%series}_hf={%series}_f

   group a_results a_results {%series}_hf

   smpl @all
      tot_ecu_hf=tot_ecu_hf+{%series}_hf
   smpl @first %history_end_date

next
delete forecast
smpl @all
group a_results a_results tot_ecu_hf


I need to be able to export the r-square from each model to Excel, which will be linked to another Excel later. Any ideas on the best way to do this? Perhaps a table? Or direct export?

thanks

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

Re: Exporting R-SQU to Excel

Postby EViews Gareth » Tue Nov 14, 2017 9:29 am

Store them into a matrix, then save the matrix as a xls
Follow us on Twitter @IHSEViews

BCNAV
Posts: 17
Joined: Tue Oct 31, 2017 9:06 am

Re: Exporting R-SQU to Excel

Postby BCNAV » Tue Nov 14, 2017 10:35 am

Thanks...I had tried a table, but EViews still cannot export an excel table. Only CSV, and CSV won't work for linking to another XLS. Any reason why this has not been added to EViews?

In any case, how would the matrix work? I tried:

Code: Select all

matrix a_rsq2
!rowcount=1
for %series {%vars}
   smpl @first %history_end_date
   freeze(mode=overwrite,{%series}_stats) {%series}.autoarma(tform=auto,diff=2,select=aic,periods=12,kpsssig=5,eqname={%series}_eq,maxar=4,maxma=3,maxsar=1,maxsma=1,seed=131071,forclen={!fcst_length},etable,agraph,atable,fgraph) forecast
   
   'Tidy up variable names so that they are named properly and all data stored where you want, could have done {%series}_f above instead of forecast, but below permits custom variable names and content
   smpl %forecast_start_date %forecast_end_date
      genr {%series}_f=forecast
   smpl @all
      genr {%series}_hf={%series}
   smpl %forecast_start_date %forecast_end_date
      {%series}_hf={%series}_f

   group a_results a_results {%series}_hf

   smpl @all
      tot_ecu_hf=tot_ecu_hf+{%series}_hf
   smpl @first %history_end_date


   'Populate table of Variable Name & R-Squareds
   a_rsq({!rowcount},1)={%series}.@displayname
   a_rsq({!rowcount},2)={%series}_eq.@r2

   'Populate maxtrix of R-Squareds Only for Export to Excel
   a_rsq2({!rowcount},1)={%series}_eq.@r2
   !rowcount=!rowcount+1
next


I get an error saying 2,1 is not valid for a matrix.

thanks

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

Re: Exporting R-SQU to Excel

Postby EViews Gareth » Tue Nov 14, 2017 10:51 am

You have to size the matrix when you create it.
Follow us on Twitter @IHSEViews


Return to “Programming”

Who is online

Users browsing this forum: Bing [Bot] and 5 guests