Running time and sample size - Docs - PostHog

Running time and sample size

Contents

Before running an experiment, you'll want to know how long it needs to run to get reliable results. The running time calculator helps you estimate this based on your traffic and the size of effect you want to detect.

Finding the calculator

The running time indicator appears on your experiment page, showing the estimated remaining time and a progress indicator:

Click the gear icon next to the time estimate to open the configuration modal:

Calculation modes

The calculator offers two modes: automatic and manual:

Automatic mode

Automatic mode uses real data from your running experiment to calculate estimates. It looks at:

This mode requires at least 1 day of runtime and 100 exposures before estimates appear. Until then, you'll see "Pending" in the running time indicator.

Automatic mode requires real data

Automatic mode is only available after launching your experiment since it requires real data. For draft experiments, use manual mode to estimate running time before launch.

Once you have enough data, automatic mode shows:

Manual mode

Manual mode lets you estimate running time using your own inputs rather than real data. Use it when you know your approximate traffic numbers and baseline metrics.

To use manual mode:

  1. Select your metric type:
  1. Enter your baseline value:
  1. Set the minimum detectable effect (see section below)

  2. Enter expected exposures per day: Total users entering the experiment daily across all variants

The calculator shows your recommended sample size and estimated running time based on these inputs.

Minimum detectable effect (MDE)

The minimum detectable effect is the smallest change you want your experiment to reliably detect. Think of it as your sensitivity setting.

The default is 30%, which is a reasonable starting point for most experiments.

How to choose your MDE:

The MDE setting is shared between automatic and manual modes—changing it in one place updates it everywhere.

Understanding the results

The calculator outputs the following results:

When you've collected enough data, the indicator shows "Complete" with a checkmark, meaning you have sufficient statistical power to detect the effect size you specified.

Note: "Complete" means you have enough data for your specified MDE. You should still check if your results are statistically significant before making decisions. Having enough sample size doesn't guarantee you'll see a significant result – it means if there is a real effect of that size, you're likely to detect it.

How the sample size formula works

The calculator uses a standard statistical power analysis formula:

PostHog AI

N = (16 × variance) / d²

Where:

The total sample size is then multiplied by the number of variants in your experiment.

Variance by metric type:

Metric type Variance formula
Funnel p × (1 - p), where p is the conversion rate
Count 2 × baseline
Sum/Avg 0.25 × baseline²

For example, with a 10% conversion rate (p = 0.1) and 20% MDE:

Tips for accurate estimates

  1. Use automatic mode when possible: Real data is more reliable than estimates. Once your experiment has been running for a day with 100+ exposures, automatic mode gives you the most accurate projections.

  2. Be realistic with manual estimates: If you're planning an experiment, use actual historical data for your baseline values and traffic numbers rather than optimistic guesses.

  3. Consider your MDE carefully: Setting MDE too low means waiting longer for results. Setting it too high means you might miss meaningful improvements. Find the balance that makes sense for your specific situation.

  4. Check progress regularly: The remaining time estimate updates as more data comes in. Early estimates may shift as the calculator gets a better picture of your actual traffic patterns.