VAR - specifying number of lags by referring to scalar/...

For questions regarding programming in the EViews programming language.

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

EllenEv
Posts: 2
Joined: Sat Jul 05, 2014 5:30 am

VAR - specifying number of lags by referring to scalar/...

Postby EllenEv » Fri Oct 17, 2014 8:09 am

Hi,

I was wondering whether there is a way to specify the number of lags in a VAR in, say, a scalar (or any other object), and then to refer to it in the code?

Something like:

----------------------------
scalar L=3

Var test.ls 1 L variable1 variable2
---------------------------

Obviously the above is not working, otherwise I wouldn't have to post this thread :).

I have a lot of different VARs to estimate and this would make putting the results in tables so much more efficient.

Thanks!

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

Re: VAR - specifying number of lags by referring to scalar/.

Postby EViews Gareth » Fri Oct 17, 2014 8:14 am

Normally you'd use a program variable rather than a scalar object, so it would be:

Code: Select all

!L=3 Var test.ls 1 !L variable1 variable2
But if you really want to use a scalar object, you can do:

Code: Select all

scalar L=3 Var test.ls 1 {L} variable1 variable2


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests