Skip to main content

missinggmm

License: MIT Python

Generalized Method of Moments (GMM) estimation of linear regressions with a missing regressor, following Abrevaya and Donald (2017).

Overview

missinggmm estimates linear regression models when one regressor is missing for part of the sample. Instead of dropping incomplete observations or imputing values, the estimator uses the incomplete cases through additional moment conditions, which can increase efficiency over the complete-case estimator. See docs/efficiency.md for the argument.

Features:

  • GMM estimator of Abrevaya and Donald (2017) with sandwich standard errors.
  • Input validation with descriptive errors.
  • Typed, with numpy as the only runtime dependency.

The test suite validates the estimator against complete-case OLS, the dummy-variable method, and the weighted FGLS estimator of Dagenais (1973).

Installation

The package is not yet released on PyPI. To install it from source:

pip install git+https://github.com/felixschmitz/missinggmm

Usage

Mark the missing values of the incomplete regressor with NaN. Exactly one column of X may contain missing values; include a constant column if the model has an intercept.

import numpy as np
import missinggmm

rng = np.random.default_rng(seed=0)
n = 2_000
constant = np.ones(n)
z = rng.normal(size=n)
x = 0.5 * z + rng.normal(size=n)
y = 1.0 + 2.0 * x - 1.0 * z + rng.normal(size=n)

x_observed = np.where(rng.uniform(size=n) < 0.7, x, np.nan)
X = np.column_stack([constant, x_observed, z])

results = missinggmm.fit(y, X)
print(results.summary())

fit returns a missinggmm.Results object with the coefficients (params), standard errors (bse), covariance matrix (cov), the number of observations (nobs), and convergence information (converged, n_iterations). Coefficients are ordered like the columns of X.

Development

The project uses pixi for environments and prek for linting and formatting.

git clone --recurse-submodules https://github.com/felixschmitz/missinggmm
cd missinggmm
pixi install
pixi run tests
pixi run prek run --all-files

Citation

If you use this package, please cite the original paper. CITATION.cff contains citation metadata for the software.

References

Abrevaya, J., & Donald, S. G. (2017). A GMM approach for dealing with missing data on regressors. The Review of Economics and Statistics, 99(4), 657-662.

Dagenais, M. G. (1973). The use of incomplete observations in multiple regression analysis: A generalized least squares approach. Journal of Econometrics, 1(4), 317-328.

License

MIT. See LICENSE.

Metadata

Release files for missinggmm 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for missinggmm 0.1.0
File Size Uploaded Provenance Actions
missinggmm-0.1.0.tar.gz 8.3 kB With provenance Details for missinggmm-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for missinggmm 0.1.0
File Interpreter ABI Platform Actions
missinggmm-0.1.0-py3-none-any.whl Python 3 none any Details for missinggmm-0.1.0-py3-none-any.whl

Total release size: 16.8 kB

Release files / missinggmm-0.1.0.tar.gz

Download URL missinggmm-0.1.0.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
222089976ece954b66b5dfd9bd50e094685e53dd1069c9421bfea91a042e0be6
BLAKE2b-256 checksum
How to use checksums
56560df0dbf0c6949272f5d3b6b118ef4399d50eb00f44dd26492dfe689f0f96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Release files / missinggmm-0.1.0-py3-none-any.whl

Download URL missinggmm-0.1.0-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab2d3bd1c28f99b1272e7db3b5e03c5563b408118ecc6d8b0594ecf0a91f3972
BLAKE2b-256 checksum
How to use checksums
2c5cefe4525b1e7f4b442f63973b85ad16eccf881d781b735068c2c1df85d1fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Security for missinggmm 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for missinggmm-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page