Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 72772

Bug in xtreg, fe robust: wrong standard errors?

$
0
0
I am running a linear regression on a panel dataset, using fixed effects and robust standard errors in Stata 14.1. using the command "xtreg, fe robust".
I am wondering whether there is a bug in the calculation of standard errors, leading to too narrow standard errors and flawed inference on the statistical significance of regressors.

"xtreg, fe robust" gives smaller standard errors than running "reg, robust" after demeaning of the data and adjusting standard errors manually for the degrees of freedom.

------------------------------------------------------------------------------------------------------------
clear
sysuse auto
replace length=length/10
tab head
local df = r(r) - 1
sort head
by head: egen mean = mean(mpg)
by head: gen newmpg = mpg-mean
drop mean
by head: egen mean = mean(len)
by head: gen newlen = len-mean
drop mean

regress newmpg newlen, robust
mat b=e(b)
scalar vadj = e(df_r)/(e(N)-1-(e(df_m) + `df'))
matrix V = vadj*e(V)

cap program drop change
program change, eclass
eret post b V
end
change
eret display
xtreg mpg len, i(head) fe robust
------------------------------------------------------------------------------------------------------------

When running the same code without the ", robust" option, the manual df-adjustment of the standard errors gives the same result als "xtreg, fe".

If my suspicion is correct, in all estimations based on the command "xtreg, fe robust" the precision on the resulting coefficients is overestimated, which leads to a too confident interpretation of the regressors as being statistically significant.

I would be grateful for comments that can solve this issue!
Many thanks,
Doris

Viewing all articles
Browse latest Browse all 72772

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>