Page 1 of 1

VAR Code for 3-year Net Increase

Posted: Tue Aug 20, 2013 2:21 am
by KElizabeth925
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!

Re: VAR Code for 3-year Net Increase

Posted: Tue Aug 20, 2013 8:03 am
by EViews Gareth

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.

Re: VAR Code for 3-year Net Increase

Posted: Tue Sep 03, 2013 3:41 am
by KElizabeth925
Great-thank you.