Notebook AtlasSURG0002 · Research methods: go to the course map

NotebookFormula sheet

Formula sheet

Every formula and rule from the course, by lecture, with what the symbols mean and where it is taught. Most work as a small calculator.

142 formulas and rules

Foundations

Primers and conventions used throughout; not from a single lecture.

Lecture 5 · Introduction to Numerical Concepts in Research

Lecture 6 · Hypothesis Testing and Statistical Tests

  • Multiplication rule

    FormulaL6 p.20–21

    P(A and B) = P(A) × P(B) for independent events

    Taught in Chance and probability·Alpha error

    Calculator for Multiplication rule
  • Repeated independent draws

    Worked exampleL6 p.21

    (1/3)³ = 1/27 ≈ 0.037

    Taught in Chance and probability·Alpha error

    Calculator for Repeated independent draws
  • MCID-framed hypotheses

    RuleL6 p.12–15PBL2 answers

    H0: difference < MCID; H1: difference ≥ MCID (H1 is the opposite of the test hypothesis)

    MCID
    minimal clinically important difference

    Taught in Test, null and alternate hypotheses

    Calculator for MCID-framed hypotheses
  • Alpha and sample size (standard view)

    Ruleext

    False-positive rate ≈ α at any n

    Taught in Alpha error

  • p-value

    DefinitionL6 p.27–28

    p = P(difference at least as large as observed | test hypothesis and model)

    Taught in Tests, p-values, significance

  • Statistical significance

    RuleL6 p.33L6 p.59

    Significant (reject H0, accept H1) if p < the pre-set threshold, usually 0.05

    Taught in Tests, p-values, significance·Interpreting results

    Calculator for Statistical significance
  • SE of a difference (equal groups)

    Formulaext

    SE diff = σ·√(2/n)

    σ
    common SD
    n
    per group

    Taught in Tests, p-values, significance·Beta error and power

    Calculator for SE of a difference (equal groups)
  • Two-sample t-test

    Formulaext

    t = (observed − test value)/SE, df = 2n − 2; p = 2·P(T > |t|)

    Taught in Tests, p-values, significance

    Calculator for Two-sample t-test
  • Chance of a false positive across k tests

    Formulaext

    P(≥ 1 significant by chance) = 1 − (1 − α)ᵏ

    α
    significance level per test
    k
    number of tests

    Taught in p-value misconceptions·Selection of the reported result

    Calculator for Chance of a false positive across k tests
  • p is not the effect size

    RuleL6 p.39

    p does not measure the size or importance of an effect

    Taught in p-value misconceptions

  • CI and p-value

    RuleL6 p.41

    CI of the difference excludes the test value ↔ p < 0.05

    Taught in CIs and p-values

    Calculator for CI and p-value
  • Non-overlapping CIs

    RuleL6 p.42

    Continuous outcome: two 95% CIs that don’t overlap → p < 0.05

    Taught in CIs and p-values

    Calculator for Non-overlapping CIs
  • SE of a difference

    Formulaext

    SE diff = √(SE₁² + SE₂²)

    Taught in CIs and p-values

    Calculator for SE of a difference
  • CI of a difference

    Formulaext

    CI diff = d ± 1.96 × SE diff

    d
    estimated difference

    Taught in CIs and p-values

    Calculator for CI of a difference
  • SE from a CI

    Formulaext

    SE = (upper − lower)/(2 × 1.96)

    Taught in Interpreting results

    Calculator for SE from a CI
  • p-value from a CI

    Formulaext

    z = d/SE; p = 2[1 − Φ(|z|)]

    Taught in Interpreting results

    Calculator for p-value from a CI
  • One-sample t statistic

    FormulaL6 p.52

    T = (μ − x̄)/(s/√n); the usual form (x̄ − μ)/(s/√n) differs only in sign

    μ
    known population mean
    x̄
    sample mean
    s
    sample SD
    n
    sample size

    Taught in One-sample t-test

    Calculator for One-sample t statistic
  • Two-sided p from T

    FormulaL6 p.53

    p = T.DIST.2T(ABS(T), n − 1)

    Taught in One-sample t-test

    Calculator for Two-sided p from T
  • One-sided p

    Formulaext

    One-sided p = two-sided p / 2, in the hypothesised direction

    Taught in One-sample t-test·One- vs two-sided; equivalence

    Calculator for One-sided p
  • Two-sided by default

    RuleL6 p.55

    Two-sided p-values are the default

    Taught in One- vs two-sided; equivalence

  • Equivalence from a CI

    Ruleext

    Equivalence: the whole CI lies within ±margin

    Taught in One- vs two-sided; equivalence

    Calculator for Equivalence from a CI
  • Power

    FormulaL6 p.44L10 p.3L10 p.6L10 p.13

    Power = 1 − β; β = 1 − power

    β
    beta (type II, false-negative) error

    Taught in Beta error and power·Why sample size matters·Continuous outcomes·No previous study·Power calculations

    Calculator for Power
  • Power for a difference in means

    Formulaext

    Power = Φ(Δ/(σ√(2/n)) − z₁₋α/₂) [+ Φ(−Δ/(σ√(2/n)) − z₁₋α/₂)]

    Δ
    difference in means
    σ
    SD
    n
    per group
    Φ
    standard normal cumulative distribution

    Taught in Beta error and power·Why sample size matters·Power calculations

    Calculator for Power for a difference in means
  • Sample size, continuous outcome

    Formulaext

    n = 2(z₁₋α/₂ + z₁₋β)² σ² / Δ² per group, rounded up

    Δ
    difference to detect
    σ
    SD
    z₁₋α/₂
    z for the two-sided α
    z₁₋β
    z for the power

    Taught in Beta error and power·Continuous outcomes·Minimal important difference

    Calculator for Sample size, continuous outcome

Lecture 7 · Systematic errors

  • Expected false positives

    Formulaext

    Expected false positives = k × α

    Taught in Selection of the reported result

    Calculator for Expected false positives
  • Odds ratio (cross-product)

    Formulaext

    OR = ad/bc

    Taught in Classification of interventions·Risk, odds, RR, OR, RD, NNT

    Calculator for Odds ratio (cross-product)
  • Mantel–Haenszel risk ratio

    Formulaext

    MH RR = Σ(aᵢ·n0ᵢ/Nᵢ) / Σ(cᵢ·n1ᵢ/Nᵢ)

    i
    stratum
    n1ᵢ, n0ᵢ
    exposed and unexposed totals
    Nᵢ
    stratum total

    Taught in Confounding

    Calculator for Mantel–Haenszel risk ratio
  • Systematic error in an estimate

    Formulaext

    Estimated (observed) difference = true difference + bias (systematic error)

    Taught in What is systematic error·Measurement of outcomes

  • Sample size and bias

    Ruleext

    More samples narrow the spread but leave the bias

    Taught in What is systematic error

  • Confounder, mediator, moderator

    DefinitionL7 p.26–28

    Confounder: related to intervention and outcome; mediator: on the pathway from intervention to outcome; moderator: related to the outcome, not to the intervention

    Taught in Confounder, mediator, moderator

  • Size of a selection bias

    Formulaext

    Bias = analysed difference − all-eligible difference

    Taught in Selection bias

  • Misclassification direction

    RuleL7 p.36–37

    Non-differential misclassification: usually biased towards the null; differential: likely to bias

    Taught in Classification of interventions

  • ITT and per-protocol effects

    DefinitionL7 p.42

    ITT effect = effect of being assigned to (starting) the treatment; per-protocol effect = effect of adhering to it

    Taught in Deviations from intended interventions

  • Scenario analysis for missing outcomes

    RuleL7 p.52

    Re-analyse with missing outcomes as favourable and as unfavourable

    Taught in Missing data

  • Mechanisms of measurement bias

    RuleL7 p.58

    Assessors aware of the intervention; different methods by group; measurement error related to the intervention

    Taught in Measurement of outcomes

  • Flowchart: generalisability, selection or missing data

    RuleL7 p.65

    Before start or unrelated to treatment → generalisability; else initial follow-up missing → selection bias; else → missing data

    Taught in Decision flowcharts

  • Flowchart: deviations or missing data

    RuleL7 p.66

    Excluded because the intervention was not received as planned → deviations; else → missing data (corrected reading)

    Taught in Decision flowcharts

Lecture 8 · Study design

  • Prevalence

    FormulaL8 p.17–18

    Prevalence = r/n (e.g. 2700/10,000 = 27%)

    Taught in Cross-sectional studies

    Calculator for Prevalence
  • Incidence rate

    FormulaL8 p.26

    IR = r/(n × t)

    r
    new cases
    n
    people
    t
    time followed

    Taught in Cohort studies

    Calculator for Incidence rate
  • Exposure odds (case-control)

    FormulaL8 p.46

    Odds(cases) = E_case/(N_case − E_case); Odds(controls) = E_control/(N_control − E_control)

    E
    number exposed
    N
    number of cases (or controls)

    Taught in Case-control studies

    Calculator for Exposure odds (case-control)
  • RCT measures

    RuleL8 p.71L8 p.74

    RCT measures and calculations are as in cohort studies

    Taught in Randomised controlled trials

  • Interrupted time series

    RuleL8 p.78

    Compare the trend before vs after the intervention

    Taught in Quasi-experimental designs

  • Difference-in-differences

    Formulaext

    DiD = (T_P2 − T_P1) − (C_P2 − C_P1)

    T
    treated group
    C
    control group
    P1, P2
    before and after periods

    Taught in Quasi-experimental designs

    Calculator for Difference-in-differences

Lecture 9 · Variations in study design

  • Zone of equivalence

    RuleL9 p.32

    Equivalence: two-sided α and p; zone −Δ to +Δ, e.g. ±2%

    Δ
    equivalence margin

    Taught in Non-inferiority and equivalence

    Calculator for Zone of equivalence
  • Non-inferiority sidedness

    RuleL9 p.31

    Non-inferiority: one-sided α in the sample size, one-sided p in the analysis

    Taught in Non-inferiority and equivalence

  • Non-inferiority from a CI

    Ruleext

    Non-inferiority is shown if the CI limit in the harmful direction stays inside Δ

    Δ
    non-inferiority margin

    Taught in Non-inferiority and equivalence

    Calculator for Non-inferiority from a CI
  • Participants by design

    FormulaL9 p.17–19

    Total n = number of arms × n per arm; factorial total = 4 × 75 = 300

    Taught in Parallel and multi-arm trials·Factorial trials and interactions

    Calculator for Participants by design
  • Pairwise comparisons

    Formulaext

    Pairwise comparisons = k(k − 1)/2

    k
    number of arms

    Taught in Parallel and multi-arm trials

    Calculator for Pairwise comparisons
  • Interaction types

    RuleL9 p.12–15

    Additive benchmark = sum of the single effects (10 + 5 = 15 pp). Synergistic: combined > sum; antagonistic: largest single < combined < sum; negative: combined < at least one single

    Taught in Factorial trials and interactions

    Calculator for Interaction types
  • Interaction by regression

    Formulaext

    outcome ~ β0 + β1·A + β2·B + β3·A×B; test β3

    Taught in Factorial trials and interactions

  • Design effect

    Formulaext

    DE = 1 + (m − 1)·ρ

    m
    mean cluster size
    ρ
    intra-cluster correlation (ICC)

    Taught in Cluster and stepped-wedge

    Calculator for Design effect
  • Sample size for a cluster trial

    Formulaext

    n_cluster = DE × n_individual

    Taught in Cluster and stepped-wedge

    Calculator for Sample size for a cluster trial
  • Cross-over sample size ratio

    Formulaext

    N_crossover / N_parallel ≈ (1 − ρ)/2 for a continuous outcome

    ρ
    within-person correlation

    Taught in Cross-over

    Calculator for Cross-over sample size ratio
  • 3 + 3 rules

    RuleL9 p.27

    0/3 DLT → escalate; 1/3 → add 3; 2–3/3 → add 3 at the lower level; MTD = 0 or 1 of 6 with DLT

    DLT
    dose-limiting toxicity
    MTD
    maximum tolerated dose

    Taught in Dose escalation (3+3)

    Calculator for 3 + 3 rules
  • Feasibility and pilot sizes

    RuleL9 p.30

    Feasibility: about 24–50 patients usually sufficient; pilot: no special calculation, based on the recruitment period and the main-study sample size

    Taught in Pilot vs feasibility

Lecture 10 · Sample size calculations

  • Sample size, continuous outcome with different SDs

    Formulaext

    n = (z₁₋α/₂ + z₁₋β)² (σ₁² + σ₂²) / Δ²

    Taught in Continuous outcomes

    Calculator for Sample size, continuous outcome with different SDs
  • Difference to design around

    RuleL10 p.9

    Use the observed Δ only if it exceeds the MID; otherwise Δ = MID

    MID
    minimal important difference

    Taught in Minimal important difference

    Calculator for Difference to design around
  • Sample size, binary outcome

    Formulaext

    n = [z₁₋α/₂ √(2p̄(1 − p̄)) + z₁₋β √(p₁(1 − p₁) + p₂(1 − p₂))]² / (p₁ − p₂)², p̄ = (p₁ + p₂)/2

    p₁
    control proportion
    p₂
    intervention proportion
    p̄
    average of p₁ and p₂

    Taught in Binary outcomes

    Calculator for Sample size, binary outcome
  • Continuity correction

    Formulaext

    n_cc = (n/4)(1 + √(1 + 4/(n|p₁ − p₂|)))²

    Taught in Binary outcomes

    Calculator for Continuity correction
  • Variance of a binary observation

    Formulaext

    Variance = p(1 − p)

    Taught in Binary outcomes

    Calculator for Variance of a binary observation
  • Allowing for dropout

    Formulaext

    n_recruit = n/(1 − d)

    d
    expected dropout proportion

    Taught in Binary outcomes

    Calculator for Allowing for dropout
  • Half-width of a CI for a difference

    Formulaext

    CI half-width = 1.96 × σ × √(2/n)

    Taught in Why sample size matters

    Calculator for Half-width of a CI for a difference

Lecture 11 · Graphical representation of data and measures of association

  • Percentage

    FormulaL11 p.9L11 p.13–14

    Percentage = proportion × 100 = count ÷ group total × 100

    Taught in Fractions, proportions, percentages and rounding·Tables·Graphs for categorical data

    Calculator for Percentage
  • Decimal places and significant digits

    RuleL11 p.12

    Decimal places = digits right of the point; significant digits ignore the point, leading zeros and some trailing zeros

    Taught in Tables

    Calculator for Decimal places and significant digits
  • Outlier fences

    Formulaext

    Fences = Q1 − 1.5 × IQR and Q3 + 1.5 × IQR

    Q1, Q3
    lower and upper quartiles
    IQR
    Q3 − Q1

    Taught in Graphs for quantitative data

    Calculator for Outlier fences
  • Mean paired change

    Formulaext

    Mean paired change = Σ(after − before) / n

    Taught in Graphs for quantitative data

    Calculator for Mean paired change
  • Marginal totals

    FormulaL11 p.10

    Row total = a + b; column total = a + c; grand total = a + b + c + d; a marginal total sums a row or column

    Taught in Counting in a 2×2 table·Tables

    Calculator for Marginal totals
  • 2×2 layout

    ConventionL11 p.30

    Intervention (exposure) on the rows, outcome on the columns

    Taught in Counting in a 2×2 table

  • Risk ratio

    FormulaL11 p.33

    RR = [a/(a + b)] ÷ [c/(c + d)]: risk in one group ÷ risk in the other

    Taught in Confounding·Classification of interventions·Missing data·Cohort studies·Risk, odds, RR, OR, RD, NNT

    Calculator for Risk ratio
  • Odds ratio

    FormulaL11 p.33

    OR = (a/b) ÷ (c/d); in a case-control study OR = odds(cases) ÷ odds(controls)

    Taught in Cohort studies·Case-control studies·Risk, odds, RR, OR, RD, NNT

    Calculator for Odds ratio
  • Risk difference

    FormulaL11 p.33

    RD = a/(a + b) − c/(c + d)

    Taught in Risk, odds, RR, OR, RD, NNT

    Calculator for Risk difference
  • Number needed to treat (or harm)

    FormulaL11 p.32

    NNT (or NNH) = 1/RD; use 1/|RD| rounded up

    Taught in Risk, odds, RR, OR, RD, NNT

    Calculator for Number needed to treat (or harm)
  • Odds ratio to risk ratio

    FormulaL11 p.34

    RR = OR / (1 + control-group risk × (OR − 1))

    Taught in Risk, odds, RR, OR, RD, NNT

    Calculator for Odds ratio to risk ratio
  • Difference in means or medians

    FormulaL11 p.35

    Difference = mean (or median) of group A − mean (or median) of group B, chosen by the distribution

    Taught in Comparing groups: real difference or chance?·Other outcome types

    Calculator for Difference in means or medians
  • Standardised mean difference

    FormulaL11 p.35

    SMD = mean difference ÷ standard deviation (pooled SD: ext)

    Taught in Other outcome types

    Calculator for Standardised mean difference
  • Zero-cell correction

    RuleL11 p.37–38

    Add 0.5 to every cell when a cell is zero

    Taught in Other outcome types

    Calculator for Zero-cell correction
  • Ordinal exposure against a reference

    FormulaL11 p.38

    RR_k = risk_k / risk_ref; OR_k = odds_k / odds_ref

    k
    exposure level
    ref
    reference level

    Taught in Other outcome types

    Calculator for Ordinal exposure against a reference
  • Pearson correlation

    Formulaext

    r = Σ(x − x̄)(y − ȳ) / √(Σ(x − x̄)² Σ(y − ȳ)²)

    Taught in Scatter plots and correlation

    Calculator for Pearson correlation
  • Least-squares line

    Formulaext

    ŷ = a + bx

    a
    intercept
    b
    slope

    Taught in Scatter plots and correlation

    Calculator for Least-squares line
  • Choosing Pearson or Spearman

    RuleL11 p.39

    Normally distributed → Pearson; not normally distributed → Spearman

    Taught in Pearson vs Spearman

  • Spearman correlation

    Formulaext

    Spearman ρ = Pearson r computed on the ranks

    Taught in Pearson vs Spearman

    Calculator for Spearman correlation
  • CI of a proportion

    Formulaext

    ASE = √(p(1 − p)/n); 95% CI = p ± 1.96 × ASE

    p
    proportion
    ASE
    asymptotic standard error

    Taught in Summary measures by data type

    Calculator for CI of a proportion

Lecture 12 · Introduction to measurement errors and diagnostic test accuracy studies

  • Accuracy and precision

    DefinitionL12 p.6–7

    Accuracy = nearness of a measurement to the true value; precision = agreement between replicate or repeat measurements

    Taught in Accuracy vs precision

  • Bias and spread of repeated scans

    Formulaext

    Bias = mean of scans − true value; spread = SD of scans

    Taught in Accuracy vs precision

  • Measurement error

    Formulaext

    eᵢ = observed − true

    Taught in Random vs systematic error

  • Random vs systematic error

    RuleL12 p.15–16

    Random: errors sum to zero, average unchanged, variability up; systematic: errors don’t sum to zero, average shifted, biased estimate

    Taught in Random vs systematic error

  • Observed SD with random error

    Formulaext

    SD_observed = √(SD_true² + SD_error²)

    Taught in Random vs systematic error

  • Sensitivity

    FormulaL12 p.27

    Sensitivity = TP/(TP + FN)

    Taught in Diagnostic test accuracy (2×2)

    Calculator for Sensitivity
  • Specificity

    FormulaL12 p.27

    Specificity = TN/(FP + TN)

    Taught in Diagnostic test accuracy (2×2)

    Calculator for Specificity
  • Positive predictive value

    FormulaL12 p.29

    PPV = TP/(TP + FP)

    Taught in Diagnostic test accuracy (2×2)

    Calculator for Positive predictive value
  • Negative predictive value

    FormulaL12 p.29

    NPV = TN/(FN + TN)

    Taught in Diagnostic test accuracy (2×2)

    Calculator for Negative predictive value
  • Test threshold

    RuleL12 p.31

    Positive if the value ≥ threshold; negative if below

    Taught in Thresholds and ROC curves

    Calculator for Test threshold
  • ROC curve

    RuleL12 p.32

    ROC curve = sensitivity (y) against 1 − specificity (x) across thresholds

    Taught in Thresholds and ROC curves

    Calculator for ROC curve
  • Area under the ROC curve

    Formulaext

    AUC by the trapezoid rule

    Taught in Thresholds and ROC curves

    Calculator for Area under the ROC curve
  • Percentage agreement

    FormulaL12 p.33

    % agreement = (both yes + both no) / total observations

    Taught in Agreement: kappa

    Calculator for Percentage agreement
  • Landis–Koch bands

    RuleL12 p.34

    κ < 0 poor; 0–0.20 slight; 0.21–0.40 fair; 0.41–0.60 moderate; 0.61–0.80 substantial; 0.81–1.00 almost perfect

    Taught in Agreement: kappa

    Calculator for Landis–Koch bands
  • Cohen's kappa

    Formulaext

    κ = (p_o − p_e)/(1 − p_e)

    p_o
    observed agreement
    p_e
    agreement expected by chance

    Taught in Agreement: kappa

    Calculator for Cohen's kappa
  • Chance-expected agreement

    Formulaext

    p_e = (row₁ × col₁ + row₂ × col₂)/N²

    Taught in Agreement: kappa

    Calculator for Chance-expected agreement
  • Bland–Altman plot

    FormulaL12 p.37

    dᵢ = x₁ᵢ − x₂ᵢ; mᵢ = (x₁ᵢ + x₂ᵢ)/2; plot d against m

    dᵢ
    difference between methods
    mᵢ
    mean of the two methods

    Taught in Bland–Altman and ICC

    Calculator for Bland–Altman plot
  • Limits of agreement

    FormulaL12 p.37

    Limits = mean difference ± 2 × SD of the differences (±1.96 is the commonly cited value, ext)

    Taught in Bland–Altman and ICC

    Calculator for Limits of agreement
  • Relative standard deviation

    FormulaL12 p.39

    RSD = SD / mean × 100; < 5% indicates minimal error

    Taught in Bland–Altman and ICC

    Calculator for Relative standard deviation
  • ICC and CCC

    DefinitionL12 p.38

    ICC and CCC: named only, no formula

    Taught in Bland–Altman and ICC