Programming error messages from Eviews, Help!!!
Posted: Fri Aug 20, 2010 2:10 am
To illustrate the problems I have with Eviews, I create the following example.
Suppose I have a number of models to regress. For simplicity, I take the case of 4 models.
%m1=”y c x1”
%m2=”y c x1 x2”
%m3=”y c x1 x2 x3”
%m4=”y c x1 x2 x3 x4 x5 x6 x7”
To run all of these models in my program by OLS, I simply write
Equation eq1.ls {%m1}
Equation eq2.ls {%m2}
Equation eq3.ls {%m3}
Equation eq4.ls {%m4}
These work quite well in Eviews. However, as a matter of fact, I have many more than 4 models and they all look much more complicated than above-listed. As a result, I want to “generalize” the process by putting them into a for..next loop. Unfortunately, this does not work at all.
Particularly, I tried the following cases in Eviews, but all I receive are error messages:
Case 1 when I want to regress all the models
For !i=1 to 4
Equation eq1.ls {%m!i}
next
Case 2 When I want to regress selected models. Say when I want to regress model 3 only
!criterion=3
For !i=1 to 4
If !i=!criterion then
Equation eq1.ls {%m{!i}}
Endif
Next
Case 3 Since Eviews seems not to accept “}}”, I insert an intermediate variable “%temp”, but it does not work either.
!criterion=3
For !i=1 to 4
If !i=!criterion then
%temp=%m{!}
Equation eq1.ls {%temp}
Endif
next
To deal with these problems, I have the only option to put equations in “If…endif”
Say
If !criterion=1 then
Equation eq1.ls {%m1}
Endif
If !criterion=2 then
Equation eq1.ls {%m2}
Endif
If !criterion=3 then
Equation eq1.ls {%m3}
Endif
If !criterion=4 then
Equation eq1.ls {%m4}
Endif
Imagine if you have tens or even hundreds of models, It is cumbersome to list them in that way. It is the best to use the for..next loop. However, I fail to do that in Eviews. Does anyone have any good ideas to solve these problems. Thank you very much in advance.
Sincerely,
Bac
Nguyenxuanbac@yahoo.com
Moreover, among many minor programming problems, my following two programs do not work at all .
Program 1
%m=”equation besteq.ls y c x1”
{%m}
Program 2
%m=”equation besteq.ls y c x1”
{{%m}}
Eviews seem does not accept this manner. I wonder if Eviews 7.0 has improved these functionalities or not.
Suppose I have a number of models to regress. For simplicity, I take the case of 4 models.
%m1=”y c x1”
%m2=”y c x1 x2”
%m3=”y c x1 x2 x3”
%m4=”y c x1 x2 x3 x4 x5 x6 x7”
To run all of these models in my program by OLS, I simply write
Equation eq1.ls {%m1}
Equation eq2.ls {%m2}
Equation eq3.ls {%m3}
Equation eq4.ls {%m4}
These work quite well in Eviews. However, as a matter of fact, I have many more than 4 models and they all look much more complicated than above-listed. As a result, I want to “generalize” the process by putting them into a for..next loop. Unfortunately, this does not work at all.
Particularly, I tried the following cases in Eviews, but all I receive are error messages:
Case 1 when I want to regress all the models
For !i=1 to 4
Equation eq1.ls {%m!i}
next
Case 2 When I want to regress selected models. Say when I want to regress model 3 only
!criterion=3
For !i=1 to 4
If !i=!criterion then
Equation eq1.ls {%m{!i}}
Endif
Next
Case 3 Since Eviews seems not to accept “}}”, I insert an intermediate variable “%temp”, but it does not work either.
!criterion=3
For !i=1 to 4
If !i=!criterion then
%temp=%m{!}
Equation eq1.ls {%temp}
Endif
next
To deal with these problems, I have the only option to put equations in “If…endif”
Say
If !criterion=1 then
Equation eq1.ls {%m1}
Endif
If !criterion=2 then
Equation eq1.ls {%m2}
Endif
If !criterion=3 then
Equation eq1.ls {%m3}
Endif
If !criterion=4 then
Equation eq1.ls {%m4}
Endif
Imagine if you have tens or even hundreds of models, It is cumbersome to list them in that way. It is the best to use the for..next loop. However, I fail to do that in Eviews. Does anyone have any good ideas to solve these problems. Thank you very much in advance.
Sincerely,
Bac
Nguyenxuanbac@yahoo.com
Moreover, among many minor programming problems, my following two programs do not work at all .
Program 1
%m=”equation besteq.ls y c x1”
{%m}
Program 2
%m=”equation besteq.ls y c x1”
{{%m}}
Eviews seem does not accept this manner. I wonder if Eviews 7.0 has improved these functionalities or not.