Statistics Toolkit
Hypothesis tests, confidence intervals, sample-size and power planning, regression-output interpretation and a normal/t/chi-square/F calculator.
When you’ll use this
- Statistics core, weeks 3-5: check one- and two-sample t-test homework, including Welch vs pooled
- Statistics core, weeks 5-6: proportion and chi-square problems (survey shares, contingency tables)
- Statistics core, weeks 7-10: read regression output, including log-log elasticities and dummy variables
- Marketing analytics: size an A/B test and judge whether a lift in conversion is significant
- Exam prep: replace printed z, t, chi-square and F tables with exact critical values and p-values
- Summer internship or consulting project: sanity-check a survey margin of error before fielding it
Statistics Toolkit tool
Have raw data? Paste it to fill the summary statistics
Decision at α = 0.05
Do not reject H₀
Two-sided p-value 0.0720 is above α
Test statistic (t)
1.822
df = 82.79
p-value (two-sided)
0.0720
Effect size: Cohen's d
0.392
Conventionally small
95% CI for difference in means x̄₁ − x̄₂
-0.32 to 7.32
Estimate 3.5
- H₀
- μ₁ − μ₂ = 0
- H₁
- μ₁ − μ₂ ≠ 0
What this means
- At α = 0.05, do not reject H₀: the data are not significant evidence that the difference in population means (group 1 − group 2) is different from 0 (t(82.8) = 1.82, p = 0.072). That is not proof that it equals 0; the sample may be too small to detect a real difference.
- If H₀ were true, a result at least this extreme would occur with probability 0.0720.
- Effect size: Cohen's d = 0.39 (small by Cohen's conventions).
- 95% confidence interval for μ₁ − μ₂: -0.320 to 7.320.
| Alternative | p-value |
|---|---|
| Left-tailed (H₁: less) | 0.9640 |
| Right-tailed (H₁: greater) | 0.0360 |
| Two-sided (H₁: ≠) | 0.0720 |
| Item | Value |
|---|---|
| Test statistic t | 1.8225 |
| Degrees of freedom | 82.79 |
| Standard error | 1.92048 |
| Difference in means x̄₁ − x̄₂ | 3.5 |
| Value under H₀ | 0 |
| Lower critical value at α = 0.05 | -1.989 |
| Upper critical value at α = 0.05 | 1.989 |
| 95% confidence interval | -0.3199 to 7.3199 |
| Pooled standard deviation sp | 8.92663 |
| Hedges' g (small-sample corrected d) | 0.38853 |
| Pooled df (for comparison) | 83 |
Data table
| t | Density under H₀ |
|---|---|
| -3.2 | 0.00 |
| -3.1 | 0.00 |
| -3.0 | 0.00 |
| -3.0 | 0.01 |
| -2.9 | 0.01 |
| -2.8 | 0.01 |
| -2.7 | 0.01 |
| -2.6 | 0.01 |
| -2.6 | 0.02 |
| -2.5 | 0.02 |
| -2.4 | 0.02 |
| -2.3 | 0.03 |
| -2.2 | 0.03 |
| -2.2 | 0.04 |
| -2.1 | 0.05 |
| -2.0 | 0.06 |
| -1.9 | 0.06 |
| -1.8 | 0.07 |
| -1.8 | 0.09 |
| -1.7 | 0.10 |
| -1.6 | 0.11 |
| -1.5 | 0.13 |
| -1.4 | 0.14 |
| -1.4 | 0.16 |
| -1.3 | 0.18 |
| -1.2 | 0.19 |
| -1.1 | 0.21 |
| -1.0 | 0.23 |
| -1.0 | 0.25 |
| -0.9 | 0.27 |
| -0.8 | 0.29 |
| -0.7 | 0.31 |
| -0.6 | 0.32 |
| -0.6 | 0.34 |
| -0.5 | 0.35 |
| -0.4 | 0.37 |
| -0.3 | 0.38 |
| -0.2 | 0.39 |
| -0.2 | 0.39 |
| -0.1 | 0.40 |
| 0.0 | 0.40 |
| 0.1 | 0.40 |
| 0.2 | 0.39 |
| 0.2 | 0.39 |
| 0.3 | 0.38 |
| 0.4 | 0.37 |
| 0.5 | 0.35 |
| 0.6 | 0.34 |
| 0.6 | 0.32 |
| 0.7 | 0.31 |
| 0.8 | 0.29 |
| 0.9 | 0.27 |
| 1.0 | 0.25 |
| 1.0 | 0.23 |
| 1.1 | 0.21 |
| 1.2 | 0.19 |
| 1.3 | 0.18 |
| 1.4 | 0.16 |
| 1.4 | 0.14 |
| 1.5 | 0.13 |
| 1.6 | 0.11 |
| 1.7 | 0.10 |
| 1.8 | 0.09 |
| 1.8 | 0.07 |
| 1.9 | 0.06 |
| 2.0 | 0.06 |
| 2.1 | 0.05 |
| 2.2 | 0.04 |
| 2.2 | 0.03 |
| 2.3 | 0.03 |
| 2.4 | 0.02 |
| 2.5 | 0.02 |
| 2.6 | 0.02 |
| 2.6 | 0.01 |
| 2.7 | 0.01 |
| 2.8 | 0.01 |
| 2.9 | 0.01 |
| 3.0 | 0.01 |
| 3.0 | 0.00 |
| 3.1 | 0.00 |
| 3.2 | 0.00 |
How this works
- Formula sheet: Investments
- Formula sheet: Statistics & Analytics
- Formula sheet: Operations
- Formula sheet: Marketing
This toolkit has five tabs: hypothesis tests, confidence intervals, sample-size and power planning, a regression-output interpreter, and a distribution calculator. Each one runs on summary statistics you type in (means, standard deviations, counts) or on raw data you paste. Everything is computed in your browser. The special functions (normal CDF, incomplete beta and gamma, and their inverses) are implemented from scratch and tested against spreadsheet values to at least nine decimal places.
Formulas
One-sample tests. With sample mean , standard deviation (or known ), size and benchmark :
Two independent samples. Welch’s version does not assume equal variances. The pooled version does:
Paired data. Apply the one-sample t test to the differences: with .
Proportions. Both tests use the standard error under the null:
Chi-square. Goodness-of-fit uses , where is the number of parameters estimated from the data. Independence uses and :
p-values. The left tail is and the right tail is . The two-sided p-value is twice the smaller of the two, capped at 1. Chi-square tests are right-tailed.
Effect sizes.
- Cohen’s d is for one sample and for two. For paired data it is .
- Cohen’s h is .
- Cohen’s w is .
- Cramér’s V is .
Confidence intervals. For a mean, use , or when σ is known. For a difference in means, use the same SE and df as the matching test. For a proportion the tool gives two intervals. The Wald interval is . The Wilson score interval is:
Sample size (rounded up):
Here means for a two-sided design, and . A one-mean design drops the factor of 2.
Regression. Each coefficient gets with and an interval . The model as a whole gets:
Special functions. The building blocks are:
- the normal CDF from the incomplete gamma:
- the t tail:
- chi-square:
- F:
Conventions & assumptions
- Probabilities are decimals. Enter α = 0.05, not 5. Confidence levels work the same way (0.95).
- Decision rule. Reject H₀ when p ≤ α. “Do not reject” never means H₀ is proven.
- Standard deviations use the n − 1 divisor (Excel’s STDEV.S). In the one-sample z test, the value you enter is the known population σ.
- Two-sample direction. The difference is always group 1 minus group 2, and Δ₀ is the hypothesized value of that difference (usually 0).
- One-sided tests. The confidence bound shown is one-sided too, at level 1 − α, so it always agrees with the decision.
- Welch is the default for two independent means. Use pooled only when you have good reason to believe the population variances are equal. The tool warns you when one SD is more than twice the other.
- Proportion tests use the normal approximation. The tool warns you when expected successes or failures are small.
- Chi-square tests use no continuity (Yates) correction, which is the same as Excel’s CHISQ.TEST. Expected shares in goodness-of-fit are rescaled to the observed total, so you can enter them as proportions or as counts.
- Effect-size labels follow Cohen’s conventions: 0.2, 0.5 and 0.8 for d and h, and 0.1, 0.3 and 0.5 for w. The thresholds for V are those for w divided by √(min(r, c) − 1). These are rules of thumb. What counts as a meaningful effect depends on the business context.
- Sample-size formulas use the normal (z) approximation. The exact t-based answer is usually one to three observations larger for small studies. Power calculations count both rejection tails in a two-sided design.
- Regression. k counts slope predictors and excludes the intercept. Coefficient p-values are two-sided. Log means the natural log. With ln(Y) and a predictor X, a one-unit change in X shifts Y by about 100·b percent; the exact figure is 100(eᵇ − 1). With ln(Y) and ln(X), b is an elasticity: a 1% change in X shifts Y by about b%, exactly 100(1.01ᵇ − 1)%. With Y and ln(X), a 1% change in X shifts Y by about b/100 units. For a 0/1 dummy, “one unit” means switching from 0 to 1.
- Non-integer degrees of freedom (as in Welch) are used exactly. Excel’s T.DIST family truncates df to a whole number, so its results differ slightly.
- Accuracy. Inverses are found by bracketing and bisection, down to a few units in the last floating-point place. They report whether they converged. Above 10 million df, t is treated as standard normal.
Worked example
The tool opens with one example per tab.
Example: Hypothesis test: does a new checkout layout raise average basket size?
A store tests a new layout (group 1) against the old one (group 2). The alternative is two-sided and α = 0.05.
- Group 1: mean 52.4, SD 8.1, n = 40.
- Group 2: mean 48.9, SD 9.6, n = 45.
The tool runs a Welch t test:
- The squared standard error is 8.1²/40 + 9.6²/45 = 1.64025 + 2.048 = 3.68825, so SE = 1.9205.
- t = (52.4 − 48.9) / 1.9205 = 1.822.
- The Welch df is 3.68825² / (1.64025²/39 + 2.048²/44) = 82.79.
The two-sided p-value is 0.072, which is above 0.05, so do not reject H₀. The 95% interval for the difference uses t* = 1.989 and runs from −0.32 to 7.32. It includes 0.
The pooled SD is √79.685 = 8.927, so Cohen’s d = 3.5 / 8.927 = 0.39 (small). The lift may be real, but this sample cannot separate it from noise.
Example: Confidence interval: 46 of 120 surveyed students would pay
p̂ = 46/120 = 0.3833, and at 95% z* = 1.96.
- Wald: 0.3833 ± 0.0870 gives 0.2963 to 0.4703.
- Wilson: the centre shifts toward one half, to 0.3870, with a half-width of 0.0857. That gives 0.3012 to 0.4727.
With 46 successes and 74 failures the two intervals are close. They drift apart as the counts get small.
Example: Sample size: compare two means
The goal is to detect a 5-point difference when σ = 12, at α = 0.05 (two-sided) with 80% power.
n = 2 × ((1.95996 + 0.84162) × 12/5)² = 2 × 45.2095 = 90.42. Round up to 91 per group, or 182 in total. At 91 per group the power is 80.25%.
Example: Regression: ln(weekly units sold) on ln(ad spend) and a promotion dummy
The model has n = 60 and k = 2, so df = 57 and t* = 2.0025.
| Term | b | SE | t | p | 95% CI |
|---|---|---|---|---|---|
| Intercept | 2.10 | 0.35 | 6.00 | 1.4 × 10⁻⁷ | 1.40 to 2.80 |
| ln(ad spend) | 0.42 | 0.09 | 4.67 | 1.9 × 10⁻⁵ | 0.24 to 0.60 |
| Promotion week (0/1) | 0.15 | 0.05 | 3.00 | 0.004 | 0.05 to 0.25 |
- Ad spend. The ad-spend coefficient is an elasticity: 1% more ad spend goes with about 0.42% more units (exactly 1.01^0.42 − 1 = 0.419%).
- Promotion weeks. These sell about 15% more, and the exact figure is e^0.15 − 1 = 16.18%.
- Intercept. The intercept implies about e^2.1 ≈ 8.17 units when ln(ad spend) is 0. That point is outside the data and has no business meaning.
R² = 0.48 and adjusted R² = 1 − 0.52 × 59/57 = 0.462. Overall F = (0.48/2)/(0.52/57) = 26.31 on (2, 57) df, with a p-value of about 8 × 10⁻⁹.
Example: Distribution calculator: t with 24 df at x = 2.1
- P(T ≤ 2.1) = 0.97679.
- The right tail is 0.02321.
- The two-tailed probability is 0.04642.
Going the other way, a two-tailed area of 0.05 leaves 0.025 in each tail, which gives the critical values ±2.0639.
Limitations
- Summary statistics only for the means tests. The tool cannot check normality, outliers or independence for you. Paste raw data and look at it before trusting a t test with a small sample.
- No exact tests. For small counts, Fisher’s exact test or an exact binomial test is more reliable than the z and chi-square approximations shown here.
- No multiple-comparison adjustment. If you run many tests, some will come out “significant” by chance.
- Sample-size results depend entirely on your planning values for σ, p and the effect size. They assume simple random samples, with no clustering and no attrition.
- The regression interpreter takes coefficients and standard errors as given. It does not know whether they are robust or clustered, and it cannot detect omitted variables, multicollinearity or heteroskedasticity. The overall F assumes the usual (non-robust) OLS setup. Interpretation sentences describe associations, not causal effects.
- Statistical significance is not practical significance. Always read the effect size and the confidence interval together with the p-value.
Excel/Sheets equivalents
| Quantity | Excel / Google Sheets |
|---|---|
| Normal CDF / inverse | NORM.S.DIST(z, TRUE), NORM.S.INV(p), NORM.DIST(x, mean, sd, TRUE), NORM.INV(p, mean, sd) |
| t tails / inverse | T.DIST(t, df, TRUE), T.DIST.RT(t, df), T.DIST.2T(abs(t), df), T.INV(p, df), T.INV.2T(alpha, df) |
| Chi-square | CHISQ.DIST(x, df, TRUE), CHISQ.DIST.RT(x, df), CHISQ.INV.RT(p, df), CHISQ.TEST(observed, expected) |
| F | F.DIST(x, d1, d2, TRUE), F.DIST.RT(x, d1, d2), F.INV.RT(p, d1, d2) |
| t tests on raw data | T.TEST(r1, r2, tails, type), where type 1 = paired, 2 = pooled and 3 = Welch |
| z test on raw data | Z.TEST(range, mu0, sigma) (one-sided, upper tail) |
| CI margin for a mean | CONFIDENCE.T(alpha, sd, n), CONFIDENCE.NORM(alpha, sigma, n) |
| Summary statistics | AVERAGE, STDEV.S, MEDIAN, COUNT |
| Regression output | LINEST(y, x, TRUE, TRUE) (Excel’s Analysis ToolPak also prints a full table) |
| Error function | ERF(x), ERFC(x) |
Excel’s T.DIST, T.INV and CHISQ functions truncate a fractional df, so to reproduce a Welch p-value exactly, use software that accepts fractional degrees of freedom. See also the decision-tree tool and the core curriculum guide.
Runs entirely in your browser; inputs are saved only on this device. Last updated .