Dear Statlist Community,
I have a panel data set with daily trading data for 4730 different firms (identified by a variable permno) over a 5 year time horizon (1993 - 1997). I'm using current Stata version 15.1 and want to run regressions with yearly time fixed effects and firm fixed effects taking into account different cluster options. My data is xtset by xtset permno date, where date is variable containing the date from 04jan1993 to 31may1997.
I discovered that xtreg only allows for one dimensional clustering, while the reghdfe command also allows for multi-way clustering. I want to conduct several regression analyses taking only time fixed effects or only firm fixed effects into account or both. I tested both the xtreg command (clustering over firms) and the reghdfe command (clustering over both firms and years).
My dependent variable is trades, covering the number of daily trades, and my major independent variable is a dummy variable called postEDGAR, that equals zero for a certain time from 04jan1993 on and switches to 1 at a certain point in time, depending on the firm.
I run xtreg and reghdfe in the following versions:
In general I thought that the xtreg and reghdfe regressions 1&4, 2&5 and 3&6 should have the same coefficients for my independent variable postEDGAR (they are done with only time fixed effects via year dummies (1&4), only firm fixed effects via the permno variable (2&5) and with both time and firm fixed effects via year dummies and permno (3&6)) and that only standard errors and respective t-values should be different due to the difference in one-dimensional and two-dimensional clustering.
However, I find that the regression coefficients in regression 1&4 (only Time Fixed Effects) are different, while for regressions 2&5 (only Firm Fixed Effects) and 3&6 (both Time and Firm Fixed Effects) they are identical. Attached you can find an Excel File with the regression Output from my described regressions.
What is the reason for that? I cannot find a mistake in my regression specifications, but probably I'm lacking some thoughts.
I read in the help of reghdfe that each cluster variable should have at least 50 different categories. Does the described problem arise due to the low number of different categories for the cluster variable year (only 5 categories)? But why are then the coefficients in regression 3&6 identical?
Any help, suggestions, explanations are highly appreciated!
I thank you very much in advance!!!
Best regards
Phil
I have a panel data set with daily trading data for 4730 different firms (identified by a variable permno) over a 5 year time horizon (1993 - 1997). I'm using current Stata version 15.1 and want to run regressions with yearly time fixed effects and firm fixed effects taking into account different cluster options. My data is xtset by xtset permno date, where date is variable containing the date from 04jan1993 to 31may1997.
I discovered that xtreg only allows for one dimensional clustering, while the reghdfe command also allows for multi-way clustering. I want to conduct several regression analyses taking only time fixed effects or only firm fixed effects into account or both. I tested both the xtreg command (clustering over firms) and the reghdfe command (clustering over both firms and years).
My dependent variable is trades, covering the number of daily trades, and my major independent variable is a dummy variable called postEDGAR, that equals zero for a certain time from 04jan1993 on and switches to 1 at a certain point in time, depending on the firm.
I run xtreg and reghdfe in the following versions:
Code:
// 1: Regression with Time Fixed Effects / Clustering: Firms xtreg trades postEDGAR i.year, vce(cluster permno) // 2: Regression with Firm Fixed Effects / Clustering: Firms xtreg trades postEDGAR, fe vce(cluster permno) // 3: Regression with both Time and Firm Fixed Effects / Clustering: Firms xtreg trades postEDGAR i.year, fe vce(cluster permno) // 4: Regression with Time Fixed Effects / Clustering: Firms and Year reghdfe trades postEDGAR, absorb(year) vce(cluster permno year) // 5: Regression with Firm Fixed Effects / Clustering: Firms and Year reghdfe trades postEDGAR, absorb(permno) vce(cluster permno year) // 6: Regression with both Time and Firm Fixed Effects / Clustering: Firms and Year reghdfe trades postEDGAR, absorb(year permno) vce(cluster permno year)
However, I find that the regression coefficients in regression 1&4 (only Time Fixed Effects) are different, while for regressions 2&5 (only Firm Fixed Effects) and 3&6 (both Time and Firm Fixed Effects) they are identical. Attached you can find an Excel File with the regression Output from my described regressions.
What is the reason for that? I cannot find a mistake in my regression specifications, but probably I'm lacking some thoughts.
I read in the help of reghdfe that each cluster variable should have at least 50 different categories. Does the described problem arise due to the low number of different categories for the cluster variable year (only 5 categories)? But why are then the coefficients in regression 3&6 identical?
Any help, suggestions, explanations are highly appreciated!
I thank you very much in advance!!!
Best regards
Phil
Comment