# Your 30-user pilot could miss a 40% improvement

> Splitting 30 people into two groups makes the measurement too coarse; measuring each person twice can reveal much smaller gains.

Original: https://fdetimes.net/en/guides/pilot-sample-size-mde-30-users/

To detect an effect of d = 0.50 with 80% power, using a two-sided t-test at alpha 0.05, you need 64 people per group, according to a paper by Leon, Davis and Kraemer on pilots in clinical research. Two groups make 128 people. The pilot in this exercise has 30.

If the number 30 was settled before you walked into the meeting, turn the question around: with 30 people, how large must an improvement be for the pilot to see it? Daniël Lakens calls this a sensitivity power analysis: fix the sample size, desired power and alpha, then see which effect size the design can detect.

You will write a short script that answers the question in minutes and percentages. The answer determines whether you should promise to prove effectiveness, change how you measure, or narrow the pilot's goal. You need Python, the statsmodels library and an understanding of standard deviation (SD).

## Step 1: Make the tool reproduce a published number

Install the library in a virtual environment:

```bash
python -m pip install statsmodels
```

The power-solving function in statsmodels needs exactly one parameter set to `None`; the rest must be numbers. To find the MDE, set `effect_size=None`.

To test the tool, use three pairs of numbers from Leon and colleagues: each group needs 393 people for d = 0.20, 100 people for d = 0.40 and 64 people for d = 0.50. Create the file `mde.py`:

```python
from statsmodels.stats.power import TTestPower, tt_ind_solve_power

ALPHA, POWER = 0.05, 0.80

def mde_two_groups(n_per_group):
    return float(tt_ind_solve_power(
        effect_size=None, nobs1=n_per_group,
        alpha=ALPHA, power=POWER, ratio=1))

def mde_paired(n_pairs):
    return float(TTestPower().solve_power(
        effect_size=None, nobs=n_pairs,
        alpha=ALPHA, power=POWER))

for n in (393, 100, 64):
    print(n, round(mde_two_groups(n), 2))
```

**Check:** the script must print 0.2, 0.4 and 0.5 in turn. If it does not, review alpha, power and `nobs1`: this is the size of the first group, while the second group has `nobs1 * ratio`.

Keep this test in the repo. When the client's data scientist asks why they should trust the script, you will have an answer ready.

## Step 2: Split 30 people in half and only very large effects show

The familiar design has 15 people using the new tool and 15 working as before. Add this to the end of the file:

```python
d_ind = mde_two_groups(15)
baseline, sd = 20, 8   # minutes, hypothetical

mde_min = d_ind * sd
print(round(d_ind, 2), round(mde_min, 1), f"{mde_min / baseline:.0%}")
```

**Check:** you get `1.06 8.5 42%`. The effect size here is the difference between two means divided by the standard deviation, so multiplying it by the SD converts it back to minutes.

The illustrative figures: each person takes an average of 20 minutes per ticket, and the SD between employees is 8 minutes. With two groups of 15, the true improvement must be about 8.5 minutes for the pilot to have an 80% chance of producing a statistically significant result.

A true improvement of 8 minutes, or 40%, therefore still has a more than 20% chance of being missed. A tool that saves 5 minutes, a quarter of the time, is far more likely to be missed than the 20% you meant to accept.

Cross-check with the rule n ≈ 16σ²/δ², widely used for alpha 0.05 and power 0.8. With n = 15 per group, δ is approximately 4σ/√15, or 1.03σ. That is slightly optimistic next to 1.06 because it is an approximation, but it is good enough for mental arithmetic in a meeting.

## Step 3: Measure each person twice and watch the MDE shrink

If the same person works under both conditions, some of the difference between fast and slow workers cancels out. Lakens shows that when the correlation between the two measurements is zero, a within-subject design needs half as many people as a between-subject one. The higher the correlation, the greater the relative advantage.

`TTestPower` works for paired t-tests; `nobs` is then the number of pairs. A pair is two measurements of one person, so 30 people give 30 pairs. The effect size is calculated on the differences, so you need the SD of the differences. The `sd_diff` line below is a simplification that treats the SDs under the two conditions as equal:

```python
d_pair = mde_paired(30)
print("paired d:", round(d_pair, 2))

for r in (0, 0.5, 0.7, 0.9):
    sd_diff = sd * (2 * (1 - r)) ** 0.5
    mde_min = d_pair * sd_diff
    print(r, round(mde_min, 1), f"{mde_min / baseline:.0%}")
```

**Check:** `paired d` is 0.53. The converted results, with an SD of 8 minutes and a baseline of 20 minutes:

| Design, 30 people in total | MDE (minutes) | Relative to baseline |
|---|---|---|
| Two groups, 15 each | 8.5 | 42% |
| Paired, r = 0 | 6.0 | 30% |
| Paired, r = 0.5 | 4.2 | 21% |
| Paired, r = 0.7 | 3.3 | 16% |
| Paired, r = 0.9 | 1.9 | 9% |

Do not choose an r because it looks good. Take pre-pilot logs, calculate each person's average in two past periods and measure the correlation. If there are no logs yet, show the client the whole range of r from 0 to 0.7.

Pairing has a price. If everyone uses the old method first, it is hard to separate the tool's effect from practice, or from the next week's tickets being easier.

Have half start with the new tool and half with the old method, then switch. Even so, what people learn in the first period may still affect results in the second.

## Step 4: Completion rates are harder still than time

When the metric is a rate, statsmodels offers `proportion_effectsize`, which uses an arcsine transformation. Add the following, which applies to two independent groups. Using the t-test threshold here is a simplifying approximation:

```python
from statsmodels.stats.proportion import proportion_effectsize

for p_new in (0.80, 0.90, 0.95, 0.98):
    h = proportion_effectsize(p_new, 0.60)
    print(p_new, round(h, 2), h >= d_ind)
```

**Check:** h is 0.44, 0.73, 0.92 and 1.09 in turn; only the last line clears the 1.06 threshold. From a 60% baseline, two groups of 15 need a true rate close to 98% to reach the desired power.

Each person in a group of 15 accounts for about 6.7 percentage points, so treat results from this sample as indicative. Do not use the code above for before-and-after data on the same people, either: those two rates are not independent.

## Step 5: Test a scenario with dropouts

In a paired design, anyone who finishes only one condition does not form a pair. Rerun the calculation from step 3 for a scenario in which 8 people drop out, leaving 22 pairs, and keep r = 0.7:

```python
d_22 = mde_paired(22)
sd_diff = sd * (2 * (1 - 0.7)) ** 0.5
mde_min = d_22 * sd_diff
print(round(mde_min, 1), f"{mde_min / baseline:.0%}")
```

**Check:** the script prints `3.9 19%`. The MDE rises from 3.3 to 3.9 minutes; against the 20-minute baseline, it goes from 16% to 19%. Inviting 30 people does not guarantee 30 pairs of data, so write the minimum number of complete pairs into the plan and track it daily.

## Three mistakes that ruin a readout

The first is counting tickets as people. Thirty people with 50 tickets each do not automatically give you 1,500 independent observations. For this script, reduce the data to one average per person per condition; more tickets make that average less noisy.

The next is running the pilot and then calculating power from the observed effect. Lakens advises against it, because the figure adds no information beyond the p-value. The MDE must be in the plan before the pilot starts, along with the date it was fixed and the SD assumption.

The costliest is seeing an attractive result from a small pilot and promising the client that the rollout will match it. Spotify Confidence calls this phenomenon the winner's curse: when an experiment is underpowered, statistically significant results on average greatly exaggerate the true effect.

Leon and colleagues likewise argue that a pilot does not yield an effect size estimate meaningful enough for planning a later study.

## Ask the client what is worth paying for before opening your laptop

NCCIH, part of the US NIH, advises calculating the sample size for an efficacy study from a clinically meaningful difference. The equivalent question for a client is: "How many minutes, at minimum, would this have to save for you to roll it out?" Ask the person who holds the budget, and write down the answer.

If they say 4 minutes and the measured r is 0.7, the paired design with 30 people works, provided there are enough pairs. If they say 1.6 minutes, you need an MDE only about half as large. Spotify Confidence's documentation notes that halving the MDE quadruples the sample size, to about 120 people here.

If you do not have 120 people, say so plainly and change the goal: let the pilot test integration, usage, error types and log quality. A sentence to put in the plan: "With 30 pairs and r = 0.7, the pilot has 80% power for an improvement of 3.3 minutes; an inconclusive result does not prove the tool is useless."

**Key point:** Failing to see an improvement in a small pilot does not mean there is none.

## A good readout sentence always has a confidence interval

At the readout, present the estimate with its confidence interval. METR did so when it measured AI's effect on the time developers take to work: for the newly recruited group, the estimate was -4%, with an interval from -15% to +9%. The interval contains 0, so readers see at once that the data cannot settle whether AI made those developers faster or slower.

Staying with the illustrative figures, if all 30 pairs are complete, r = 0.7 and the measured average difference is 3.5 minutes, the readout could say: "The tool saved an estimated 3.5 minutes per ticket (95% confidence interval: 1.2 to 5.8 minutes); the data are not sufficient to confirm that it reaches the 4-minute mark." That interval is 3.5 ± 2.3.

The 2.3 is the SD of the differences (6.2 minutes) divided by √30, multiplied by the t threshold of 2.05.

The skill is also easy to demonstrate when you apply for a job. In job postings, look for phrases such as "measure impact", "success metrics" or "experiment design". Put the script, the MDE table and a one-page readout using simulated data on GitHub.

The readout page should follow the order a decision-maker needs: the pending decision, the metric and threshold fixed before the pilot began, then the design and the number of complete pairs.

Next come the estimate with its confidence interval, what the data cannot yet answer and the next step you recommend. On your CV, state the decision you changed because of the calculation, such as moving from two groups to a paired design, if you really did so.

The next time someone says "just try it with 30 people and see", ask: see how much? You can now answer in minutes, before the first user logs in.

**Try this week:**

- Take the logs of a process you work on, calculate the mean and standard deviation across people, then run mde.py with your real sample size.
- Split past logs into two periods, calculate the correlation between each person's two measurements and plug it into step 3.
- Write a one-page pilot design: the metric, the improvement that matters, the MDE and the questions the pilot cannot answer.

## Sources

- [statsmodels.stats.power.TTestPower.solve_power](https://www.statsmodels.org/stable/generated/statsmodels.stats.power.TTestPower.solve_power.html)

- [statsmodels.stats.power.tt_ind_solve_power](https://www.statsmodels.org/stable/generated/statsmodels.stats.power.tt_ind_solve_power.html)

- [statsmodels.stats.proportion.proportion_effectsize](https://www.statsmodels.org/stable/generated/statsmodels.stats.proportion.proportion_effectsize.html)

- [Improving Your Statistical Inferences, 8 Sample Size Justification](https://lakens.github.io/statistical_inferences/08-samplesizejustification.html)

- [The Role and Interpretation of Pilot Studies in Clinical Research](https://pmc.ncbi.nlm.nih.gov/articles/PMC3081994)

- [Pilot Studies: Common Uses and Misuses](https://www.nccih.nih.gov/grants/pilot-studies-common-uses-and-misuses)

- [All about Sample-Size Calculations for A/B Testing: Novel Extensions & Practical Guide](https://ar5iv.labs.arxiv.org/html/2305.16459)

- [What is a Sample Size? (Spotify Confidence glossary)](https://confidence.spotify.com/glossary/sample-size)

- [Lesson 11: The winner's curse (Type M and Type S errors)](https://confidence.spotify.com/bootcamp/interpreting-experiment-results/type-m-and-type-s-errors)

- [Why Within-Subject Designs Require Fewer Participants than Between-Subject Designs](https://daniellakens.blogspot.com/2016/11/why-within-subject-designs-require-less.html?m=0)

- [METR developer productivity experiment update](https://metr.org/blog/2026-02-24-uplift-update/)
