Skip to content
Development documentation. The PyPI package predates these APIs. Install from GitHub instead: pip install 'increment @ git+https://github.com/kylejcaron/increment.git' Keep any extras requested by the guide, such as increment[dashboard].

Compliance sufficient state

ComplianceArm(group_id, n_units, uptake_total, n_clusters, ref_uptake, cluster_uptake1, cluster_uptake2, ref_size, cluster_size1, cluster_size2, cluster_cross)

One arm’s design-level uptake sufficient state.

Unit count and uptake total, computed on the design’s own declared enrollment/uptake cohort — never any outcome metric’s moments, so metric declaration order, count, and per-metric missingness cannot change it. When a randomization/dependence cluster is declared, also carries the complete centered bivariate moments of cluster uptake totals U_g and cluster sizes M_g: each family’s reference mean, first residual sum, second residual sum, and their cross moment — the same sufficient state :func:~increment.estimation.variance.cluster_uptake_moments reads off an ArmStats row with x_role="uptake_total". These fields are never derived by averaging per-cluster uptake rates: a member-weighted ratio-of-totals needs the totals themselves.

n_clusters is the independent cluster count K; n_units is the true unit count. The two are tracked separately because, at cluster grain, the moments above are computed over the K clusters, not the n_units members — collapsing them onto a single field the way a cluster-grain ArmStats.n does would discard one of the two counts.

ComplianceSummary(study_id, cohort, window_days, one_sided, cluster, as_of, arms, control_group)

Design-level compliance sufficient state: one canonical arm per group.

Built by MomentSource.compliance_summary, independent of any outcome metric’s declaration, order, count, or missingness — the population is the design’s own declared enrollment/uptake cohort (design.uptake.fact, honoring design.uptake.window_days and as_of). cohort/window_days/one_sided/cluster/ as_of are this summary’s design/cohort/time identity: a consumer combining or reloading summaries validates them before use rather than trusting a numerically-agreeing-by-accident pair.

Frozen and duplicate-checked at construction: mutating a caller’s own nested arms sequence after passing it in cannot alter this summary (arms is copied into an immutable tuple), and reassigning any field raises.