Formula Reference Study Guide Statistics 35 min read September 17, 2026
BY: Statistics Fundamentals Team
Reviewed By: Minsa A (Senior Statistics Editor)

Statistics Formulas: Essential Equations & Examples

Statistical formulas are the structured rules that convert raw data into numbers you can interpret and compare. They span descriptive statistics, probability, distributions, sampling, confidence intervals, hypothesis testing, correlation, regression, and more. Which formula is appropriate depends on your data type, study design, sample size, and research question. No formula should be applied without first checking whether its assumptions fit the problem at hand. This page organizes the formulas you will use most, with symbol definitions, conditions, and worked calculations for each.

What This Page Covers
  • ✓ Quick-reference formula table for immediate lookup
  • ✓ Statistical notation guide with every major symbol
  • ✓ Descriptive statistics, probability, distributions, and sampling
  • ✓ Confidence intervals, t-tests, ANOVA, chi-square, regression
  • ✓ Risk, odds, diagnostic test, and effect size formulas
  • ✓ Fifteen fully worked examples with step-by-step arithmetic
  • ✓ Formula selection guide and 20 common mistakes
  • ✓ Descriptive statistics calculator and z-score calculator

Type a name or concept below, or click a category tag to filter. All formulas remain visible to search engines regardless of the filter state.

Quick Statistics Formulas Table

The table below lists the most commonly needed formulas in one place. Each formula is explained in depth in the sections that follow. Note that the appropriate formula for a confidence interval depends on the estimation method, distribution, and assumptions — the general form shown here is a framework, not a universal recipe.

Topic Formula Notes
Meanx̄ = Σx / nSample mean; use μ = Σx/N for population
Weighted Meanx̄w = Σwx / ΣwEach observation multiplied by its weight
RangeMaximum − MinimumSensitive to extreme values
Sample Variances² = Σ(x − x̄)² / (n − 1)n−1 gives unbiased estimate of σ²
Population Varianceσ² = Σ(x − μ)² / NUse when data is the entire population
Sample SDs = √s²Same units as the data
Population SDσ = √σ²Same units as the data
IQRQ3 − Q1Spread of the middle 50% of data
Z-Scorez = (x − μ) / σStandard deviations from the population mean
Standard Error of MeanSE = s / √nSD of the sampling distribution of x̄
Conditional ProbabilityP(A|B) = P(A ∩ B) / P(B)P(B) must be > 0
Bayes' TheoremP(A|B) = P(B|A)P(A) / P(B)Updates prior probability with new evidence
Binomial ProbabilityC(n,k) × p^k × (1−p)^(n−k)Fixed trials, two outcomes, independent
Poisson Probabilitye^(−λ) × λ^k / k!Event counts in a fixed interval
Confidence IntervalEstimate ± Critical Value × SECritical value depends on distribution and method
One-Sample tt = (x̄ − μ₀) / (s/√n)df = n − 1
Welch Two-Sample tt = (x̄₁ − x̄₂) / √(s₁²/n₁ + s₂²/n₂)Does not assume equal variances
Paired tt = d̄ / (sd/√n)Applied to paired differences d = X − Y
Chi-Squareχ² = Σ[(O−E)²/E]O = observed, E = expected frequency
ANOVA FF = MSB / MSWBetween-group MS over within-group MS
Pearson Correlationr = Σ(x−x̄)(y−ȳ) / √[Σ(x−x̄)²Σ(y−ȳ)²]Linear association; −1 ≤ r ≤ 1
Regressionŷ = b0 + b1xb1 = slope; b0 = intercept
Multiple Regressionŷ = b0 + b1x1 + ... + bkxkEach bj holds others constant
Relative RiskRR = Risk₁ / Risk₀Ratio of two risks; not the same as OR
Odds RatioOR = Odds₁ / Odds₀Distinct from relative risk; see Section 14

Statistical Notation

Statistics uses different symbols for samples and populations. Confusing them is one of the most common errors in introductory courses. The table below defines the notation used throughout this page. Note that some symbols have more than one meaning depending on context — β is one example, which can denote a regression coefficient, a standardized coefficient, or the probability of a Type II error.

SymbolMeaning
μPopulation mean
Sample mean
σPopulation standard deviation
sSample standard deviation
σ²Population variance
Sample variance
nSample size
NPopulation size
pPopulation proportion or p-value (context-dependent)
Sample proportion
αSignificance level (or Type I error rate)
βContext-dependent: regression coefficient or Type II error probability
rSample Pearson correlation coefficient
ρPopulation Pearson correlation coefficient
Coefficient of determination (regression)
SEStandard error
dfDegrees of freedom
ΣSummation
H₀Null hypothesis
H₁ / HaAlternative hypothesis
εError term (regression residual)

Descriptive Statistics Formulas

Descriptive statistics summarize and describe the features of a dataset. These formulas are the foundation for almost every other method. Before applying them, identify whether your data represents a sample or an entire population, since the formulas differ. Detailed guides to each measure are available in the descriptive statistics section.

Arithmetic Mean

The mean is the sum of all observations divided by the count of observations. It is the most common measure of center but is sensitive to extreme values.

Arithmetic Mean
x̄ = Σx / n
= sample mean Σx = sum of all observations n = number of observations

When to use it: When data is quantitative and you want the arithmetic center. Use the population version (μ = Σx/N) when data covers every member of the population.

Example 1 — Arithmetic Mean

Dataset: 10, 12, 14, 16, 18

1

Sum: 10 + 12 + 14 + 16 + 18 = 70

2

Count: n = 5

3

Mean: x̄ = 70 / 5 = 14

The mean is 14. Each value in this evenly spaced dataset falls an equal distance from the center, so the mean equals the median.

Weighted Mean

Weighted Mean
x̄w = Σwx / Σw
w = weight of each observation x = observation value

When to use it: When observations contribute unequally — for example, final grades where exams count more than homework, or survey data with sampling weights. A simple mean would misrepresent the data when group sizes or importance levels differ.

Example: Three exams with scores 70, 80, 90 and weights 0.2, 0.3, 0.5. Weighted mean = (0.2×70 + 0.3×80 + 0.5×90) / (0.2+0.3+0.5) = (14+24+45)/1 = 83.

Median and Mode

The median is the middle value when observations are sorted in order. With an odd number of observations, it is the value at position (n+1)/2. With an even number, it is the average of the two middle values. The median is more resistant to extreme values than the mean. See the full median guide.

The mode is the value that appears most often. A dataset can be unimodal (one mode), bimodal (two modes), multimodal (more than two modes), or have no mode if no value repeats. See the mode guide for details. Also see the comparison at mean vs median vs mode.

Range

Range
Range = Maximum − Minimum
Maximum = largest value Minimum = smallest value

Limitation: The range depends entirely on the two most extreme values. A single outlier can inflate it considerably, which is why IQR is often preferred for describing spread. See the range guide.

Sample and Population Variance

Variance measures the average squared deviation from the mean. The two formulas differ because of how degrees of freedom work. The full explanation is in the variance guide.

Sample Variance (most common in practice)
s² = Σ(x − x̄)² / (n − 1)
x = each observation = sample mean n − 1 = degrees of freedom

The denominator n−1 rather than n makes s² an unbiased estimator of the population variance σ². When n is used instead, the estimator systematically underestimates σ² because the sample mean x̄ is closer to the sample values than μ is. The population formula σ² = Σ(x−μ)²/N uses N and the true population mean μ, and should only be used when data covers the entire population.

Example 2 — Sample Variance and SD

Dataset: 10, 12, 14, 16, 18 (same dataset as Example 1; x̄ = 14)

1

Deviations: 10−14=−4; 12−14=−2; 14−14=0; 16−14=2; 18−14=4

2

Squared deviations: 16, 4, 0, 4, 16

3

Sum of squared deviations: 16+4+0+4+16 = 40

4

Sample variance: s² = 40/(5−1) = 40/4 = 10

5

Sample SD: s = √10 ≈ 3.162

s² = 10; s ≈ 3.162. These describe the typical spread around the mean in the same units as the original data.

Standard Deviation

Standard Deviation
s = √[ Σ(x − x̄)² / (n − 1) ]
Sample SD: denominator n−1 Population SD σ: denominator N

Standard deviation is the square root of variance, so it is expressed in the same units as the original data. A larger standard deviation means observations are more spread out. For a deeper guide see standard deviation.

⚠️
SD vs SE — a critical distinction

Standard deviation (s or σ) describes the spread of individual observations. Standard error (SE = s/√n) describes how precisely the sample mean estimates the population mean. They are not interchangeable. See standard deviation vs standard error.

Coefficient of Variation

Coefficient of Variation
CV = (s / x̄) × 100%

CV expresses variability relative to the mean. It can help compare variability across variables measured on different scales. However, CV is problematic when the mean is zero or near zero, and it is not meaningful on scales without a true zero. See coefficient of variation.

Quartiles, IQR, and Five-Number Summary

Interquartile Range
IQR = Q3 − Q1

The IQR describes the spread of the middle 50% of observations. Q1 is the 25th percentile and Q3 is the 75th. Different software packages use slightly different algorithms for computing quartiles — this means Q1 and Q3 values can vary between tools for the same dataset. State which convention you are using if precision matters. See interquartile range.

The five-number summary is: Minimum, Q1, Median, Q3, Maximum. It provides a compact description of the distribution and is the basis for box plots. See five-number summary.

The conventional box-plot outlier fences are:

Outlier Fences (Tukey Box-Plot Rule)
Q1 − 1.5(IQR)  |  Q3 + 1.5(IQR)
Points beyond fences are potential outliers Not every flagged value is an error

Z-Score Formula

Z-Score
z = (x − μ) / σ
x = observed value μ = population mean σ = population standard deviation

The z-score gives the number of population standard deviations an observation lies from the population mean. A positive z means the observation is above the mean; negative means below; zero means it equals the mean. Z-scores allow comparisons across different scales. When population parameters are unknown, some contexts use sample estimates (x̄ and s) as substitutes, but the result is then a standardized score rather than a true z-score. See z-score for a full guide and see the z-table for critical values.

Example 6 — Z-Score

A student scores 82 on a test. The class population mean is μ = 74 and population SD is σ = 8.

1

Identify values: x = 82, μ = 74, σ = 8

2

Calculate: z = (82 − 74) / 8 = 8/8 = 1.0

z = 1.0. The student scored exactly one population standard deviation above the class mean.

Probability Formulas

Probability formulas quantify uncertainty. They form the theoretical basis for sampling distributions, confidence intervals, and hypothesis tests. For a deeper treatment see statistics and probability and the probability rules guide.

Basic Probability (equally likely outcomes)
P(A) = Favorable outcomes / Total outcomes
Requires equally likely outcomes 0 ≤ P(A) ≤ 1

Key Probability Rules

Complement, Addition, and Conditional Rules
P(Aᶜ) = 1 − P(A)
P(A ∪ B) = P(A) + P(B) − P(A ∩ B)
P(A | B) = P(A ∩ B) / P(B)   [P(B) > 0]

The addition rule subtracts the intersection to avoid double-counting. For mutually exclusive events (which cannot both occur), P(A ∩ B) = 0 so the rule simplifies to P(A ∪ B) = P(A) + P(B). See mutually exclusive events.

🚨
Independent ≠ Mutually Exclusive

These are different concepts. Independent events: P(A ∩ B) = P(A)P(B) — both can occur, but knowing one happened tells you nothing about the other. Mutually exclusive events: P(A ∩ B) = 0 — they cannot both occur. Non-trivial mutually exclusive events are never independent. See independent vs dependent events.

Bayes' Theorem

Bayes' Theorem
P(A|B) = P(B|A) × P(A) / P(B)
P(A) = prior P(B|A) = likelihood P(B) = evidence (marginal) P(A|B) = posterior

Bayes' theorem updates a prior belief P(A) with observed evidence to produce a posterior belief P(A|B). In a diagnostic setting it can be used to compute the probability of disease given a positive test result, but this requires careful attention to disease prevalence. See the Bayes' theorem guide and Bayes' theorem calculator.

Counting Formulas

Permutations and Combinations
nPr = n! / (n − r)!
nCr = n! / [r!(n − r)!]
Permutations: order matters Combinations: order does not matter

See permutations and combinations for detailed examples and the combination calculator.

Probability Distribution Formulas

Binomial Distribution

Binomial Probability
P(X = k) = C(n,k) × p^k × (1−p)^(n−k)
n = fixed number of trials k = number of successes p = probability of success per trial Mean: μ = np Variance: σ² = np(1−p)

Conditions: Fixed number of trials n; each trial has exactly two outcomes; probability of success p is constant across trials; trials are independent. See binomial distribution and the binomial calculator.

Example 5 — Binomial

A fair coin is flipped 5 times. What is the probability of exactly 3 heads?

1

Identify: n = 5, k = 3, p = 0.5

2

C(5,3): 5! / [3!×2!] = 120 / 12 = 10

3

P(X=3): 10 × (0.5)³ × (0.5)² = 10 × 0.125 × 0.25 = 10 × 0.03125 = 0.3125

P(X = 3) = 0.3125. There is a 31.25% chance of getting exactly 3 heads in 5 fair coin flips.

Poisson Distribution

Poisson Probability
P(X = k) = e^(−λ) × λ^k / k!
λ = expected number of events k = actual event count (0,1,2...) Mean = λ; Variance = λ

Use the Poisson distribution for counting events in a fixed interval of time or space, when events occur independently at a constant average rate. See Poisson distribution and the Poisson calculator.

Normal Distribution

The normal distribution is fully described by its mean μ and standard deviation σ. Its probability density function is:

Normal Distribution PDF (reference)
f(x) = [1/(σ√(2π))] × e^[−(x−μ)²/(2σ²)]
Bell-shaped and symmetric about μ Inflection points at μ ± σ

In practice, normal distribution problems use z-scores and the z-table rather than this density formula directly. For introductory courses, memorizing this formula is usually not required. See normal distribution.

Empirical rule (for approximately normal data): approximately 68% of observations fall within 1 SD of the mean, about 95% within 2 SDs, and about 99.7% within 3 SDs. These are approximations, not exact figures. See empirical rule and the empirical rule calculator.

Sampling and Standard Error Formulas

Standard Error of the Mean

Standard Error of the Mean
SE(x̄) = s / √n
s = sample SD n = sample size SE shrinks as n grows

The standard error of the mean is the standard deviation of the sampling distribution of x̄. It quantifies how much sample means vary from sample to sample. As sample size grows, SE shrinks because larger samples produce more stable estimates. See standard error.

Other common standard errors: for a proportion, SE(p̂) = √[p̂(1−p̂)/n]; for a difference between two independent means, SE = √(s₁²/n₁ + s₂²/n₂). The appropriate formula depends on the parameter being estimated.

When sampling without replacement from a finite population, the finite population correction (FPC) may apply: FPC = √[(N−n)/(N−1)], multiplied by SE. This matters when the sample is a large fraction of the population (roughly more than 5%).

The central limit theorem states that the sampling distribution of the mean approaches normality as n increases, regardless of the shape of the original population distribution. This is why SE-based formulas work broadly in practice.

Confidence Interval Formulas

A confidence interval gives a range of plausible values for an unknown population parameter. The standard frequentist interpretation is: if this procedure were repeated many times on independent samples, the interval would contain the true parameter value in the stated percentage of repetitions. It does not mean there is a 95% probability that this specific interval contains the parameter. See confidence intervals.

General Confidence Interval Form
Estimate ± Critical Value × SE
Critical value depends on: confidence level, distribution, df, and estimation method

One-Sample Mean (unknown σ)

t-Interval for One Mean
x̄ ± t* × (s/√n)
t* = t critical value with df = n−1 s/√n = SE of the mean

This is the standard interval when population SD σ is unknown (the usual situation in practice). The critical value t* comes from the t-distribution table with df = n−1. See confidence interval for mean and the confidence interval calculator.

Example 7 — Confidence Interval

A sample of n=16 observations has x̄ = 50 and s = 8. Construct a 95% confidence interval for the population mean.

1

df: n − 1 = 15

2

t* (95%, df=15): from the t-table, t* ≈ 2.131

3

SE: 8 / √16 = 8/4 = 2.0

4

Margin of error: 2.131 × 2.0 = 4.262

5

Interval: 50 ± 4.262 → (45.738, 54.262)

95% CI: (45.74, 54.26). Under repeated sampling with this procedure, about 95% of such intervals would contain the true population mean.

Proportion Confidence Interval

The basic Wald interval is p̂ ± z* × √[p̂(1−p̂)/n], where z* is the normal critical value (1.96 for 95%). This is the form most often seen in introductory textbooks, but it has known coverage problems in small samples or when p̂ is near 0 or 1. The Wilson score interval and the Clopper-Pearson interval often provide better coverage in these situations. See proportion CI and Wilson score interval.

Margin of Error

Margin of Error
ME = Critical Value × SE

The margin of error is the half-width of a confidence interval. See margin of error and the margin of error calculator.

Hypothesis Testing Formulas

Every test statistic follows the general structure: (Observed estimate − Null value) / Standard Error. The resulting value is then compared to a reference distribution to obtain a p-value or compared to a critical value. For background see hypothesis testing.

What a p-value means
A p-value is the probability of observing data as extreme as, or more extreme than, the observed result, assuming the null hypothesis is true and the test assumptions hold.
A small p-value means the data are unlikely under H₀ — not that H₁ is true, and not that H₀ is false.

A p-value does not give the probability that H₀ is true, the probability that the result occurred by chance, or the probability that the alternative hypothesis is true. See p-values. Also see statistical interpretation.

One-Sample t-Test

One-Sample t-Test
t = (x̄ − μ₀) / (s/√n)
= sample mean μ₀ = null hypothesis value s = sample SD n = sample size df = n − 1
Example 8 — One-Sample t-Test

A manufacturer claims boxes weigh μ = 500 g on average. A sample of n = 25 boxes gives x̄ = 492 g and s = 15 g. Test at α = 0.05 (two-tailed).

1

H₀: μ = 500  |  H₁: μ ≠ 500

2

SE: 15/√25 = 15/5 = 3.0

3

t: (492 − 500)/3.0 = −8/3 = −2.667

4

df = 24; from the t-table, critical value ≈ ±2.064

5

Decision: |−2.667| = 2.667 > 2.064 → Reject H₀. The p-value is approximately 0.013.

At α = 0.05, there is sufficient evidence that the mean box weight differs from 500 g. See the full one-sample t-test guide.

Welch Two-Sample t-Test

Welch Two-Sample t-Test (does not assume equal variances)
t = (x̄₁ − x̄₂) / √(s₁²/n₁ + s₂²/n₂)
df: Welch-Satterthwaite approximation Preferred over pooled-variance t when variances differ

The degrees of freedom for the Welch test are estimated by the Welch-Satterthwaite formula, which most software computes automatically. The pooled-variance form requires assuming σ₁² = σ₂², an assumption that is often untestable in practice. The Welch form is generally recommended unless there is strong justification for equal variances. See Welch t-test, two-sample t-test, and equal vs unequal variance.

Paired t-Test

Paired t-Test
t = d̄ / (sd / √n)
d = X − Y for each pair = mean of differences sd = SD of differences df = n − 1 (pairs, not total observations)

Use the paired test when observations are naturally linked (before/after measurements on the same subject, matched pairs). Applying an unpaired test to paired data ignores the correlation structure and gives wrong answers. See paired t-test.

Type I and Type II Errors

TermDefinitionRate
Type I Error (false positive)Reject H₀ when it is trueα (significance level)
Type II Error (false negative)Fail to reject H₀ when it is falseβ
PowerCorrectly reject a false H₀1 − β
Correct non-rejectionFail to reject H₀ when it is true1 − α

See type I and type II errors.

Chi-Square Formula

Chi-Square Statistic
χ² = Σ[(O − E)² / E]
O = observed frequency in each cell E = expected frequency under H₀ Sum over all cells in the table

The chi-square test is used for testing independence between categorical variables and for goodness-of-fit tests. Expected frequencies are calculated from marginal totals under the null hypothesis. A common rule of thumb is that expected cell counts should generally be at least 5; when this is not met, Fisher's exact test is often more appropriate. See chi-square test and the chi-square calculator.

Example 12 — Chi-Square Test of Independence

Observed: Cell A=30, B=20, C=10, D=40. Expected: A=25, B=25, C=15, D=35.

1

Cell contributions: (30−25)²/25 = 1.0  |  (20−25)²/25 = 1.0  |  (10−15)²/15 = 1.667  |  (40−35)²/35 = 0.714

2

χ²: 1.0 + 1.0 + 1.667 + 0.714 = 4.381

3

df = (rows−1)(cols−1) = 1. Critical value at α=0.05 from the chi-square table is 3.841.

χ² = 4.381 > 3.841 → reject H₀ at α = 0.05. Evidence of an association between the two categorical variables.

ANOVA Formulas

Analysis of variance tests whether the means of three or more groups differ. A significant overall F test indicates that at least one group mean differs from the others — it does not identify which groups differ. Post hoc tests (such as Tukey HSD or Bonferroni) are required for pairwise comparisons. See ANOVA.

ANOVA Partitioning and F-Statistic
F = MSB / MSW
SST = Σ(yi − ȳ)² SSB = Σnj(ȳj − ȳ)² SSW = Σ(yi − ȳj)² SST = SSB + SSW MSB = SSB/(k−1) MSW = SSW/(N−k)

Here k = number of groups, N = total number of observations. dfB = k−1, dfW = N−k, dfT = N−1. The F-statistic compares variability between groups to variability within groups. Use the F-table for critical values or the ANOVA calculator.

Example 13 — One-Way ANOVA (Illustrative)

Three groups with means ȳ₁=10, ȳ₂=14, ȳ₃=12. Overall mean ȳ=12. n₁=n₂=n₃=4 (N=12). SSW=36.

1

SSB: 4(10−12)²+4(14−12)²+4(12−12)² = 4(4)+4(4)+0 = 32

2

dfB = k−1 = 2; dfW = N−k = 9

3

MSB: 32/2 = 16; MSW: 36/9 = 4

4

F: 16/4 = 4.0

5

Critical value F(2,9) at α=0.05 ≈ 4.26. Since 4.0 < 4.26, we fail to reject H₀ at this level.

Insufficient evidence to conclude that the group means differ at α = 0.05. Post hoc tests would only follow if H₀ were rejected.

Correlation Formulas

Pearson Correlation

Pearson Correlation Coefficient
r = Σ(x−x̄)(y−ȳ) / √[Σ(x−x̄)² × Σ(y−ȳ)²]
−1 ≤ r ≤ 1 r > 0: positive association r < 0: negative association r = 0: no linear association

Pearson r measures the strength and direction of the linear association between two quantitative variables. It does not imply causation. A strong correlation can exist with no causal relationship, and a causal relationship can produce a weak correlation if the relationship is nonlinear. See Pearson correlation, the correlation vs causation guide, and the correlation calculator.

Spearman Rank Correlation

Spearman's rho is the Pearson correlation coefficient applied to the ranks of the data rather than the raw values. It measures monotonic association. For the special case with no tied ranks, a computational shortcut exists:

Spearman (no-ties shortcut — use with caution)
ρ = 1 − [6Σd² / n(n² − 1)]
d = difference in ranks for each pair Only valid when no tied ranks exist Software handles ties using rank averages

When ties are present, apply the general Pearson formula to the ranked data instead of this shortcut. See Spearman rank correlation.

Regression Formulas

Simple Linear Regression

Simple Linear Regression
ŷ = b0 + b1x
b1 = Σ(x−x̄)(y−ȳ) / Σ(x−x̄)² b0 = ȳ − b1x̄ ŷ = predicted value; x = predictor

The slope b1 gives the expected change in the outcome y for each one-unit increase in the predictor x. The intercept b0 is the expected value of y when x = 0 (which may not always be a meaningful interpretation). See simple linear regression and the regression calculator.

R-Squared

Coefficient of Determination
R² = SSR / SST = 1 − SSE / SST
SST = total sum of squares SSR = regression sum of squares SSE = error sum of squares (residuals)

R² is the proportion of the total variability in y that is associated with the fitted linear model. An R² of 0.75 means 75% of the variability in y is accounted for by x in the model. R² does not prove causation, and a high R² does not guarantee the model is correctly specified. See R-squared.

Multiple Linear Regression

Multiple Linear Regression
ŷ = b0 + b1x1 + b2x2 + ... + bkxk
Each bj = partial slope bj: expected change in ŷ per unit increase in xj, holding all other predictors constant

See multiple linear regression. Residuals (observed minus predicted: e = y − ŷ) are the basis for checking model assumptions. See residuals.

Logistic Regression

Logistic Regression
log[p/(1−p)] = β0 + β1X1 + ...
p = probability of outcome p/(1−p) = odds Odds Ratio = e^β

Each coefficient β represents the change in the log odds of the outcome per unit increase in the predictor. Exponentiating gives the odds ratio (OR = e^β). The odds ratio is not the same as the relative risk — they converge only when the outcome is rare. See logistic regression.

Risk, Odds, and Diagnostic Formulas

Risk and Relative Risk

Risk Measures
RR = Risk₁ / Risk₀
Risk = Events / Total at risk Risk Difference = Risk₁ − Risk₀ RR > 1: higher risk in group 1

Odds and Odds Ratio

Odds and Odds Ratio
Odds = p / (1 − p)
OR = Odds₁ / Odds₀ OR ≠ RR except when outcome is rare
Example 14 — Risk and Odds

Group 1: 40 events in 100. Group 0: 20 events in 100.

1

Risks: Risk₁ = 40/100 = 0.40; Risk₀ = 20/100 = 0.20

2

RR: 0.40 / 0.20 = 2.0

3

Odds₁: 0.40/0.60 = 0.667; Odds₀: 0.20/0.80 = 0.25

4

OR: 0.667 / 0.25 = 2.667

RR = 2.0; OR = 2.667. They differ because the outcome is not rare. Never interpret OR as if it were RR when event rates are substantial. See relative risk calculator and odds ratio calculator.

Diagnostic Test Formulas

Disease + Disease −
Test +TPFP
Test −FNTN
Diagnostic Statistics
Sensitivity = TP / (TP + FN)
Specificity = TN / (TN + FP)
PPV = TP / (TP + FP)
NPV = TN / (TN + FN)
Accuracy = (TP + TN) / (TP + TN + FP + FN)

Sensitivity and specificity are properties of the test. PPV and NPV depend on disease prevalence — the same test will have different PPV and NPV in a high-prevalence versus low-prevalence population. See sensitivity and specificity.

Effect Size Formulas

Effect sizes quantify the practical magnitude of a result, independently of sample size. A statistically significant result at large n may have a trivially small effect. Always report effect sizes alongside p-values. Conventional cutoffs for small/medium/large effects are rough guidelines — the appropriate benchmark depends on the context of the research. See effect size.

Common Effect Size Measures
Cohen's d = (x̄₁ − x̄₂) / pooled SD
η² (eta squared) = SS_effect / SS_total
ηp² (partial eta squared) = SS_effect / (SS_effect + SS_error)
Also: r, R², RD, RR, OR — each appropriate for different designs

Cohen's d uses a pooled standard deviation as the denominator in the two-group case; the specific pooling formula should be stated. Partial eta squared is preferred over eta squared for multi-factor ANOVA. See Cohen's d and the effect size calculator.

Formula Selection Guide

Selecting the right formula requires knowing what you want to calculate, what type of data you have, how many groups are involved, and whether observations are independent or paired. The guide below is a starting point — always verify that the method's assumptions fit your data before proceeding. A fuller decision tool is at statistical test selector.

What are you trying to calculate?

Average or central tendency
Mean (or median for skewed data)
Spread or variability
Standard deviation (or IQR)
How unusual an observation is
Z-score
Sampling variability of the mean
Standard error (SE = s/√n)
Plausible range for a parameter
Confidence interval
Test a claim about one mean (unknown σ)
One-sample t-test
Compare two independent group means
Welch two-sample t-test
Compare paired or repeated measurements
Paired t-test
Compare three or more group means
ANOVA (then post hoc tests if significant)
Association between categorical variables
Chi-square / Fisher's exact test
Linear association between two quantitative variables
Pearson correlation
Predict a continuous outcome
Linear regression
Predict a binary outcome
Logistic regression
Diagnostic test accuracy
Sensitivity, specificity, PPV, NPV
Practical size of an effect
Cohen's d, r, η², RR, OR (depends on design)

20 Common Formula Mistakes

1

Using n instead of n−1 for sample variance

The denominator n−1 is needed for the unbiased sample variance estimator. Using n produces a biased result that systematically underestimates σ².

2

Confusing variance and standard deviation

Variance is in squared units; standard deviation is in the original units. They are not interchangeable when describing spread.

3

Using standard deviation where standard error is needed

SE = s/√n and shrinks with sample size. SD describes the spread of individual observations, not the precision of a mean estimate.

4

Applying population formulas to sample data without justification

Using σ or μ when you only have sample data gives misleading results unless you genuinely have the full population.

5

Forgetting to square deviations when computing variance

Deviations always sum to zero, so the unsquared sum carries no information about spread. The formula requires squaring before summing.

6

Treating independent and mutually exclusive as the same

They are different properties. Mutually exclusive events cannot both occur; independent events can both occur but do not influence each other.

7

Using the addition rule without subtracting the intersection

P(A∪B) = P(A)+P(B) only works when the events are mutually exclusive. Otherwise subtract P(A∩B).

8

Confusing risk and odds

Risk is events/total at risk; odds are p/(1−p). They differ whenever p is not near zero.

9

Interpreting the odds ratio as if it were a relative risk

OR and RR converge only when the outcome is rare. At higher event rates, OR is further from 1 than RR.

10

Applying the Spearman no-ties shortcut when ties exist

The formula ρ = 1−6Σd²/[n(n²−1)] is only valid without tied ranks. Use the Pearson formula on ranks instead.

11

Using an inappropriate confidence interval method

The Wald proportion interval can perform poorly near p̂ = 0 or 1 or in small samples. Consider Wilson or Clopper-Pearson intervals.

12

Assuming every confidence interval uses z critical values

When σ is unknown (the usual case for means), the t-distribution is used. The critical value depends on the confidence level, the distribution, and the degrees of freedom.

13

Misinterpreting p-values

A p-value is not the probability that H₀ is true, nor the probability the result occurred by chance. It is the probability of the observed data or more extreme data, given that H₀ is true.

14

Treating statistical significance as practical significance

A p-value below 0.05 does not mean the effect is large or important. Report effect sizes alongside p-values.

15

Assuming correlation proves causation

Correlation measures linear association, not causation. A confounding variable or reverse causation can produce correlation without a direct causal link.

16

Applying formulas without checking assumptions

Every statistical method has conditions (independence, distribution, sample size, variable type). Violations can invalidate the result.

17

Rounding too early in calculations

Round intermediate results and rounding errors accumulate. Carry full precision through the calculation and round only at the final step.

18

Mixing incompatible units

Adding values in different units (seconds and minutes, kilograms and pounds) produces meaningless results.

19

Confusing sample statistics with population parameters

x̄ estimates μ; s estimates σ; p̂ estimates p. Using a sample statistic as if it were the true parameter ignores sampling variability.

20

Ignoring paired or repeated observations

Applying an unpaired test to paired data ignores within-pair correlation and can produce incorrect conclusions. See paired t-test.

Descriptive Statistics Calculator

📊 Descriptive Statistics — Enter Your Data

Mean

Z-Score Calculator

z = (x − μ) / σ

z-score

Frequently Asked Questions

The answer depends on what you are studying, but the formulas used most broadly are: mean (x̄ = Σx/n), sample variance (s² = Σ(x−x̄)²/(n−1)), sample SD (s = √s²), z-score (z = (x−μ)/σ), standard error (SE = s/√n), the general confidence interval (estimate ± critical value × SE), and the t-test statistic (t = (x̄−μ₀)/(s/√n)). From there, the relevant formulas depend on your study design and research question.
Sample mean: x̄ = Σx / n, where Σx is the sum of all observations and n is the sample size. Population mean: μ = Σx / N, where N is the population size. The mean is the arithmetic average of all values.
Sample variance: s² = Σ(x−x̄)²/(n−1). Population variance: σ² = Σ(x−μ)²/N. The denominator n−1 in the sample formula provides an unbiased estimate of σ². Using n instead (as in the population formula) would systematically underestimate σ² when applied to a sample. Use the population formula only when your data covers the entire population.
z = (x − μ) / σ. The z-score tells you how many population standard deviations the observation x is from the population mean μ. A z of +2 means the observation is two standard deviations above the mean. Z-scores allow comparisons across different measurement scales.
Standard deviation (s or σ) describes the spread of individual data points around the mean. Standard error (SE = s/√n) describes how precisely the sample mean estimates the population mean — it is the standard deviation of the sampling distribution of the mean. SE decreases as sample size n grows; SD does not.
The general form is Estimate ± Critical Value × SE. For a one-sample mean with unknown σ: x̄ ± t*(s/√n) where t* is the t critical value with df = n−1. For a proportion (Wald form): p̂ ± z*√[p̂(1−p̂)/n], though alternative methods like the Wilson interval often perform better. The critical value depends on the confidence level, distribution, and method.
One-sample: t = (x̄ − μ₀)/(s/√n), df = n−1. Welch two-sample: t = (x̄₁ − x̄₂)/√(s₁²/n₁ + s₂²/n₂). Paired: t = d̄/(sd/√n), df = n−1, where d is each paired difference and n is the number of pairs.
χ² = Σ[(O − E)² / E], where O is the observed frequency and E is the expected frequency in each cell under the null hypothesis. Used for tests of independence between categorical variables and for goodness-of-fit tests.
F = MSB / MSW, where MSB = SSB/(k−1) is the between-groups mean square and MSW = SSW/(N−k) is the within-groups mean square. A significant F indicates at least one group mean differs from the others, but not which ones — post hoc tests are required for pairwise comparisons.
r = Σ(x−x̄)(y−ȳ) / √[Σ(x−x̄)² × Σ(y−ȳ)²]. It ranges from −1 (perfect negative linear association) through 0 (no linear association) to +1 (perfect positive linear association). Pearson r measures linear association; it does not prove causation.
Simple linear regression: ŷ = b0 + b1x. The slope b1 = Σ(x−x̄)(y−ȳ)/Σ(x−x̄)². The intercept b0 = ȳ − b1x̄. Multiple regression: ŷ = b0 + b1x1 + ... + bkxk, where each coefficient gives the expected change in ŷ per unit increase in that predictor, holding all others constant.
Relative risk (RR) is the ratio of two risks: Risk₁/Risk₀. Odds ratio (OR) is the ratio of two odds: Odds₁/Odds₀. They are numerically different unless the outcome is rare (when both approach the same value). Misinterpreting OR as RR can substantially overestimate the apparent effect when event rates are high.
Start with these questions: What am I estimating or testing? What type of variable is the outcome (continuous, binary, count, categorical)? How many groups? Are observations independent or paired? What are the sample sizes? Then check that the chosen method's assumptions fit the data. The Formula Selection Guide on this page and the statistical test selector provide structured decision support.

Related Statistics Resources