Skip to main content

hierarch

A Hierarchical Resampling Package for Python

Version 2.0.0

hierarch is a package for hierarchical resampling (bootstrapping, permutation) of datasets in Python. Resampling is batched and vectorized with numpy, so cluster-aware bootstraps and permutations are drawn without Python-level loops over the hierarchy.

hierarch has several functions to assist in performing resampling-based (and therefore distribution-free) hypothesis tests, confidence interval calculations, and power analyses on hierarchical data.

Table of Contents

  1. Introduction
  2. Setup
  3. Documentation
  4. Citation

Introduction

Design-based randomization tests represents the platinum standard for significance analyses [1, 2, 3] - that is, they produce probability statements that depend only on the experimental design, not at all on less-than-verifiable assumptions about the probability distributions of the data-generating process. Researchers can use hierarch to quickly perform automated design-based randomization tests for experiments with arbitrary levels of hierarchy.

[1] Tukey, J.W. (1993). Tightening the Clinical Trial. Controlled Clinical Trials, 14(4), 266-285.

[2] Millard, S.P., Krause, A. (2001). Applied Statistics in the Pharmaceutical Industry. Springer.

[3] Berger, V.W. (2000). Pros and cons of permutation tests in clinical trials. Statistics in Medicine, 19(10), 1319-1328.

Setup

Dependencies

  • numpy
  • pandas (for importing data)
  • scipy (for power analysis)
  • formulaic (for building design matrices from formulas)

Installation

The easiest way to install hierarch is via PyPi.

pip install hierarch

Alternatively, you can install from Anaconda.

conda install -c rkulk111 hierarch

Documentation

Check out our user guide at readthedocs.

Citation

If hierarch helps you analyze your data, please consider citing it. The manuscript also contains a set of simulations validating hierarchical randomization tests in a variety of conditions.

Kulkarni RU, Wang CL, Bertozzi CR (2022) Analyzing nested experimental designs—A user-friendly resampling method to determine experimental significance. PLoS Comput Biol 18(5): e1010061. https://doi.org/10.1371/journal.pcbi.1010061

Metadata

Release files for hierarch 2.0.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 hierarch 2.0.0
File Size Uploaded
hierarch-2.0.0.tar.gz 134.6 kB Details

Built distribution (wheel)

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

Total release size: 164.4 kB

Release files / hierarch-2.0.0.tar.gz

Download URL hierarch-2.0.0.tar.gz
Size 134.6 kB
Tags Source
SHA-256 checksum
How to use checksums
96700b57724086db4a54b9ba66041fecda67d2e3da281546a62b587265b27089
BLAKE2b-256 checksum
How to use checksums
d81a25c0d0fe3fad257a9e9c50a0ed299410cc6d273bf401b30780c42b104056
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.6 {"installer":{"name":"uv","version":"0.12.6","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 / hierarch-2.0.0-py3-none-any.whl

Download URL hierarch-2.0.0-py3-none-any.whl
Size 29.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5e469197589dd05d55397db4c995299980171f1f6cbe930f47012137d9c4b4b8
BLAKE2b-256 checksum
How to use checksums
d7afad754b3a73e736d7ea4e9db245255eb2ff581fbeb321af204436a1be8406
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.6 {"installer":{"name":"uv","version":"0.12.6","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

2.0.0 This release

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

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