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

QuantityFormulaCalculator
Meanx̄ = Σx / nMean, median, mode
MedianMiddle value of the ordered data; average of the two middle values if n is evenMean, median, mode
Rangemax − minRange
Sample variances² = Σ(x − x̄)² / (n − 1)Variance
Population varianceσ² = Σ(x − μ)² / NVariance
Standard deviations = √s² (σ = √σ² for a population)Standard deviation
Coefficient of variationCV = s / x̄Coefficient of variation
Standard error of the meanSE = s / √nStandard deviation
z-scorez = (x − μ) / σZ-score
Interquartile range and outlier fencesIQR = Q3 − Q1; outliers lie below Q1 − 1.5·IQR or above Q3 + 1.5·IQRQuartiles

Probability and counting

RuleFormulaCalculator
ComplementP(not A) = 1 − P(A)Probability
Addition ruleP(A or B) = P(A) + P(B) − P(A and B)Probability of multiple events
Multiplication ruleP(A and B) = P(A) · P(B given A); for independent events P(A) · P(B)Probability of multiple events
Conditional probabilityP(B given A) = P(A and B) / P(A)Conditional probability
Bayes' theoremP(A given B) = P(B given A) · P(A) / P(B)Bayes' theorem explained
PermutationsnPr = n! / (n − r)! (5P2 = 20)Permutations
CombinationsnCr = n! / (r! (n − r)!) (5C2 = 10)Combinations
Expected valueE(X) = Σ x · P(x)Expected value explained

Distributions

DistributionProbability, mean and varianceExampleCalculator
BinomialP(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.2668Binomial
PoissonP(X = k) = e^(−λ) · λ^k / k!; mean = variance = λλ = 2, k = 3: 0.1804Poisson
GeometricP(X = k) = (1 − p)^(k − 1) · p, with k the trial of the first success; mean 1/pp = 0.2, k = 4: 0.1024, mean 5Geometric
Negative binomialP(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.5Negative binomial
HypergeometricP(X = k) = C(K, k) C(N − K, n − k) / C(N, n)N = 50, K = 10, n = 5, k = 2: 0.2098Hypergeometric
Uniform on (a, b)Mean (a + b)/2; variance (b − a)²/12a = 2, b = 8: mean 5, variance 3Uniform
ExponentialP(X ≤ x) = 1 − e^(−λx); mean 1/λλ = 0.5, x = 3: 0.7769, mean 2Exponential
Normalz = (x − μ) / σ, then read the standard normal tablez = 1.96: 97.5% belowNormal

Confidence intervals and sample size

IntervalFormula
Mean, σ knownx̄ ± z* · σ / √n
Mean, σ unknownx̄ ± t* · s / √n, with n − 1 degrees of freedom
Proportionp̂ ± z* · √(p̂ (1 − p̂) / n)
Difference of two means (Welch)(x̄₁ − x̄₂) ± t* · √(s₁²/n₁ + s₂²/n₂)
Sample size for a meann = (z* · σ / E)², rounded up, for margin of error E
Sample size for a proportionn = 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

TestStatisticReference distributionCalculator
One-sample zz = (x̄ − μ₀) / (σ / √n)Standard normalZ-test
One-sample tt = (x̄ − μ₀) / (s / √n)t with n − 1 dfOne-sample t-test
Two-sample t (Welch)t = (x̄₁ − x̄₂) / √(s₁²/n₁ + s₂²/n₂)t with Welch dfTwo-sample t-test
Paired tt = d̄ / (s_d / √n)t with n − 1 dfPaired t-test
One proportionz = (p̂ − p₀) / √(p₀ (1 − p₀) / n)Standard normalOne-proportion z-test
Two proportionsz = (p̂₁ − p̂₂) / √(p̂ (1 − p̂) (1/n₁ + 1/n₂)), with p̂ pooledStandard normalTwo-proportion z-test
Chi-squareχ² = Σ (O − E)² / E; df = (r − 1)(c − 1)Chi-squareChi-square test
One-way ANOVAF = MSB / MSW, with MSB = SSB/(k − 1) and MSW = SSW/(N − k)F with k − 1 and N − k dfANOVA

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

QuantityFormulaCalculator
Pearson correlationr = Σ(x − x̄)(y − ȳ) / √(Σ(x − x̄)² · Σ(y − ȳ)²)Correlation
Slopeb = Σ(x − x̄)(y − ȳ) / Σ(x − x̄)² = r · s_y / s_xRegression
Intercepta = ȳ − b · x̄Regression
R-squared (one predictor)R² = r²Regression
Test of rt = r √(n − 2) / √(1 − r²), with n − 2 dfCorrelation
Standard error of the estimates_e = √(SSE / (n − 2))Regression
Spearman (no ties)r_s = 1 − 6 Σd² / (n (n² − 1)), with d the difference in ranksSpearman correlation

Effect sizes

Effect sizeFormulaCalculator
Cohen's dd = (x̄₁ − x̄₂) / s_p, with s_p = √(((n₁ − 1)s₁² + (n₂ − 1)s₂²) / (n₁ + n₂ − 2))Effect size
Eta squared (ANOVA)η² = SSB / SSTANOVA
Cramér's VV = √(χ² / (n · min(r − 1, c − 1)))Cramér's V
Odds ratioOR = (a · d) / (b · c) for a 2 × 2 table with cells a, b, c, dOdds 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.

QuantityWorkingResult
Mean(4 + 8 + 6 + 5 + 12) / 57
Median and rangeordered 4, 5, 6, 8, 126 and 8
Sample variance40 / 410
Sample standard deviation√103.1623
Standard error3.1623 / √51.4142
Coefficient of variation3.1623 / 70.4518
z-score of the value 12(12 − 7) / 3.16231.5811
95% confidence interval for the mean7 ± 2.7764 × 1.41423.0735 to 10.9265
t statistic against μ₀ = 5(7 − 5) / 1.4142, 4 df1.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.