Page 1 of 1
Import data and run a regression with dummy variables
Posted: Wed May 16, 2012 5:23 am
by jochemvandalfsen
I am a noob in Eviews and have never worked with it, so can anybody help me with the following questions:
I would like to test whether a some calendar anomalies exist in the index options on the S&P500.
Therefore I created a dataset (I attached my dataset file so you can have a look at it) with one column of data (from 1996-2010, exclusing weekends and some other days) and different columns of excess returns for different portfolios of options.
My questions are:
- How do I import this dataset into eviews so I can use it for the regressions (since some days are missing in the dates and a lot of excess returns are missing on different dates)?
- Do I leave missing values blank or do I have to fill something in in these cells?
- How do I make dummy variables and run a regression on them (for example: a dummy variable where I test for higher excess returns on all days in January)?
- What kind of robustness checks are easy to do to make the results more reliable?
I hope somebody will help me!
Best regards, Jochem
Re: Import data and run a regression with dummy variables
Posted: Wed May 16, 2012 7:37 am
by EViews Gareth
Have you read through the first few chapters of EViews Illustrated?
http://eviews.com/illustrated/illustrated.html
Re: Import data and run a regression with dummy variables
Posted: Wed May 16, 2012 8:05 am
by jochemvandalfsen
Yes, I already read them, but I am just not that good with these kind of programs...
It would be great if you could explain the first steps, so I can move on a bit and then use the guide to go further...
Rgds, Jochem
Re: Import data and run a regression with dummy variables
Posted: Wed May 16, 2012 8:14 am
by EViews Gareth
Have you tried opening the data in EViews?
Re: Import data and run a regression with dummy variables
Posted: Wed May 16, 2012 8:44 am
by jochemvandalfsen
Yes, I attached the file with the data opened in Eviews.
So you see one sheet with the dates, 4 sheets with the excess returns of the different portfolios, and 4 sheets with the delta hedge excess returns of the different portfolios.
What to do next is not clear to me...
Re: Import data and run a regression with dummy variables
Posted: Wed May 16, 2012 9:33 am
by EViews Esther
- How do I import this dataset into eviews so I can use it for the regressions (since some days are missing in the dates and a lot of excess returns are missing on different dates)?
- Do I leave missing values blank or do I have to fill something in in these cells?
- How do I make dummy variables and run a regression on them (for example: a dummy variable where I test for higher excess returns on all days in January)?
- What kind of robustness checks are easy to do to make the results more reliable?
1. (1) I am not sure how you import the dataset into EViews. The easiest way is to select File-->Open-->Foreign Data as Workfile-->find your data file.
(2) Based on my understanding, your dataset should be structured as "Dated." Here is the way to make it as a Dated workfile. Select Proc-->Structure/Resize Current Page-->Select "Dated -specified by date series" from the Workfile structure type" tab. Enter "date" in the "Identifier series" tab. Select "Daily-5 day week" from the "Frequency" tab.--> Click OK
2. You do not need to worry about missing values (NAs). If you are estimating an equation, EViews will use the set of observations in the sample that have no NAs for the dependent and all the the independent variables.
3. Please tell me more what you are trying to do. A common way to generate a dummy variable is series dummy = @recode(your condition,1,0).
4. When you run your regression, please select the View tab from from the equation object. You will see a variety of Diagnostics options.
Re: Import data and run a regression with dummy variables
Posted: Wed May 16, 2012 12:41 pm
by jochemvandalfsen
Dear Esther,
1. Is done, thanks (I attached my workfile with the dataset structured as dated)
2. I noticed, thanks.
3. So at this moment all my data (daily excess and delta hedge excess returns from 1996 - 2010 for 4 different portfolios) is in eviews (well structured), and I would like to check for existence of one of the following 3 calendar anomalies: The January Effect (abnormal excess returns from 1 January – 31 January), The Weekend Effect (abnormal excess returns on each trading day on Monday) and The Halloween Effect (abnormal excess returns on each trading day in the period from 1 November to April 30). I would like to check, for each portfolio separately, whether these calendar effects exist.
Can you maybe explain how I make a dummy for the The January Effect and how I run the regression and what values I should use for my results on these regressions?
Thanks in advance!
Jochem
Re: Import data and run a regression with dummy variables
Posted: Wed May 16, 2012 2:01 pm
by EViews Esther
The January Effect (abnormal excess returns from 1 January – 31 January), The Weekend Effect (abnormal excess returns on each trading day on Monday) and The Halloween Effect (abnormal excess returns on each trading day in the period from 1 November to April 30).
The January effect:
Code: Select all
series dummy1 = @recode(@datepart(@date,"mm")=1,1,0)
The weekend effect: Please note that your workfile is structured as d5 (5days a week) so that there is no weekends. If you are trying to generate the Monday effect dummy, you can use
Code: Select all
series dummy2 = @recode(@datepart(@date,"w")=1,1,0)
The Halloween effect:
Code: Select all
series dummy3 = 0
smpl if @datepart(@date,"mm")<5
dummy3 = 1
smpl if @datepart(@date,"mm")>10
dummy3 = 1
smpl @all
Re: Import data and run a regression with dummy variables
Posted: Wed May 16, 2012 2:43 pm
by jochemvandalfsen
Thanks a lot! This is really helpful!!
So after making for example the dummy to test for the January effect, how do I actually run a regression using this dummy and how can I interpret the results? What statistical values give me information on the existence of the January Effect in one of the portfolios I want to test?
Thanks for the help!
Rgds, Jochem