VAR Code for 3-year Net Increase

For questions regarding programming in the EViews programming language.

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

KElizabeth925
Posts: 16
Joined: Tue Aug 13, 2013 10:30 am

VAR Code for 3-year Net Increase

Postby KElizabeth925 » Tue Aug 20, 2013 2:21 am

Hello-

I am running a VAR using quarterly data, lag length of 5 quarters, where the dependent variables are: d(lgdp) [differenced log GDP] and d(loil) [differenced log oil prices].
As an additional, exogenous variable, I would like to add lags of an oil-price increase measure, call it o#. This measure is specified such that o# denotes the amount that log oil prices in quarter x exceed their value over the past 12 quarters, and if they do not exceed this peak value, then o# takes on a value of zero.

Is there any way to specify this in Eviews, or is this something I should do in Excel?
Please let me know if I can clarify my procedure at all--otherwise thanks very much for your help!

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

Re: VAR Code for 3-year Net Increase

Postby EViews Gareth » Tue Aug 20, 2013 8:03 am

Code: Select all

series ohash = @recode(log(oil)>@movmax(log(oil(-1)),12), log(oil)-@movmax(log(oil(-1)),12), 0)
or something like that.

KElizabeth925
Posts: 16
Joined: Tue Aug 13, 2013 10:30 am

Re: VAR Code for 3-year Net Increase

Postby KElizabeth925 » Tue Sep 03, 2013 3:41 am

Great-thank you.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests