Skip to main content

wildboottest

PyPI PyPI - Downloads

wildboottest implements multiple fast wild cluster bootstrap algorithms as developed in Roodman et al (2019) and MacKinnon, Nielsen & Webb (2022).

It has similar, but more limited functionality than Stata's boottest, R's fwildcusterboot or Julia's WildBootTests.jl. It supports

At the moment, wildboottest only computes wild cluster bootstrapped p-values, and no confidence intervals.

Other features that are currently not supported:

  • The subcluster bootstrap (MacKinnon and Webb 2018).
  • Confidence intervals formed by inverting the test and iteratively searching for bounds.
  • Multiway clustering.

Direct support for statsmodels and linearmodels is work in progress.

If you'd like to cooperate, either send us an email or comment in the issues section!

Installation

You can install wildboottest from PyPi by running

pip install wildboottest

Example

import pandas as pd
import statsmodels.formula.api as sm
from wildboottest.wildboottest import wildboottest

df = pd.read_csv("https://raw.github.com/vincentarelbundock/Rdatasets/master/csv/sandwich/PetersenCL.csv")
model = sm.ols(formula='y ~ x', data=df)

wildboottest(model, param = "x", cluster = df.firm, B = 9999, bootstrap_type = '11')
# | param   |   statistic |   p-value |
# |:--------|------------:|----------:|
# | x       |      20.453 |     0.000 |

wildboottest(model, param = "x", cluster = df.firm, B = 9999, bootstrap_type = '31')
# | param   |   statistic |   p-value |
# |:--------|------------:|----------:|
# | x       |      30.993 |     0.000 |

# bootstrap inference for all coefficients
wildboottest(model, cluster = df.firm, B = 9999, bootstrap_type = '31')
# | param     |   statistic |   p-value |
# |:----------|------------:|----------:|
# | Intercept |       0.443 |     0.655 |
# | x         |      20.453 |     0.000 |

# non-clustered wild bootstrap inference
wildboottest(model, B = 9999, bootstrap_type = '11')
# | param     |   statistic |   p-value |
# |:----------|------------:|----------:|
# | Intercept |       1.047 |     0.295 |
# | x         |      36.448 |     0.000 |

Metadata

Release files for wildboottest 0.3.2

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

Source distribution (sdist)

Source distribution for wildboottest 0.3.2
File Size Uploaded
wildboottest-0.3.2.tar.gz 12.8 kB Details

Built distribution (wheel)

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

Total release size: 25.0 kB

Release files / wildboottest-0.3.2.tar.gz

Download URL wildboottest-0.3.2.tar.gz
Size 12.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f705e87c6bc5f8dfeca6a12edb666a744072c91b702cd4041560839eb4f2e418
BLAKE2b-256 checksum
How to use checksums
9c4acca3fc48321c9c896b4c7db26cf44c1b54a77c3e0db0e622052a405b7b3a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.8

Release files / wildboottest-0.3.2-py3-none-any.whl

Download URL wildboottest-0.3.2-py3-none-any.whl
Size 12.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
886762642098358ddeb190656fc05c17e26d5c024ccff9f8863627ce3392902f
BLAKE2b-256 checksum
How to use checksums
b275419e54d92b1b97128a12f8dcd53b40b5144a33a69026496287a3ab7557e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.8

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.18

2 release files

0.1.17

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.0

2 release files

0.0.0

1 release file

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