Connecting if statement with a table
Posted: Tue Aug 06, 2019 2:01 am
Hey there,
I am trying to describe a logical process using EViews. I would do with a bit of advice. Is it possible to do the following?
I have 5 series that I use as explanatory variables for an equation: x1, x2, x3, x4, and x5. Each series is filled with natural numbers from 1 to 10. After some analysis I have generated the following table:
x3 7
x1 3
x5 10
x4 1
x5 4
x2 3
. .
. .
Somehow I would like to describe the following process:
smpl 2000m01 smpl2000m01
to select table(1,1) and check whether series x3 = 7,
if not
select x1 and check whether x1=3
if not
select x5 and check whether x5=10
and so on until it returns "true"
for example x2 = 3, "true"
eq1.ls y c x2
after that, I would like to repeat it for the next observation which would not be a problem. The main problem is to create that logic which would check which explanatory variable to use for a certain observation.
Thank you in advance! I would appreciate any suggestion!:)
I am trying to describe a logical process using EViews. I would do with a bit of advice. Is it possible to do the following?
I have 5 series that I use as explanatory variables for an equation: x1, x2, x3, x4, and x5. Each series is filled with natural numbers from 1 to 10. After some analysis I have generated the following table:
x3 7
x1 3
x5 10
x4 1
x5 4
x2 3
. .
. .
Somehow I would like to describe the following process:
smpl 2000m01 smpl2000m01
to select table(1,1) and check whether series x3 = 7,
if not
select x1 and check whether x1=3
if not
select x5 and check whether x5=10
and so on until it returns "true"
for example x2 = 3, "true"
eq1.ls y c x2
after that, I would like to repeat it for the next observation which would not be a problem. The main problem is to create that logic which would check which explanatory variable to use for a certain observation.
Thank you in advance! I would appreciate any suggestion!:)