Sitewide impact
Use increment.estimators.sitewide(experiment, reader, metric) to estimate
how much the whole site would have changed during the observed experiment
window if the measured effect had applied to every enrolled unit.
It is a rollout estimate for that window, not a forecast.
For example, the complete revenue example estimates a per-unit gain of 5.92 across 200 enrolled units. Rolling that effect out to all 200 gives an estimated site gain of 1,184.44, with interval [385.90, 1,982.98]. That is 78.81% of the estimated no-treatment site baseline—not 78.81% per-user lift, and not annual revenue.
Run it
Section titled “Run it”- Use an experiment built with
from_definitions, or adopt afrom_unit_day_artifactartifact published with the metric’ssite_volumeextension. Frame summaries, panels and moments do not carry whole-site raw-event totals. - Choose an unwindowed mean metric aggregated by sum or count, or a ratio whose two components use those aggregations. A converter indicator is not additive; use a count on its event fact instead.
- Call
sitewide(experiment, reader, "revenue_per_user"). For multiple treatment arms, also passarm="treatment_b"to choose one.
Start with the complete native example: it visibly creates every YAML definition, event row and DuckDB table before the call. For a saved artifact and both population choices, use the complete assigned/triggered example. Neither requires a prepared variable from another page.
Read the result
Section titled “Read the result”For a mean metric, SitewideImpact.absolute_impact is the estimated gain
in the metric’s own units. The baseline subtracts treatment lift already
present in observed site volume; the gain then applies that lift to all
enrolled units, including control. Background activity from people never
enrolled still belongs in site volume.
For a ratio metric, SitewideRatioImpact.absolute_impact is
shipped_ratio - baseline_ratio: a difference of site ratios of totals,
not a ratio of differences or an average of individual ratios.
For either model, relative_impact divides the absolute gain by its
baseline. A non-positive baseline makes relative impact undefined and the
call refuses rather than returning a misleading fraction.
Use absolute_impact_lb / absolute_impact_ub for the absolute interval,
or relative_impact_lb / relative_impact_ub for the relative interval.
Both results are exploratory_unadjusted: no family adjustment is applied,
and the fixed-horizon intervals are not anytime-valid. The
field reference and
calculation
give the exact definitions and uncertainty formulas.
Assigned or triggered
Section titled “Assigned or triggered”With a declared trigger:, choose the population that answers your question:
| Choice | Question |
|---|---|
population="assigned" (default) | What is the intent-to-treat impact of assignment? |
population="triggered" | What if the effect among finalized trigger members applied to all triggered enrolled units? |
Both use the experiment calendar window and full-site volume, not only
triggered users’ activity. This differs from run()’s trigger-anchored
windows: outcomes after experiment end are excluded even if
observation_end is later. A late trigger can still qualify for membership.
The triggered interpretation assumes membership is independent of treatment assignment, never-triggered units are unaffected, and enrolled units exhaust exposure. Its allocation-balance diagnostic cannot establish those causal assumptions.
Outcomes must be complete through experiment end. Triggered calls require
a feed watermark in SourceSnapshotEvidence or the artifact proving this.
Assigned calls refuse if a declared snapshot cutoff or watermark ends too
early; a native call without snapshot evidence has no cutoff to check.
See population and completeness contracts,
including the limits of snapshot identity and simulation evidence.
Multi-arm experiments
Section titled “Multi-arm experiments”Pass arm= to ask what would happen if one selected arm alone shipped
to everyone, compared with no treatment. Arms are not combined into an
unshippable scenario. The baseline removes every enrolled non-control
arm’s lift, not just the selected arm’s; those shared-baseline estimates
also contribute uncertainty. See
multi-arm covariance.
Cluster-randomized experiments
Section titled “Cluster-randomized experiments”Declare Experiment.cluster when stores, markets or other clusters—not
individual measured units—were assigned. Supported mean/ratio metrics
still need unwindowed sum/count components. Clustering leaves the point
estimate unchanged but changes its standard error and uses a t reference;
absolute_dof and relative_dof can differ.
Each enrolled arm needs at least two clusters. Below 40 total clusters,
a RuntimeWarning flags over-rejection risk; borderline significance is
fragile. This is a warning threshold, not an admission floor. Adding units
within a cluster is not a substitute for more independent clusters.
The cluster reference explains the variance calculation and arm-specific degrees of freedom.
When it refuses
Section titled “When it refuses”Use randomized experiments with additive, calendar-window-aligned metrics.
Retention, quantiles, conversion indicators, per-unit windows and
non-additive aggregations cannot supply aligned site totals. Observational
and encouragement designs are not supported by this unadjusted contrast;
use run(experiment, reader) for those designs.
If outcomes are incomplete, wait for feeds through experiment end. If an
artifact lacks trigger membership, republish it with trigger_population.
Find exact reasons and recovery steps in
when it refuses.
Worked example
Section titled “Worked example”The complete native example creates definitions and raw events, including off-experiment activity, then computes the mean and ratio results interpreted above.
A cluster-randomized rollout
Section titled “A cluster-randomized rollout”Continue that example with the store rollout to see how 50 clusters change interval uncertainty without changing the point-estimate calculation.