Control variables to be included in estimation via programming.

For questions regarding programming in the EViews programming language.

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

CySam
Posts: 21
Joined: Thu Mar 27, 2014 10:23 am

Control variables to be included in estimation via programming.

Postby CySam » Wed Feb 08, 2017 1:50 am

Hi,
I wanted to know is there any trick to control the variables to be included in the estimation using programming.
For example, for variables y and x. If I want to include only y(-2) and x(-2) in the estimating equation, i.e. y c y(-2) x(-2).
Or if I want to include y(-3) x(-2) into the equation: y c y(-3) x(-2).

Is there any trick in writing a program so that I can control which variables or which lags only included into the estimation?

Thanks.
Sam

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

Re: Control variables to be included in estimation via programming.

Postby EViews Gareth » Wed Feb 08, 2017 8:25 am

I don't understand this question.

If you want y(-2) and x(-2) as regressors, then use them.
Follow us on Twitter @IHSEViews

CySam
Posts: 21
Joined: Thu Mar 27, 2014 10:23 am

Re: Control variables to be included in estimation via programming.

Postby CySam » Mon Feb 13, 2017 12:47 am

Sorry for my unclear question. Let's consider the case:
By writing a program code, I write out the general equation in my program, e.g. equation.ls y c y(-1) y(-2) y(-3) y(-4) x(-1) x(-2) x(-3) x(-4)
Next, I wish to use the general equation to run several estimation by controlling the variables or lag length. For example, for a sample sets, we know that only y(-2) and x(-3) are found to be significant. Thus, I wish to estimate the equation by including only the variables y(-2) and x(-3).

I don't wish to specify several possible cases of the equations like specifying
if lagy = 1 then
equation.ls y c y(-1) x(-1) x(-2) x(-3) x(-4)
else if lagy = 2 then
equation.ls y c y(-1) y(-2) x(-1) x(-2) x(-3) x(-4)
and etc.

I don't wish to writing the program code as above as it would be very tedious and complicated for my specific case. I wish to only using the general equation and (or) use the program argument to manipulate the estimating equation.

Therefore, my question is is there any tricks that I can control the including variables for the estimation by using the general equation?
Thanks!

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

Re: Control variables to be included in estimation via programming.

Postby EViews Gareth » Mon Feb 13, 2017 5:04 pm

It still isn't very clear - How will the automated process know that after estimating:

Code: Select all

y c y(-1) y(-2) y(-3) y(-4) x(-1) x(-2) x(-3) x(-4)


The next estimation is just:

Code: Select all

y c y(-2) x(-3)


Perhaps if you can explain the logic behind what you are doing, we can explain how to do it.


But, as an aside, you can specify an equation as:

Code: Select all

y c y(-1 to !lagy)
Follow us on Twitter @IHSEViews

CySam
Posts: 21
Joined: Thu Mar 27, 2014 10:23 am

Re: Control variables to be included in estimation via programming.

Postby CySam » Tue Feb 14, 2017 11:37 am

Hi, thanks for your patient on my problem.
Actually I am writing a bootstrap method program. Before going to the bootstrap step, I need to estimate an equation and save the coefficients of the estimating variables.

My problem here is that, I have no idea how to come out a program code that can control which lag of the variables to be included into the equation. If I don't use the program, I know I can use the default software by simply clicking on the button 'quick' then 'estimate equation' and then just simply declare the variables to be estimated, eg. y c y(-2) x(-3). But in programming, I know I couldn't.

As your suggestion, I can come out the equation as:
y c y(-1 to !lagy) x(-1 to !lagx)
and define the numbers for !lagy and !lagx.

However, this will include those lags between the range into the equation. Example, if I declare !lagy = 2 and !lagx = 3, then the equation will be estimated as y c y(-1) y(-2) x(-1) x(-2) x(-3). Here I wish to include those significant lag of the variables into the equation, for example, only y(-2) and x(-3): y c y(-2) x(-3).

Is there any tricks or ways for me to estimating the specific equation flexibly?

Your helps are well-appreciated.

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

Re: Control variables to be included in estimation via programming.

Postby EViews Gareth » Tue Feb 14, 2017 4:30 pm

Since there is no logic to the specification, there is not way to automate it.
Follow us on Twitter @IHSEViews


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 34 guests