For example, the above code will omit x2 but the coefficient can be correctly estmated in Stata.
Linear Model
=====================================================================
Number of obs: 6 Degrees of freedom: 1
R2: 0.000 R2 Adjusted: 0.000
F-Stat: NaN p-value: NaN
=====================================================================
x1 | Estimate Std.Error t value Pr(>|t|) Lower 95% Upper 95%
---------------------------------------------------------------------
x2 | 0.0 NaN NaN NaN NaN NaN
(Intercept) | 37.6367 0.602309 62.4873 0.000 35.9644 39.3089
=====================================================================
The problem seems to be the torelance check in invsym!
Maybe I'm getting it wrong, but I'm not quite understand the check here. The diag value could be changed during the previous loops through line 66, but the tols variable is using the initial value.
The variable with very small variances will be dropped during the estimation, even though it's not collinear with others.
For example, the above code will omit
x2
but the coefficient can be correctly estmated in Stata.The problem seems to be the torelance check in
invsym!
https://github.com/FixedEffects/FixedEffectModels.jl/blob/851eca92998133fbb2780c4db1898c3f903d1d8f/src/utils/basecol.jl#L54-L74
Maybe I'm getting it wrong, but I'm not quite understand the check here. The diag value could be changed during the previous loops through line 66, but the
tols
variable is using the initial value.