I have some time series variables at a daily frequency for about 3000 firms. I want to remove the seasonal effect by regressing day-of-the-week, month-of-the-year and year dummies on these variables and then use the residuals for further analysis.
For simplicity, I ignore that it's a panel data and assume that the time series variables only belong to one firm(I will use the statsby command to run regressions and store residuals for each firm).
For example, I run a regression as follows.
reg dep_var i.day i.month i.year
Where "dep_var" is the time series variable."day" is the dummy variable for day-of-the-week (1 for Monday, 2 for Tuesday, and so on). "month" is the dummy variable for month-of-the-year (1 for January, 2 for February, and so on). "year" is the year variable (with values ranging from 2003 to 2019).
Does running a regression like above allows the day-of-the-week and month-of-the-year to vary by year? In other words, a "January" for the year 2013 will be considered the same as a "January" for the next year, i.e. 2004. All Januarys will be treated equally. The same goes for the day-of-the week.
How should I specify the regression such that the day-of-the-week and month-of-the-year vary by each year? Should I interact the day and month dummies with the year dummy? What would be the command in Stata?
Since I only need the residuals from these regressions, I am not interested in the coefficients of these regressions.
For simplicity, I ignore that it's a panel data and assume that the time series variables only belong to one firm(I will use the statsby command to run regressions and store residuals for each firm).
For example, I run a regression as follows.
reg dep_var i.day i.month i.year
Where "dep_var" is the time series variable."day" is the dummy variable for day-of-the-week (1 for Monday, 2 for Tuesday, and so on). "month" is the dummy variable for month-of-the-year (1 for January, 2 for February, and so on). "year" is the year variable (with values ranging from 2003 to 2019).
Does running a regression like above allows the day-of-the-week and month-of-the-year to vary by year? In other words, a "January" for the year 2013 will be considered the same as a "January" for the next year, i.e. 2004. All Januarys will be treated equally. The same goes for the day-of-the week.
How should I specify the regression such that the day-of-the-week and month-of-the-year vary by each year? Should I interact the day and month dummies with the year dummy? What would be the command in Stata?
Since I only need the residuals from these regressions, I am not interested in the coefficients of these regressions.
Comment