linearmodels
Linear Panel, Instrumental Variable, Asset Pricing, and System Regression models for Python
Decision gist · record as of 2026-08-14
Yes, with conditions. Install if you need specialized econometric estimators (panel models, IV, system regression, asset pricing) beyond statsmodels' scope and can work with Python 3.10 or later. The package is actively maintained with no known vulnerabilities. Verify the NCSA license terms match your project's requirements before committing to production use.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later; depends on numpy, pandas, scipy, and statsmodels at specified minimum versions.
- Medium install friction due to compiled wheels across multiple platforms and Python versions (3.10–3.13).
- Active maintenance with last commit on 2026-08-13 and 1060 repository stars indicate ongoing support.
License · maintenance · safety
NCSA (unclear) — Licensed under NCSA with unclear treatment in the package metadata—verify the actual license terms before use in proprietary or restricted contexts.
last release 2025-10-21 (297 days) · last repo commit 2026-08-13 · 1,060 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 440,109 downloads/mo, #6,648 on PyPI
Alternatives
Verify before relying
pip install linearmodels
from linearmodels import PanelOLS
import numpy as np
from statsmodels.datasets import grunfeld
data = grunfeld.load_pandas().data
data.year = data.year.astype(np.int64)
data = data.set_index(['firm','year'])
mod = PanelOLS(data.invest, data[['value','capital']], entity_effects=True)
res = mod.fit(cov_type='clustered', cluster_entity=True)- Whether NCSA license treatment is suitable for your use case (commercial, proprietary, or restricted distribution).
- Performance characteristics and scalability limits for high-dimensional regression with absorbing least squares.
- Compatibility with xarray data structures beyond the stated optional support.
- Actual download volume and user base size to assess community support.
What it is and what it does
Linearmodels extends statsmodels with specialized econometric and financial regression estimators. It provides panel data models (fixed effects, first difference, between, pooled, Fama-MacBeth), instrumental variable methods (2SLS, LIML, k-class, GMM), high-dimensional regression via absorbing least squares, factor asset pricing models, and system regression (SUR, 3SLS, GMM system). The package is designed to work with NumPy, Pandas, and xarray data structures and supports formula-based model specification using formulaic.
The package targets econometricians, financial researchers, and data scientists working with panel data, endogenous regressors, or multi-equation systems. It builds on statsmodels' foundation but adds specialized estimators not available in the base library. Installation requires seven runtime dependencies (numpy, pandas, scipy, statsmodels, mypy_extensions, pyhdfe, formulaic), and the package is actively maintained with support for current Python versions.
Use it for
- Estimate panel regression models with entity and time fixed effects on longitudinal firm or country data.
- Perform instrumental variable regression when regressors are endogenous, using 2SLS or GMM estimators.
- Implement Fama-MacBeth cross-sectional regression for asset pricing factor models across time periods.
- Fit system regression models (SUR, 3SLS) when multiple equations share disturbances or have cross-equation constraints.
- Handle high-dimensional fixed effects using absorbing least squares for large categorical variables.
- Estimate k-class or continuously-updating GMM models for robust inference under weak instruments.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, with conditions.
Install if you need specialized econometric estimators (panel models, IV, system regression, asset pricing) beyond statsmodels' scope and can work with Python 3.10 or later. The package is actively maintained with no known vulnerabilities. Verify the NCSA license terms match your project's requirements before committing to production use.
Install
linearmodels on PyPI
Before you install
Medium install friction due to compiled wheels across multiple platforms and Python versions (3.10–3.13). Active maintenance with last commit on 2026-08-13 and 1060 repository stars indicate ongoing support.
Requires Python 3.10 or later; depends on numpy, pandas, scipy, and statsmodels at specified minimum versions.
License in practice
Licensed under NCSA with unclear treatment in the package metadata—verify the actual license terms before use in proprietary or restricted contexts.
Quickstart
pip install linearmodels
from linearmodels import PanelOLS
import numpy as np
from statsmodels.datasets import grunfeld
data = grunfeld.load_pandas().data
data.year = data.year.astype(np.int64)
data = data.set_index(['firm','year'])
mod = PanelOLS(data.invest, data[['value','capital']], entity_effects=True)
res = mod.fit(cov_type='clustered', cluster_entity=True)
Verify before relying
- Whether NCSA license treatment is suitable for your use case (commercial, proprietary, or restricted distribution).
- Performance characteristics and scalability limits for high-dimensional regression with absorbing least squares.
- Compatibility with xarray data structures beyond the stated optional support.
- Actual download volume and user base size to assess community support.
Package facts
| License | NCSA unclear |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | 7 packagesnumpypandasscipystatsmodelsmypy_extensionspyhdfeformulaic |
| Maintenance | Actively maintained 297 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 440,109 / month, #6,648 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: End Users/DesktopIntended Audience :: Financial and Insurance IndustryIntended Audience :: Science/ResearchOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIXProgramming Language :: CythonProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Scientific/Engineering |
Evidence: linearmodels-7.0-cp310-cp310-macosx_10_9_x86_64.whl; linearmodels-7.0-cp310-cp310-macosx_11_0_arm64.whl; linearmodels-7.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; linearmodels-7.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; linearmodels-7.0-cp310-cp310-musllinux_1_2_x86_64.whl; linearmodels-7.0-cp310-cp310-win_amd64.whl; linearmodels-7.0-cp311-cp311-macosx_10_9_x86_64.whl; linearmodels-7.0-cp311-cp311-macosx_11_0_arm64.whl; linearmodels-7.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; linearmodels-7.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; linearmodels-7.0-cp311-cp311-musllinux_1_2_x86_64.whl; linearmodels-7.0-cp311-cp311-win_amd64.whl; linearmodels-7.0-cp312-cp312-macosx_10_13_x86_64.whl; linearmodels-7.0-cp312-cp312-macosx_11_0_arm64.whl; linearmodels-7.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; linearmodels-7.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; linearmodels-7.0-cp312-cp312-musllinux_1_2_x86_64.whl; linearmodels-7.0-cp312-cp312-win_amd64.whl; linearmodels-7.0-cp313-cp313-macosx_10_13_x86_64.whl; linearmodels-7.0-cp313-cp313-macosx_11_0_arm64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “panel regression fixed effects”
- linearmodelsProvides panel regression, instrumental variable estimators, system…
- pyfixestPyFixest performs fast high-dimensional fixed effects regression in…
- pyhdfePyHDFE absorbs high-dimensional fixed effects from regression data…
Give your agent the search over MCP, or paste the wish link into any chat.
More Scientific/Engineering packages
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
pandas provides fast, flexible data structures (Series and DataFrame) for loading, cleaning, transforming, and analyzing labeled or relational data in Python.
scipy provides numerical algorithms for mathematics, science, and engineering—including optimization, integration, linear algebra, Fourier transforms, signal and image processing, and ODE solvers—built on numpy arrays.
scikit-learn provides a comprehensive Python library for supervised and unsupervised machine learning, including classification, regression, clustering, dimensionality reduction, and model evaluation tools built on NumPy and SciPy.
Install it if you need to train, evaluate, or deploy supervised or unsupervised learning models.
dill extends Python's pickle module to serialize and deserialize a much wider range of Python objects, including functions, lambdas, classes, and interpreter sessions, to byte streams for storage or network transmission.
Multiprocess is an enhanced fork of Python's standard multiprocessing library that uses dill for better serialization, allowing you to spawn processes with a threading-like API and share complex objects between them.
Install it if you use multiprocessing and encounter pickle serialization limits with lambdas or complex objects.
See also arch · pyfixest · statsmodels · spglm · pyhdfe · pwlf · rdrobust · polars-ols · patsy · piecewise-regression