Open josef-pkt opened 10 years ago
Is there something to do here?
not for 0.6. This is mainly a reminder and reference, until I figure this out.
The definition of hatmatrix across models is an open issue. (There are two definitions when we have weights or GLS whitening, but I don't know when we are supposed to use which.) For the WLS/GLS sandwiches I need other test cases, to check what FGLS and similar are supposed to be doing.
corrections like HC2, HC3 need to be extended to other sandwiches.
interesting: blog post about Stata's hatmatrix in WLS linking back to this issue https://declaredesign.org/r/estimatr/articles/stata-wls-hat.html
It's not clear what definition of the hatmatrix Stata uses with
aweights
testing robust HCx for WLS against Stata regress with aweights
HC1 matches after trivial change (resid -> wresid) HC2 and HC3 differ, because the diagonal of the hat matrix is different, after regress with aweights (Stata at least divides one more time by weights.)
making the trivial change resid -> wresid, exog -> wexog, I get the same results with WLS or OLS after rescaling/weighting
however Stata gets
I like our results better. Note Stata has a big increase in standard errors between weighted and unweighted for the cases of HC2 and HC3, but not for HC1 which doesn't depend on hat matrix.
There will be other cases where we can test against Stata for specific models with non-spherical variance, Panel, HetGLS, GLSAR, ...