Log differenced data and dummy variable regression

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

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

Log differenced data and dummy variable regression

Postby KElizabeth925 » Tue Aug 13, 2013 10:54 am

Hello all-

I am trying to estimate the following ARDL equation: y= a + y(t-i) +o(t-i) +u, where y=quarterly log differenced US GDP and o is quarterly log differenced oil prices (data are all quarterly and lag length=5):
-->I am having an issue with my specification in Eviews for the functional form of "o" : my model is such that oil prices only matter if the log-differenced value is >0. In order to estimate the equation, I have first created a series that is log-differenced oil prices (log_difference_oil). I then created a series for dummy variables, where dummy=1 if log_difference_oil>1.

-->to run the regression accurately, do I specify "log_difference_oil*dummy" as the explanatory variable of oil prices? And then, to account for the lagged data, shall I code it as "log_difference_oil(-1)*dummy(-1)" ..."log_difference_oil(-2)*dummy(-2)?

Is there another way to code the regression such that I do not need to create a new series that reflects the log-differenced oil prices, but rather the code will reflect the fact I want only positive log-differences from the log-oil price series proper?

Just want to make sure that this coding is accurately reflecting what I am trying to accomplish econometrically.
Help very much appreciated--thanks!

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

Re: Log differenced data and dummy variable regression

Postby EViews Gareth » Tue Aug 13, 2013 10:58 am

It isn't clear what you're trying to do here.

Do you only want to include observations for which log-difference > 0?

Or do you want to estimate different coefficients depending on whether log-difference is > 0 or not?

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

Re: Log differenced data and dummy variable regression

Postby KElizabeth925 » Tue Aug 13, 2013 11:11 am

Thanks for your reply. I would like to do both:

Firstly, I would only like to include those observations for which the log-difference is >0.
For example, if in 1953Q:2 the log-difference is 0.14, I would like that observation to be included in the regression.
If, instead, the log-difference is -0.14, I do not want it included in the regression.

After I have that regression sorted, I would then like to estimate a second, "opposite," regression, for which I would only like to include those observations for which the log-difference is negative. At that point I imagine (and hope) the coefficients would be different.

Hope this clarifies...if not please let me know.
Thanks again.

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

Re: Log differenced data and dummy variable regression

Postby EViews Gareth » Tue Aug 13, 2013 11:54 am

Specify your equation without dummies. Enter the estimation sample as:

Code: Select all

@all if dlog(o)>0
where "o" is the name of your oil price series.

Then do the same thing again, but this time put <0.

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

Re: Log differenced data and dummy variable regression

Postby KElizabeth925 » Tue Aug 13, 2013 12:39 pm

Brilliant-thanks very much.

I would like to now include three oil price variables: dlog(oil) as it is; dlog(oil) >0; and dlog(oil)<0
Essentially, I am now looking to see the magnitude of each coefficient w/in the same regression.

How best to specify this equations--I assume @all will not work in this case?

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

Re: Log differenced data and dummy variable regression

Postby EViews Gareth » Tue Aug 13, 2013 1:01 pm

Just include those three terms:

Code: Select all

dlog(oil) dlog(oil)>0 dlog(oil)<0
Be careful not to put spaces next to the < and >.


From an econometrics point of view, you're probably close to perfect multicolinearity.

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

Re: Log differenced data and dummy variable regression

Postby KElizabeth925 » Tue Aug 13, 2013 1:18 pm

Right-I'm going to run several variations of this model (next will be to put it into a VAR) but am aware of the possibility of multicolinearity with that particular one-thanks for the heads up though.

Your comments are much simpler to follow and make more sense than trying to create a dummy variable series-thank you!!

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

Re: Log differenced data and dummy variable regression

Postby KElizabeth925 » Mon Aug 19, 2013 7:24 am

EViews Gareth:

I ran into an issue using the specification/code that you had posted here, regarding the oil price increases/decreases:
I ran two separate VARs, both with log-differenced GDP and real oil prices as the endogenous variables. In addition, for each regression, I included lagged values if the following exogenous variables:
Regression 1: dlog(oil)>0 (so only positive oil growth counts), and
Regression 2: dlog(oil)<0 (so only negative oil growth counts)

-->I got coefficients of the exact same magnitude, but of opposite sign, for each regression. I know this is not economically feasible, so wondering what could be going on with Eviews...
-->In addition, I ran the exact same code using a different oil price series w/in the VAR framework, and did NOT run into this problem (ie. got different coefficient estimates altogether, different magnitude, different signs, as I'd expect).
Help!

jason_ll
Posts: 43
Joined: Thu Sep 01, 2011 11:38 am

Re: Log differenced data and dummy variable regression

Postby jason_ll » Mon Aug 19, 2013 10:24 am

Hello all-

I am trying to estimate the following ARDL equation: y= a + y(t-i) +o(t-i) +u, where y=quarterly log differenced US GDP and o is quarterly log differenced oil prices (data are all quarterly and lag length=5):
-->I am having an issue with my specification in Eviews for the functional form of "o" : my model is such that oil prices only matter if the log-differenced value is >0. In order to estimate the equation, I have first created a series that is log-differenced oil prices (log_difference_oil). I then created a series for dummy variables, where dummy=1 if log_difference_oil>1.

-->to run the regression accurately, do I specify "log_difference_oil*dummy" as the explanatory variable of oil prices? And then, to account for the lagged data, shall I code it as "log_difference_oil(-1)*dummy(-1)" ..."log_difference_oil(-2)*dummy(-2)?

Is there another way to code the regression such that I do not need to create a new series that reflects the log-differenced oil prices, but rather the code will reflect the fact I want only positive log-differences from the log-oil price series proper?

Just want to make sure that this coding is accurately reflecting what I am trying to accomplish econometrically.
Help very much appreciated--thanks!
What you really want to do here is run two separate equations:
1. One where the log_difference_oil is always positive
2. One where it's always negative

So you run the exact same regression (equation), but you run it twice, and it's a different sample each time.

The first time, you set the sample as:

Code: Select all

@all if log_difference_oil<0
and the second time you set it as

Code: Select all

@all if log_differemce_oil>0
If your hypothesis is correct (that oil price only matters if the price is growing), then the first equation will have a non-statistically significant coefficient, while the second one will.
-->to run the regression accurately, do I specify "log_difference_oil*dummy" as the explanatory variable of oil prices? And then, to account for the lagged data, shall I code it as "log_difference_oil(-1)*dummy(-1)" ..."log_difference_oil(-2)*dummy(-2)?
So yes, this should work. It should also give you the same result as the setup I proposed above.

The reason you were getting the same coefficients (but different sign) is because adding a term like

Code: Select all

dlog(o)>0
to the equation will simply add a dummy variable equal to 1 if dlog(o)>0, and 0 otherwise. It won't let you measure how the change in oil prices affects GDP.

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

Re: Log differenced data and dummy variable regression

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

-->Regarding the @all command: I want to run two VARs, where I've got differenced GDP[d(lgdp)] and differenced oil prices[d(loil)] (as they are) as endogenous variables. As additional exogenous variables, I need to include 1) log_difference_oil>0, and then a second VAR where 2)log_difference_oil<0.
-->the @all specification you gave me only allows me to include only positive, or only negative, log differences for oil. How do I code a VAR to allow me to use both d(loil) (including both positive and negative growth) and differenced_oil prices (including only positive growth[and then including only negative growth]) in the same sample?


Thank you!

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

Re: Log differenced data and dummy variable regression

Postby KElizabeth925 » Wed Aug 21, 2013 9:23 am

Can someone confirm that this command: dlog(o)>0 is indeed =1 and so a dummy variable for the said specification, rather than a variable which measures the actual positive log-difference effect on GDP? Have gotten conflicting responses. Thanks

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

Re: Log differenced data and dummy variable regression

Postby EViews Gareth » Wed Aug 21, 2013 9:31 am

Yes, it is a dummy variable.

Type:

Code: Select all

show dlog(o)>0
in the EViews command window to view it.

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

Re: Log differenced data and dummy variable regression

Postby KElizabeth925 » Wed Aug 21, 2013 9:47 am

Okay, so in order to account for the magnitude of the effect of positive log-differenced oil on log-differenced GDP, would I then just input:

dlog(o(-1))*dlog(o(-1))>0 dlog(o(-2))*dlog(o(-2))>0

And so on for each lag, into the "exogenous variables" box under the VAR specification tab?

startz
Non-normality and collinearity are NOT problems!
Posts: 3796
Joined: Wed Sep 17, 2008 2:25 pm

Re: Log differenced data and dummy variable regression

Postby startz » Wed Aug 21, 2013 9:54 am

You probably need some parentheses in the expression.

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

Re: Log differenced data and dummy variable regression

Postby KElizabeth925 » Wed Aug 21, 2013 10:06 am

Eviews allowed me to run the VAR w/out extra parentheses, though gave results I was not expecting and not sure they are accurate...just checking that my specification mentioned before is correct in measuring the magnitude of positive log-differences.


dlog(o(-1))*dlog(o(-1))>0 dlog(o(-2))*dlog(o(-2))>0

If so then that's fine


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 2 guests