Log differenced data and dummy variable regression
Moderators: EViews Gareth, EViews Moderator
-
KElizabeth925
- Posts: 16
- Joined: Tue Aug 13, 2013 10:30 am
Log differenced data and dummy variable regression
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!
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
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?
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
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.
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
Specify your equation without dummies. Enter the estimation sample as:
where "o" is the name of your oil price series.
Then do the same thing again, but this time put <0.
Code: Select all
@all if dlog(o)>0
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
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?
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
Just include those three terms:
Be careful not to put spaces next to the < and >.
From an econometrics point of view, you're probably close to perfect multicolinearity.
Code: Select all
dlog(oil) dlog(oil)>0 dlog(oil)<0
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
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!!
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
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!
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!
Re: Log differenced data and dummy variable regression
What you really want to do here is run two separate equations: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!
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<0Code: Select all
@all if log_differemce_oil>0So yes, this should work. It should also give you the same result as the setup I proposed above.-->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)?
The reason you were getting the same coefficients (but different sign) is because adding a term like
Code: Select all
dlog(o)>0-
KElizabeth925
- Posts: 16
- Joined: Tue Aug 13, 2013 10:30 am
Re: Log differenced data and dummy variable regression
-->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!
-->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
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
Yes, it is a dummy variable.
Type:
in the EViews command window to view it.
Type:
Code: Select all
show dlog(o)>0
-
KElizabeth925
- Posts: 16
- Joined: Tue Aug 13, 2013 10:30 am
Re: Log differenced data and dummy variable regression
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?
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
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
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
dlog(o(-1))*dlog(o(-1))>0 dlog(o(-2))*dlog(o(-2))>0
If so then that's fine
Who is online
Users browsing this forum: No registered users and 1 guest
