use loop element as table input

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

shuchang
Posts: 29
Joined: Mon Oct 28, 2013 8:00 pm

use loop element as table input

Postby shuchang » Tue Oct 29, 2013 12:34 am

I try to create a table to contain the regression for 10 currencies. The currencies are used to control the loop of the regression (for %1 aud hkd...). Then I want the currencies to occur in the first row so that I know what each equation is. I tried to assign (table(2,1)={%1}). It doesn't work. What can I do?

table(18,11) t_country_ols
t_country_ols(2,1)="C"
t_country_ols(5,1)="EUR"
t_country_ols(8,1)="JPY"
t_country_ols(11,1)="CNY"
t_country_ols(14,1)="CNH"
t_country_ols(17,1)="Adjusted R-squared"
t_country_ols(18,1)="Observations"

!i=2

for %2 s_full 'for the sample loop s_pre2012 s_from2012 s_non_market s_market

smpl {%2}

for %1 aud nzd hkd idr inr krw myr php sgd thb 'for the country loop

equation eq_usd.ls {%1}usd_d c eurusd_d jpyusd_d cnyusd_d cnhusd_d

%currency="{%1}"
t_country_ols(1,!i)=%currency

!i=!i+1

next 'for the country loop
next 'for the sample loop

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

Re: use loop element as table input

Postby EViews Gareth » Tue Oct 29, 2013 8:06 am

Code: Select all

for %1 aud nzd hkd idr inr krw myr php sgd thb 'for the country loop equation eq_usd.ls {%1}usd_d c eurusd_d jpyusd_d cnyusd_d cnhusd_d t_country_ols(1,!i)=%1

shuchang
Posts: 29
Joined: Mon Oct 28, 2013 8:00 pm

Re: use loop element as table input

Postby shuchang » Tue Oct 29, 2013 6:22 pm

Hi Gareth, ha. It works. Man thanks.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest