IF functions in economic models

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

jmurray804
Posts: 6
Joined: Fri Jun 10, 2016 8:37 am

IF functions in economic models

Postby jmurray804 » Fri Jun 10, 2016 8:48 am

Easy question for you Eviews geniuses.

Let's say the the central bank is more responsive when the output gap is wide.

I'd love to code that up in my small model using an IF function but I've no idea of the right syntax - searching for if in the forum naturally returns rather a lot of articles.

Basically something like:

IF y<-2, i = 4 + 1.5*y + 1.5*inf
ELSE i = 4 + 0.5*y + 1.5*inf

Where i is the policy rate, y is the output gap and inf is the deviation of inflation from target.

A quick pointer would be much appreciated.

Best,

Jamie

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

Re: IF functions in economic models

Postby EViews Gareth » Fri Jun 10, 2016 8:54 am

@recode
http://www.eviews.com/help/helpintro.ht ... tions.html

Code: Select all

series i = @recode(y<-2, 4 + 1.5*y + 1.5*inf, 4 + 0.5*y + 1.5*inf)

jmurray804
Posts: 6
Joined: Fri Jun 10, 2016 8:37 am

Re: IF functions in economic models

Postby jmurray804 » Fri Jun 10, 2016 9:04 am

That's fantastic, thanks so much for the swift reply.


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 2 guests