-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
If the VCE option was specified as `vce(cluster var1#var2)`, reghdfe was comparing whether the fixed effects were nested within `var1` instead of within `var1#var2`. This reduced SEs and overstated statistical confidence.
- Loading branch information
1 parent
027f31a
commit 44fc646
Showing
3 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
noi cscript "reghdfe: prevent bug regression with cluster VCE" adofile reghdfe | ||
|
||
* SEE: | ||
* https://www.statalist.org/forums/forum/general-stata-discussion/general/1409974-reghdfe-4-x-standard-errors-and-categorical-variables | ||
|
||
* Dataset | ||
sysuse auto, clear | ||
egen int turn_foreign = group(turn foreign) | ||
|
||
* [TEST] Cluster | ||
|
||
* 1. Run benchmark | ||
reghdfe price weight, a(turn#trunk foreign) vce(cluster turn_foreign) | ||
storedresults save benchmark e() | ||
|
||
* 2. Run reghdfe with # | ||
reghdfe price weight, a(turn#trunk foreign) vce(cluster turn#foreign) | ||
storedresults compare benchmark e(), tol(1e-12) exclude(macro: clustvar1 clustvar cmdline) | ||
storedresults drop benchmark | ||
|
||
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,8 @@ | |
run inconsistent-r2 | ||
run singleton-and-fweights | ||
|
||
run bug_cluster | ||
|
||
* -prune- corner cases | ||
* run prune | ||
|
||
|