import pyfixest as pf
fit = pf.feols("Y ~ X1 + X2 | f1", pf.get_data())
fe = fit.fixef()
fe.keys()dict_keys(['C(f1)'])
Compute the coefficients of (swept out) fixed effects for a regression model.
This method creates the following attributes: - _alpha (pd.DataFrame): A DataFrame with the estimated fixed effects. - _sumFE (np.array): An array with the sum of fixed effects for each observation (i = 1, …, N).
| Name | Type | Description | Default |
|---|---|---|---|
| atol | Float | Stopping tolerance for scipy.sparse.linalg.lsqr(). See https://docs.scipy.org/doc/ scipy/reference/generated/scipy.sparse.linalg.lsqr.html | 1e-6 |
| btol | Float | Another stopping tolerance for scipy.sparse.linalg.lsqr(). See https://docs.scipy.org/doc/ scipy/reference/generated/scipy.sparse.linalg.lsqr.html | 1e-6 |
| Name | Type | Description |
|---|---|---|
| dict[str, dict[str, float]] | A dictionary with the estimated fixed effects. |
Fixed effects are swept out during estimation and are not part of the coefficient table. fixef() computes them. The result is keyed by fixed effect term, then by level.
dict_keys(['C(f1)'])