stats

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const MinSampleSizeForSignificance = 30

MinSampleSizeForSignificance defines the minimum exposures per variant before calculating statistical significance.

Variables

This section is empty.

Functions

func AnalyzeExperiment

func AnalyzeExperiment(
	flagKey, metricName string,
	eventType domain.EventType,
	env domain.Environment,
	controlVariant string,
	exposures map[string]int64,
	events []domain.ExperimentEvent,
) domain.ExperimentReport

AnalyzeExperiment builds a complete statistical report for an A/B test.

func CompareBinaryVariants

func CompareBinaryVariants(control, treatment domain.VariantMetricStats) domain.VariantComparison

CompareBinaryVariants performs a two-proportion pooled Z-test between Treatment and Control.

func ComputeVariantBinaryStats

func ComputeVariantBinaryStats(variant string, exposures, conversions int64) domain.VariantMetricStats

ComputeVariantBinaryStats computes conversion rates, standard error, and confidence intervals for binary metrics.

func NormalCDF

func NormalCDF(z float64) float64

NormalCDF computes the cumulative distribution function of the standard normal distribution using math.Erf.

func TwoTailedPValue

func TwoTailedPValue(z float64) float64

TwoTailedPValue computes the two-tailed p-value from a Z-score.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL