Dummy Variables in OLS
Posted: Sat Jul 25, 2009 3:56 pm
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.
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.