Metadata-Version: 2.5
Name: survey-kit
Version: 0.2.0
Summary: Tools for working with survey and other data
Author-email: Jon Rothbaum <jon.rothbaum@gmail.com>
License: CC0 1.0 Universal
License-File: LICENSE.md
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.9
Requires-Dist: cachetools>=6.2.6
Requires-Dist: cffi
Requires-Dist: dill>=0.4.0
Requires-Dist: igraph
Requires-Dist: lightgbm
Requires-Dist: narwhals>=2.7.0
Requires-Dist: numba
Requires-Dist: numexpr>=2.10.2
Requires-Dist: numpy>=2.0.2
Requires-Dist: optuna
Requires-Dist: polars>=1.25.2
Requires-Dist: psutil
Requires-Dist: pyarrow>=19.0.0
Requires-Dist: pypardiso>=0.4.6; platform_machine == 'x86_64'
Requires-Dist: scikit-learn
Requires-Dist: scipy>=1.13.1
Requires-Dist: sparse-dot-mkl>=0.9.9; platform_machine == 'x86_64'
Requires-Dist: survey-kit-formula>=0.1.0
Provides-Extra: all-stats
Requires-Dist: linearmodels>=6.1; extra == 'all-stats'
Requires-Dist: polars-ds; extra == 'all-stats'
Requires-Dist: polars-readstat>=0.21.1; extra == 'all-stats'
Requires-Dist: pyfixest>=0.40.1; extra == 'all-stats'
Requires-Dist: rpy2-arrow>=0.1.3; extra == 'all-stats'
Requires-Dist: rpy2>=3.6.7; extra == 'all-stats'
Requires-Dist: statsmodels>=0.14.6; extra == 'all-stats'
Provides-Extra: linearmodels
Requires-Dist: linearmodels>=6.1; extra == 'linearmodels'
Provides-Extra: polars-ds
Requires-Dist: polars-ds; extra == 'polars-ds'
Provides-Extra: pyfixest
Requires-Dist: pyfixest>=0.40.1; extra == 'pyfixest'
Provides-Extra: r
Requires-Dist: rpy2-arrow>=0.1.3; extra == 'r'
Requires-Dist: rpy2>=3.6.7; extra == 'r'
Provides-Extra: stata
Requires-Dist: polars-readstat>=0.21.1; extra == 'stata'
Provides-Extra: statsmodels
Requires-Dist: statsmodels>=0.14.6; extra == 'statsmodels'
Description-Content-Type: text/markdown

# 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)](https://www.census.gov/data/experimental-data-products/national-experimental-wellbeing-statistics.html) project.

## Installation
```bash
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:
```bash
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](https://rpy2.github.io/doc/latest/html/overview.html) and [pystata's documentation](https://www.stata.com/python/pystata/).

## 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/](https://jrothbaum.github.io/survey_kit/)

- [Calibration Guide](https://jrothbaum.github.io/survey_kit/user-guide/calibration/)
- [Imputation Guide](https://jrothbaum.github.io/survey_kit/user-guide/srmi/)
- [Statistics Guide](https://jrothbaum.github.io/survey_kit/user-guide/statistics/)
- [Guide to running regressions with multiply imputed data using standard python, R, or Stata tools](https://jrothbaum.github.io/survey_kit/user-guide/adapters/)

## Support

- [Issues](https://github.com/jrothbaum/survey_kit/issues)

## 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.