You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
clear
cls
set obs 100
gen double y = runiform() * 1e8
gen double z = runiform()
reghdfe z y, noab
reg z y
A variable is omitted if:
a) After partialling-out, it is zero (or within EPS of zero, where EPS is usually 1e-10)
b) The regression gives a beta of zero for a coef. , or invsym() detects it is collinear and drops it. (2nd approach is probably better). An extra issue is that the error in step a) gets carried to step b).
Not sure if there is an easy way around this, but in any case the tolerance used to detect omitted should be linked to the tolerance used to partial out the variables.
Also, if both Y and X are completely absorbed, their residuals will be very low but within the same magnitude of each other, giving a spurious result.
The text was updated successfully, but these errors were encountered:
Issues resolved:
1) qrsolve(XX, XY) suffers from numerical inaccuracies on some cases, so
we fix to qrsolve(X, Y) if we don't have weights
(Note: this might be a bit slower as the XX and XY are already
precomputed. It could also be optimized but for now let's leave it as it
is.
2) The methods used to find out omitted variables were different in
different points. When demeaning, we looked if the regressors were close
to zero, but used absolute values (1e-8) which doesn't work if there is
a huge scaling difference between Y and X. Now we will assumme the var
has been absorbed by the absvars if the ratio z'z/w'w < (1e-9) where
z=old variable and w= demeaned variable. This 1e-9 will also increase
with tolerance() as it's just tolerance*1e-1
We also use invsym() as the main driver for whether to drop or not, as
that is what it's used on the built-in tools. Then the inputs of
qrsolve() will exclude the omitted variables, to prevent any issue.
A variable is omitted if:
a) After partialling-out, it is zero (or within EPS of zero, where EPS is usually 1e-10)
b) The regression gives a beta of zero for a coef. , or invsym() detects it is collinear and drops it. (2nd approach is probably better). An extra issue is that the error in step a) gets carried to step b).
Not sure if there is an easy way around this, but in any case the tolerance used to detect omitted should be linked to the tolerance used to partial out the variables.
Also, if both Y and X are completely absorbed, their residuals will be very low but within the same magnitude of each other, giving a spurious result.
The text was updated successfully, but these errors were encountered: