Page 1 of 1

use loop element as table input

Posted: Tue Oct 29, 2013 12:34 am
by shuchang
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

Re: use loop element as table input

Posted: Tue Oct 29, 2013 8:06 am
by EViews Gareth

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

Re: use loop element as table input

Posted: Tue Oct 29, 2013 6:22 pm
by shuchang
Hi Gareth, ha. It works. Man thanks.