← IndexEntry № 067·data

Analyze an A/B Test for Statistical Significance

Statistically analyze an A/B test result with significance testing and a ship/no-ship recommendation.

Optimized for
ClaudeChatGPT
§ When to use this

This prompt runs a full statistical analysis of an A/B test and ends with a clear ship-or-not call, plus the Python code to reproduce every number. It asks for conversion rates, relative lift, a two-proportion z-test, the p-value against your threshold, and a minimum-detectable-effect sanity check, which together prevent the common mistake of shipping on a lift that isn't actually significant. Use it when you have raw counts from an experiment and need a defensible, repeatable decision rather than a gut read.

§ The Prompt— fill in the fields, then copy or open in a tool
§ Customize0/3 fields filled
your prompt — fill the fields above
You are a data scientist specializing in experimentation. Analyze this A/B test result. Calculate: (1) conversion rate for control and treatment, (2) relative lift, (3) statistical significance using a two-proportion z-test (or chi-square), (4) p-value and whether it meets our [SIGNIFICANCE THRESHOLD: e.g. p < 0.05] threshold, (5) minimum detectable effect check. State clearly: should we ship the treatment? Include the Python code to reproduce this.

TEST DATA:
Control: [N users], [X conversions]
Treatment: [N users], [X conversions]
Open with your prompt →ChatGPTClaudeSends your filled-in prompt straight into a new chat.
§ Example Output

What you can expect back

Results
- Control conversion: 496 / 12,400 = 4.00%
- Treatment conversion: 575 / 12,510 = 4.60%
- Relative lift: +14.9%
- Two-proportion z-test: z = 2.42, p = 0.0156
- Meets p < 0.05? Yes.

Recommendation: Ship the treatment. The 0.6 percentage-point absolute gain is statistically significant at your threshold, and the sample is large enough to detect an effect of this size.

Reproduce:
from statsmodels.stats.proportion import proportions_ztest
count = [575, 496]; nobs = [12510, 12400]
z, p = proportions_ztest(count, nobs)
print(z, p)

Illustrative example — your results will vary by tool and inputs.

§ Pro Tips

Get sharper results

  • 01Tell the model whether your hypothesis is one-sided ('treatment is better') or two-sided, because that halves or doubles the p-value and can flip a borderline result.
  • 02Give it the planned sample size and minimum effect you cared about up front, so the MDE check tells you whether a non-significant result means 'no effect' or just 'underpowered'.
  • 03Watch for the peeking problem: mention if you stopped the test early or checked results repeatedly, since that inflates false positives and the naive p-value will mislead you.
  • 04Ask for a confidence interval on the lift, not just the p-value, because a wide interval that includes zero is a clearer 'don't ship' signal than a bare significance verdict.
  • 05Run the Python it gives you rather than trusting the hand-computed numbers, since arithmetic done in prose can be off while the code is verifiable.
§ Variations

Adapt it for your case

Revenue per user, not conversion

Provide means and standard deviations per group and ask for a two-sample t-test instead of a proportion test.

Bayesian framing

Add 'analyze this Bayesian-style: give the probability that treatment beats control and the expected loss of shipping' for a decision-oriented readout.

Sample size for next test

Flip the prompt to a planning tool: 'given a baseline of X% and a target lift of Y%, compute the users per arm needed at 80% power'.

Best For — Roles
Use For — Tasks
Tags#ab-testing#statistics#data-analysis
§ FAQ

Common questions

Can I trust the p-value the AI calculates by hand?

Verify it by running the provided Python; language models can make arithmetic slips in prose, whereas executing the statsmodels code gives you the exact, reliable number.

What if my result is significant but the lift is tiny?

Significance only says the effect is probably real, not that it's worth shipping; weigh the absolute lift against implementation cost and any risk the change introduces.

Does it handle more than two variants?

For A/B/n tests, tell it so and ask for a chi-square omnibus test plus pairwise comparisons with a multiple-comparison correction like Bonferroni.

§ Related Entries

You may also need