Skip to main content

Survey Kit

Tools for addressing missing data problems (nonresponse bias and item missingness) including extremely fast calibration weighting and machine learning-based imputation.

A furlough project inspired by the code used for the U.S. Census Bureau for the National Experimental Wellbeing Statistics (NEWS) project.

Installation

uv add survey-kit
# or
pip install survey-kit

Running regressions with multiply imputed data (below) can be easier with the tools noted below, but they are not added as dependencies by default. Add only what you use:

uv add "survey-kit[pyfixest]"    # or [statsmodels], [linearmodels], [polars-ds], [r], [stata]
uv add "survey-kit[all-stats]"   # everything at once

For R and Stata, there's some additional setup you need to do to get them working with python. See rpy2's installation instructions and pystata's documentation.

Older Linux (e.g., RHEL 7)

Many dependencies (mkl, pyarrow, lightgbm, numba, igraph, ...) have stopped publishing wheels for old glibc versions (< 2.28). Use the old-linux extra, which pins the last versions that still have compatible wheels:

uv add "survey-kit[old-linux]"

Features

  • Calibration Weighting - Fast entropy balancing for nonresponse bias
  • SRMI Imputation - ML-based multiple imputation with checkpointing
  • Statistics & Standard Errors - Proper variance estimation for complex surveys
  • Running regressions with multiply imputed data using standard python, R, or Stata tools - statsmodels, linearmodels, pyfixest, R, and Stata behind one interface

Works with Polars, Pandas, Arrow, and DuckDB.

Documentation

Full documentation: https://jrothbaum.github.io/survey_kit/

Support

License

This project is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the CC0 1.0 Universal public domain dedication.

Metadata

Release files for survey-kit 0.2.1

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

Source distribution (sdist)

Source distribution for survey-kit 0.2.1
File Size Uploaded
survey_kit-0.2.1.tar.gz 18.4 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for survey-kit 0.2.1
File Interpreter ABI Platform
survey_kit-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 18.9 MB

Release files / survey_kit-0.2.1.tar.gz

Download URL survey_kit-0.2.1.tar.gz
Size 18.4 MB
Tags Source
SHA-256 checksum
How to use checksums
ac56df11b5b9e88460c25501395afca59b797a68fada3ea4186809000e4f158c
BLAKE2b-256 checksum
How to use checksums
12b1195c4ec4f76c6c9f83cf9c57584007f32b0546ec920cb7ced1e658a2ee5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / survey_kit-0.2.1-py3-none-any.whl

Download URL survey_kit-0.2.1-py3-none-any.whl
Size 445.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
27cbc0f9ec2ebe69c9b549f37d9c9e704e4a0d7bd8eb022f5892fa6f5d3b92b7
BLAKE2b-256 checksum
How to use checksums
6893dfbb4d4fece467d9fc9a5a23033f4cc25c7333c681bd8dfe7dda270c0560
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

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