linearmodels.iv.absorbing.AbsorbingRegressor

class linearmodels.iv.absorbing.AbsorbingRegressor(*, cat: DataFrame | None = None, cont: DataFrame | None = None, interactions: list[Interaction] | None = None, weights: ndarray[tuple[int, ...], dtype[float64]] | None = None)[source]

Construct a sparse matrix of regressors from components.

Parameters:
cat: DataFrame | None = None

Categorical variables (factors) to absorb.

cont: DataFrame | None = None

Continuous variables to absorb.

interactions: list[Interaction] | None = None

Included interactions.

weights: ndarray[tuple[int, ...], dtype[float64]] | None = None

Weights, if any. The regressors are multiplied by the square root of the weights.

Methods

Properties

approx_rank

Return the number of columns of the regressors, an upper bound of their rank.

has_constant

Flag indicating whether the regressors have a constant equivalent.

hash

Return a hash of the regressors, which does not depend on their order.

regressors

Return the sparse matrix of regressors.