I am trying to draw the relationship between trading volume and unconditional volatility. For this purpose I am using the following equation:
log(Vt )= α + β1 Rt^2 + β2 Dt Rt^2
Where,
Vt is volume at time 't',
Rt is return at time 't' and,
Dt = 1 when Rt<0 and D=0 when Rt≥0.
For the dummy variable Dt, I am unable to insert the appropriate code into EViews. I had a look at the EViews guide but I am unable to construct the dummy variable with the required condition (highlighted).
I wanted to know if it is correct if I put the data into EXCEL and with the help of the 'IF' statement, I construct the table for the dummy variables and then import into EViews (for each individual stock) and run the OLS regression. Will it yield the correct coefficients? I tried to do one for an example and I would appreciate it if you could advise me whether it has been done correctly. If so, I can carry on with the rest of my tests and analysis accordingly.
A sample of the EXCEL file is attached above with the corresponding data (for one stock from the index) and the OLS regression output. I have run the OLS with the equation as given above. I would appreciate it much if you could have a look at this and advise me if I am on the right track.
Dummy Variables in OLS
Moderators: EViews Gareth, EViews Moderator
-
keshav.jayant
- Posts: 6
- Joined: Sat Jul 25, 2009 3:19 pm
Dummy Variables in OLS
- Attachments
-
- EXAMPLE OUTPUT.xlsx
- Contains both the data and the estimation output
- (60.21 KiB) Downloaded 550 times
-
startz
- Non-normality and collinearity are NOT problems!
- Posts: 3797
- Joined: Wed Sep 17, 2008 2:25 pm
Re: Dummy Variables in OLS
one method
D is a reserved word and shouldn't be used as a variable name.
Code: Select all
series dummy = @recode(r<0,1,0)-
keshav.jayant
- Posts: 6
- Joined: Sat Jul 25, 2009 3:19 pm
Re: Dummy Variables in OLS
Hi,
Thanks for your reply. So inorder to compute the OLS for this case would the appropriate code in the OLS estimate box be the following?:
Please advise if this is the correct manner in which it must be written.
Appreciate the help.
Keshav
Thanks for your reply. So inorder to compute the OLS for this case would the appropriate code in the OLS estimate box be the following?:
Code: Select all
log(Volume)=c(1) + c(2)*(returns) + c(3)*dummy*(returns)Appreciate the help.
Keshav
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13600
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Dummy Variables in OLS
Either that or just simply
Although looking at your original specification, perhaps it should be:
Code: Select all
log(volume) c returns dummy*returns
Although looking at your original specification, perhaps it should be:
Code: Select all
log(volume) c returns^2 dummy*returns^2
-
keshav.jayant
- Posts: 6
- Joined: Sat Jul 25, 2009 3:19 pm
Re: Dummy Variables in OLS
Great thanks alot! really appreciate the help there.
cheers!
cheers!
Who is online
Users browsing this forum: No registered users and 2 guests
