FOR LOOP

For posting your own programs to share with others

Moderators: EViews Gareth, EViews Moderator

gansuld
Posts: 9
Joined: Thu Jun 26, 2014 6:23 pm

FOR LOOP

Postby gansuld » Tue Apr 11, 2017 5:12 am

I have the following formula,
frml r_l_loan_bs = l_loan_bs - l_cpi

How to write FOR loop above formula in case of many variables?

Actually, I have written like this

frml r_l_loan_bs = l_loan_bs - l_cpi
for %x l_loan_min l_loan_agr l_loan_manu l_loan_elec l_loan_cons l_loan_trade l_loan_ser
frml r_{%x} = {%x} - l_cpi

But it didn't work. Please help me!

The Yoyo
Posts: 9
Joined: Thu Apr 04, 2013 2:30 pm

Re: FOR LOOP

Postby The Yoyo » Tue Apr 11, 2017 5:37 am

Not sure what frml is, why not use genr?

Something like:

Code: Select all

genr r_l_loan_bs = l_loan_bs - l_cpi
for %x l_loan_min l_loan_agr l_loan_manu l_loan_elec l_loan_cons l_loan_trade l_loan_ser
genr r_{%x} = {%x} - l_cpi
next

gansuld
Posts: 9
Joined: Thu Jun 26, 2014 6:23 pm

Re: FOR LOOP

Postby gansuld » Tue Apr 11, 2017 5:51 am

Thanks!


Return to “Program Repository”

Who is online

Users browsing this forum: No registered users and 4 guests