Skip to main content

Kotlin Notebook

Try this guide as a Kotlin Notebook with Kandy visualizations — run the cells to see charts and explore the data interactively.
This guide walks through an A/B test comparing two checkout flow variants in a mobile app. The primary metric is session duration (seconds); the secondary metric is number of completed steps.

Experiment Data

Step 1: Summarize Both Groups

Step 2: Check Assumptions

Normality

Variance homogeneity

Step 3: Choose and Run the Test

If the Levene test confirmed equal variances:

Effect size — Cohen’s d

A tells you whether a difference exists; effect size tells you how large it is. Cohen’s d expresses the difference in standard-deviation units: |d| < 0.2 negligible, 0.2 small, 0.5 medium, 0.8+ large.

One-sided tests

When you expect the treatment to reduce session duration:

Step 4: Test a Second Metric

Apply the same workflow to the secondary metric.

Multiple comparison correction

Testing two metrics (duration and steps) inflates the false-positive rate. correction adjusts p-values to account for this.

Step 5: Correlation Between Metrics

Check whether the two metrics move together within each group.
Spearman correlation is preferred here because one metric (steps) is ordinal.

Paired Before/After Comparison

When the same users are measured before and after a change, use paired tests.
Last modified on April 18, 2026