collinearity_check
checks for perfect multicollinearity in a model with high-dimensional
fixed effects. It calls lfe::demeanlist
in order to partial out the fixed effects, and then
uses stats::lm.wfit
to discard linearly dependent variables.
collinearity_check(
y,
x = NULL,
fes = NULL,
hdfetol,
colcheck_x_fes = TRUE,
colcheck_x = TRUE
)
A numeric vector containing the variables that pass the collinearity check.
Dependent variable (a numeric vector).
Regressor matrix.
List of fixed effects.
Tolerance for the centering, passed on to lfe::demeanlist
.
Logical. If TRUE
, this checks whether the independent variables are perfectly explained
by the fixed effects drops those that are perfectly explained.
Logical. If TRUE
, this checks collinearity between the independent variables and drops the
collinear variables.