I have daily closing values of an index and I want to create dummy variables for a specific number of days before and after the last day of each month.
Say 4 days before and 4 days after. Total 9 days. I have 23 years of data.
The thing is that the months are not of equal length (obviously) and the data is exclusive of all weekends (making the unequal length even more "unequal").
How do I create dummy variables for the data in an effective way without having to manually go through over 6000 observations and pin point dates that are 4 days before and 4 days after the last day of the month?
%------------------------
I have managed to create a table with dates and returns from 1991 to 2014 excluding weekends. First column years, second months, third day and, fourth returns:
Now I want to create dummy variables for X number of days before the last business day of the month and X number of days after the last day of the month. Say 9 days. So dummies D-9, D-8... T, D+1, D+2... D+9. T=last day of the month. Total of 19 dummies. The rest of the days will have a separate dummy, ROM. I then use these as regressors on the returns.
My expected result will be coefficients for all dummies that describe the returns on each chosen day of the month (19 days around the turn-of-the-month) and the rest of the month (ROM). It should look something like this:
@Daniel