Reference
Statistics Formulas Cheat Sheet
Every formula you meet in an introductory statistics course on one page, grouped by topic, with a calculator next to each so you can check your arithmetic. Most test statistics follow one pattern: estimate minus hypothesised value, divided by the standard error. A worked check at the bottom runs the main formulas on one small data set.
Descriptive statistics
| Quantity | Formula | Calculator |
|---|---|---|
| Mean | x̄ = Σx / n | Mean, median, mode |
| Median | Middle value of the ordered data; average of the two middle values if n is even | Mean, median, mode |
| Range | max − min | Range |
| Sample variance | s² = Σ(x − x̄)² / (n − 1) | Variance |
| Population variance | σ² = Σ(x − μ)² / N | Variance |
| Standard deviation | s = √s² (σ = √σ² for a population) | Standard deviation |
| Coefficient of variation | CV = s / x̄ | Coefficient of variation |
| Standard error of the mean | SE = s / √n | Standard deviation |
| z-score | z = (x − μ) / σ | Z-score |
| Interquartile range and outlier fences | IQR = Q3 − Q1; outliers lie below Q1 − 1.5·IQR or above Q3 + 1.5·IQR | Quartiles |
Probability and counting
| Rule | Formula | Calculator |
|---|---|---|
| Complement | P(not A) = 1 − P(A) | Probability |
| Addition rule | P(A or B) = P(A) + P(B) − P(A and B) | Probability of multiple events |
| Multiplication rule | P(A and B) = P(A) · P(B given A); for independent events P(A) · P(B) | Probability of multiple events |
| Conditional probability | P(B given A) = P(A and B) / P(A) | Conditional probability |
| Bayes' theorem | P(A given B) = P(B given A) · P(A) / P(B) | Bayes' theorem explained |
| Permutations | nPr = n! / (n − r)! (5P2 = 20) | Permutations |
| Combinations | nCr = n! / (r! (n − r)!) (5C2 = 10) | Combinations |
| Expected value | E(X) = Σ x · P(x) | Expected value explained |
Distributions
| Distribution | Probability, mean and variance | Example | Calculator |
|---|---|---|---|
| Binomial | P(X = k) = C(n, k) · p^k · (1 − p)^(n − k); mean np; variance np(1 − p) | n = 10, p = 0.3, k = 3: 0.2668 | Binomial |
| Poisson | P(X = k) = e^(−λ) · λ^k / k!; mean = variance = λ | λ = 2, k = 3: 0.1804 | Poisson |
| Geometric | P(X = k) = (1 − p)^(k − 1) · p, with k the trial of the first success; mean 1/p | p = 0.2, k = 4: 0.1024, mean 5 | Geometric |
| Negative binomial | P(X = k) = C(k − 1, r − 1) · p^r · (1 − p)^(k − r), with k the trial of the r-th success; mean r/p; variance r(1 − p)/p² | r = 3, p = 0.4, k = 7: 0.1244, mean 7.5 | Negative binomial |
| Hypergeometric | P(X = k) = C(K, k) C(N − K, n − k) / C(N, n) | N = 50, K = 10, n = 5, k = 2: 0.2098 | Hypergeometric |
| Uniform on (a, b) | Mean (a + b)/2; variance (b − a)²/12 | a = 2, b = 8: mean 5, variance 3 | Uniform |
| Exponential | P(X ≤ x) = 1 − e^(−λx); mean 1/λ | λ = 0.5, x = 3: 0.7769, mean 2 | Exponential |
| Normal | z = (x − μ) / σ, then read the standard normal table | z = 1.96: 97.5% below | Normal |
Confidence intervals and sample size
| Interval | Formula |
|---|---|
| Mean, σ known | x̄ ± z* · σ / √n |
| Mean, σ unknown | x̄ ± t* · s / √n, with n − 1 degrees of freedom |
| Proportion | p̂ ± z* · √(p̂ (1 − p̂) / n) |
| Difference of two means (Welch) | (x̄₁ − x̄₂) ± t* · √(s₁²/n₁ + s₂²/n₂) |
| Sample size for a mean | n = (z* · σ / E)², rounded up, for margin of error E |
| Sample size for a proportion | n = z*² · p (1 − p) / E², using p = 0.5 if unknown (384.15 → 385 for E = 0.05 at 95%) |
The common multipliers are z* = 1.645 (90%), 1.960 (95%) and 2.576 (99%). Calculators: confidence interval, proportion interval, margin of error and sample size.
Hypothesis test statistics
| Test | Statistic | Reference distribution | Calculator |
|---|---|---|---|
| One-sample z | z = (x̄ − μ₀) / (σ / √n) | Standard normal | Z-test |
| One-sample t | t = (x̄ − μ₀) / (s / √n) | t with n − 1 df | One-sample t-test |
| Two-sample t (Welch) | t = (x̄₁ − x̄₂) / √(s₁²/n₁ + s₂²/n₂) | t with Welch df | Two-sample t-test |
| Paired t | t = d̄ / (s_d / √n) | t with n − 1 df | Paired t-test |
| One proportion | z = (p̂ − p₀) / √(p₀ (1 − p₀) / n) | Standard normal | One-proportion z-test |
| Two proportions | z = (p̂₁ − p̂₂) / √(p̂ (1 − p̂) (1/n₁ + 1/n₂)), with p̂ pooled | Standard normal | Two-proportion z-test |
| Chi-square | χ² = Σ (O − E)² / E; df = (r − 1)(c − 1) | Chi-square | Chi-square test |
| One-way ANOVA | F = MSB / MSW, with MSB = SSB/(k − 1) and MSW = SSW/(N − k) | F with k − 1 and N − k df | ANOVA |
A p-value comes from the tail area of the reference distribution beyond the statistic; see the p-value explained. To choose between these tests, read which statistical test to use.
Correlation and regression
| Quantity | Formula | Calculator |
|---|---|---|
| Pearson correlation | r = Σ(x − x̄)(y − ȳ) / √(Σ(x − x̄)² · Σ(y − ȳ)²) | Correlation |
| Slope | b = Σ(x − x̄)(y − ȳ) / Σ(x − x̄)² = r · s_y / s_x | Regression |
| Intercept | a = ȳ − b · x̄ | Regression |
| R-squared (one predictor) | R² = r² | Regression |
| Test of r | t = r √(n − 2) / √(1 − r²), with n − 2 df | Correlation |
| Standard error of the estimate | s_e = √(SSE / (n − 2)) | Regression |
| Spearman (no ties) | r_s = 1 − 6 Σd² / (n (n² − 1)), with d the difference in ranks | Spearman correlation |
Effect sizes
| Effect size | Formula | Calculator |
|---|---|---|
| Cohen's d | d = (x̄₁ − x̄₂) / s_p, with s_p = √(((n₁ − 1)s₁² + (n₂ − 1)s₂²) / (n₁ + n₂ − 2)) | Effect size |
| Eta squared (ANOVA) | η² = SSB / SST | ANOVA |
| Cramér's V | V = √(χ² / (n · min(r − 1, c − 1))) | Cramér's V |
| Odds ratio | OR = (a · d) / (b · c) for a 2 × 2 table with cells a, b, c, d | Odds ratio |
A worked check on one data set
Take the sample 4, 8, 6, 5, 12 and run the main formulas. Each result can be confirmed with the calculators above.
| Quantity | Working | Result |
|---|---|---|
| Mean | (4 + 8 + 6 + 5 + 12) / 5 | 7 |
| Median and range | ordered 4, 5, 6, 8, 12 | 6 and 8 |
| Sample variance | 40 / 4 | 10 |
| Sample standard deviation | √10 | 3.1623 |
| Standard error | 3.1623 / √5 | 1.4142 |
| Coefficient of variation | 3.1623 / 7 | 0.4518 |
| z-score of the value 12 | (12 − 7) / 3.1623 | 1.5811 |
| 95% confidence interval for the mean | 7 ± 2.7764 × 1.4142 | 3.0735 to 10.9265 |
| t statistic against μ₀ = 5 | (7 − 5) / 1.4142, 4 df | 1.4142, two-tailed p = 0.2302 |
Spreadsheet users can reproduce these with the functions in standard deviation in Excel, confidence intervals in Excel and the t-test in Excel.
Try the Standard Deviation Calculator
Check the mean, variance and sample or population standard deviation of your data.
Try the Confidence Interval Calculator
Get a confidence interval for a mean with the multiplier and every step shown.
Frequently Asked Questions
What is the difference between s and σ?
σ (sigma) is the standard deviation of a whole population and is divided by N, while s is the standard deviation of a sample and is divided by n − 1. Use s whenever your data are a sample from a larger group, which is nearly always. Their symbols follow the same pattern: μ for the population mean and x̄ for the sample mean, p for a population proportion and p̂ for a sample proportion.
Which z or t value do I use for a confidence interval?
For z, use 1.645 for 90% confidence, 1.960 for 95% and 2.576 for 99%. For t, the multiplier depends on the degrees of freedom n − 1: with 4 degrees of freedom the 95% value is 2.776, with 20 it is 2.086 and with 120 it is 1.980. Use a t multiplier whenever the standard deviation is estimated from the sample.
Which formula do I use for the standard error?
It depends on the statistic. For a sample mean it is s/√n, for a proportion √(p̂(1 − p̂)/n), for a difference of two independent means √(s₁²/n₁ + s₂²/n₂) and for a regression slope s_e/√Σ(x − x̄)². The standard error is the standard deviation of the statistic's sampling distribution, and every test statistic on this page is an estimate divided by its standard error.
How do I know which test statistic to pick?
Match the question to the data: a mean against a value is a one-sample t, two independent means a Welch t, paired data a paired t, proportions a z, counts in categories chi-square, and three or more means an F from ANOVA. The decision guide on this site walks through the choice with a table.
Are these formulas the same in Excel?
Yes, Excel implements the same definitions: STDEV.S uses n − 1, STDEV.P uses n, NORM.S.DIST gives the normal probability and T.DIST.2T, CHISQ.DIST.RT and F.DIST.RT give the p-values. The Excel guides linked below show the exact function for each test.
Do I need to memorise these formulas?
Rarely. Most exams provide a formula sheet, and in practice software computes everything. What is worth knowing is the structure: an estimate, minus its hypothesised value, divided by its standard error, compared with a reference distribution. Once that pattern is clear the individual formulas are variations on it.