gstZTest) for sequential analysis.
Fixed Horizon vs Sequential Tests
The Stats API supports two testing approaches:| Method | Description | When to Use |
|---|---|---|
zTest | Fixed horizon z-test | When you analyze results once at the end of the experiment |
gstZTest | Group sequential z-test | When you want to analyze results continuously during data collection |
Configure a Group Sequential Test
Group sequential tests provide valid statistical conclusions even when you analyze results multiple times during data collection. You need to specify the expected maximum sample size upfront. In your analysis plan, specifygstZTest in the hypothesis segments:
maxSampleSize parameter helps the test allocate the false positive rate optimally across analyses. Your estimate doesn’t need to be exact, but a reasonable estimate improves power.
Configure a Fixed Horizon Test
For metrics you only analyze once at the end of the experiment, use the standardzTest:
Provide Time-Series Data
Sequential tests require time-series data to track how results evolve. Structure your data withtimeLabel values containing cumulative statistics up to each time point:

