- 0.1Why probability? Axioms and KolmogorovState Kolmogorov's three axioms (non-negativity, normalisation, countable additivity)
- 0.2Random variables and distributionsDefine a random variable as a measurable function X : Ω → ℝ
- 0.3Joint, conditional, marginalDefine a joint distribution for two random variables and read its joint PMF / PDF
- 0.4Expectations and momentsCompute the expectation E[X] as a probability-weighted average
- 0.5The catalog of common distributionsRecognise 10 named distributions by their shape and parameter meaning
- 0.6The law of large numbersState the strong and weak LLN
- 0.7The central limit theoremState the classical CLT and recognise its assumptions (finite variance, i.i.d.)
- 0.8Transformations of random variablesState the change-of-variable formula for monotonic transformations
- 0.9Moment-generating and characteristic functionsDefine the MGF M_X(t) = E[e^(tX)] and recognise its domain of definition
- 0.10Simulation as intuitionUse Monte Carlo to estimate probabilities and expectations by averaging i.i.d. samples
Statistics and Data Science for Researchers
Statistics for researchers who refuse to p-hack.
From probability axioms to causal inference, Bayesian analysis, and ML for researchers, all in the browser, all reproducible.
What a confidence interval actually covers
What you will learn
- Probability from Kolmogorov to the CLT, with live simulation widgets
- Estimation theory: MLE, Cramér-Rao bound, bootstrap from first principles
- Hypothesis testing without p-hacking: FWER, FDR, equivalence testing, preregistration
- Linear and generalised linear models with full diagnostic toolkit
- Causal inference: DAGs, IV, RDD, DiD, propensity scores, sensitivity analysis
- Bayesian methods: conjugacy, Metropolis, Gibbs, HMC, posterior predictive checks
- ML for researchers: calibration, fairness, double ML, causal forests
- Six real-research capstones from RCT design to reproducibility audit
- All in-browser, all reproducible, all open-data
Designed for
Research-track scientists, graduate students, and working analysts who need to do statistics correctly, not just compute it. Equally useful for self-taught analysts who skipped formal statistics training and want a defensible foundation.
Read the full introduction
Thirteen parts that take a reader who knows arithmetic and a little algebra all the way to confident, defensible statistical practice. Part 0 builds probability from Kolmogorov's axioms through the central limit theorem. From there: estimation theory, hypothesis testing without the p-hacking pathologies, confidence intervals you can defend, linear and generalised linear models, the causal-inference toolkit (DAGs, IV, RDD, DiD, propensity), Bayesian methods (Metropolis, Gibbs, HMC), resampling and nonparametrics, ML done with research-grade care (calibration, fairness, double ML), six real research capstones, a per-part quiz bank with final exam, and a master research-analyst workflow card.
Contents
13 parts · 95 sections · 110 interactive figures- 1.1Estimators and their propertiesDefine an estimator as a function of the sample, and recognise it as a random variable
- 1.2Method of momentsState the method of moments (MoM) idea: equate the first k sample moments to the first k theoretical moments and solve for the k parameters
- 1.3Maximum likelihoodState the maximum likelihood principle: θ̂_MLE = argmax_θ L(θ; X) = argmax_θ Σ log f(Xᵢ; θ)
- 1.4Fisher information and the Cramér-Rao boundDefine the score U(θ) = ∂ℓ/∂θ as the gradient of the log-likelihood and recognise it as a random variable with mean zero at the true θ
- 1.5Bias-variance, MSE, and the efficiency frontierState and prove in two lines the bias-variance decomposition MSE(θ̂) = Var(θ̂) + Bias(θ̂)² and operationalise it as a guide for choosing among estimators
- 1.6Sampling distributions and the standard errorDefine the sampling distribution of an estimator as the distribution of across independent samples of size n from a fixed population
- 1.7Bootstrap, jackknife, and resampling first principlesState the plug-in principle: estimate any functional T(F) of an unknown CDF F by T(F̂ₙ), where F̂ₙ is the empirical CDF
- 1.8Robust and M-estimatorsState the contamination model, the gross-error / ε-contamination mixture , and explain why the sample mean has breakdown point 0: a single observation with arbitrary value can drag the estimate to ±∞
- 1.9Consistency, asymptotics, and "large enough"Define the three convergence modes for random variables, convergence in PROBABILITY (: for every , ), ALMOST SURELY (), and IN DISTRIBUTION ( at every continuity point of ), and read the strict implications a.s. ⇒ in-probability ⇒ in-distribution, none of the reverses true in general
- 2.1The Neyman-Pearson framework, honestlyCast hypothesis testing as a DECISION problem: based on data, choose H₀ or reject H₀, distinct from the question "is H₀ true?"
- 2.2Type-I, Type-II, power, and effect sizeRestate the Type-I rate and Type-II rate in Section 2.1 language and define POWER as
- 2.3t-tests, χ², F-tests done by handCompute the ONE-SAMPLE t-statistic by hand and recognise it as the standardised distance of the sample mean from the null mean in units of the SE
- 2.4What a p-value is, and what it is notState THE definition: the p-value is , the tail probability of the test statistic under ; "more extreme" follows the test's directionality (one-sided / two-sided)
- 2.5Multiple testing: FWER and FDRExplain why testing k > 1 hypotheses at level α each gives an EFFECTIVE Type-I rate above α: under independence, the chance of ANY false positive is , which exceeds α and grows in k
- 2.6Preregistration and the garden of forking pathsDefine the GARDEN OF FORKING PATHS (Gelman & Loken 2014): a real analysis contains many implicit choices, variables to include, transformations, outlier rules, subgroups, modelling decisions, and each choice is a fork; if the researcher follows the path that gives the most publishable result, the effective Type-I rate inflates EVEN WITHOUT conscious p-hacking
- 2.7Equivalence testing and TOSTState the ASYMMETRY of classical NHST: a non-significant p-value does NOT support H₀; failure to reject is NOT evidence for the null. 'Absence of evidence is not evidence of absence' (Altman & Bland 1995, BMJ)
- 2.8The replication crisis and what to actually doRecall the EMPIRICAL findings of the major replication projects: Open Science Collaboration (2015, Science), 36% of 100 psychology effects reached statistical significance with the same direction in the replication; Camerer et al. (2018, Nature Human Behaviour), 61% of 21 economics experiments replicated; Klein et al. Many Labs 2 (2018, AMPPS), 14/28 effects (50%) reached the conventional cutoff; Klein et al. Many Labs (2014, Soc Psychol), 10/13 robust
- 3.1Exact vs asymptotic CIsState the FREQUENTIST definition of a confidence interval as a PROCEDURE: for confidence level 1 − α, the procedure C(X) = [L(X), U(X)] satisfies P_θ(θ ∈ C(X)) ≥ 1 − α for every θ, coverage is a property of the random PROCEDURE under the true parameter, NOT a probability statement about a single computed [a, b]
- 3.2Bootstrap CIs (percentile, BCa, basic)Recap from Section 1.7: the nonparametric bootstrap (Efron 1979) generates B replicates θ̂*_b by resampling WITH REPLACEMENT from the observed sample X_1, …, X_n, treating the empirical CDF F̂_n as a plug-in for the unknown F. The bootstrap distribution {θ̂*_b}_{b=1}^B is the empirical estimate of the sampling distribution of θ̂
- 3.3Profile-likelihood and likelihood-ratio CIsState the LIKELIHOOD-RATIO statistic and its log-form , and recognise it as the test statistic for vs the unrestricted alternative
- 3.4Prediction intervals vs confidence intervalsState the conceptual contrast: a CONFIDENCE INTERVAL is about a PARAMETER (e.g. μ), a fixed unknown, whereas a PREDICTION INTERVAL is about a RANDOM VARIABLE (e.g. the next observation X_{n+1}). The CI bands estimation uncertainty alone; the PI bands estimation uncertainty PLUS the intrinsic variance of the future draw
- 3.5Calibration: when 95% really means 95%Define CALIBRATION as the property that a procedure claiming (1 − α) coverage / a forecast claiming probability p delivers that frequency in repeated experience. State that calibration is a property of the PROCEDURE under repeated sampling, not of a single realised interval or forecast
- 3.6Communicating uncertainty without lyingRecognise that numbers do not speak for themselves: the SAME study can be reported in ways that mislead OR ways that inform. Communication is part of the analysis, not separable from it
- 4.1OLS as geometryState the LINEAR-REGRESSION SETUP in matrix form: Y = Xβ + ε with Y ∈ ℝⁿ, X ∈ ℝⁿˣᵖ (design matrix; rows = observations, columns = predictors, typically including a column of 1s for the intercept), β ∈ ℝᵖ (coefficient vector), ε ∈ ℝⁿ (error vector). Identify the four objects' dimensions and how p ≪ n is the regime where OLS is well-posed
- 4.2Assumptions and what breaks when they failRecite the FIVE GAUSS-MARKOV ASSUMPTIONS (linearity, exogeneity, homoscedasticity, no autocorrelation, no perfect multicollinearity) plus the optional sixth (Normality) as a checklist, and state for each one which residual-plot panel reveals the violation, what is broken in the OLS estimator or its standard errors when it fails, and what fix is appropriate
- 4.3Diagnostics: residuals, leverage, influenceDistinguish outlier, leverage, and influence as three SEPARATE properties of an observation
- 4.4Heteroscedasticity, GLS, and weighted regressionDiagnose heteroscedasticity from residuals and from Breusch-Pagan / White tests
- 4.5Robust regressionDiagnose when outliers are contaminating an OLS fit (vs when heteroscedasticity is the issue)
- 4.6Interactions and nonlinear termsDistinguish a main effect from an interaction effect
- 4.7Model selection: AIC, BIC, cross-validationDiagnose overfitting via the gap between training and test error
- 4.8Causal warnings: regression is not causationDistinguish prediction from causal estimation in linear regression
- 5.1From linear to generalised: link and familyState the three GLM components: random (response distribution from exponential family), systematic (linear predictor η = Xβ), link (g connecting μ to η)
- 5.2Logistic regression and odds ratiosFit and interpret logistic regression with logit link
- 5.3Poisson and negative-binomial countsFit Poisson regression with log link for count data
- 5.4Deviance, residuals, and GLM diagnosticsCompute deviance residuals and Pearson residuals for any GLM
- 5.5Mixed-effects and hierarchical models introRecognise clustered data (repeated measures, multi-level groups) as requiring hierarchical models
- 5.6When the GLM is not enoughRecognise when GLM assumptions break: non-exponential-family responses, complex link functions, deep nonlinearity
- 6.1Potential outcomes and the fundamental problemState Rubin's potential-outcomes framework: each unit has Y(0) AND Y(1)
- 6.2Randomised controlled trials, designed rightApply random assignment to break the dependence between T and (Y(0), Y(1))
- 6.3Confounding and the DAG toolkitRepresent causal assumptions as Directed Acyclic Graphs (DAGs)
- 6.4Propensity scores, matching, and IPTWDefine the propensity score e(X) = P(T = 1 | X)
- 6.5Instrumental variablesDefine an INSTRUMENT Z and state the three required conditions: relevance, exogeneity, exclusion
- 6.6Regression discontinuityIdentify a RUNNING VARIABLE with a SHARP cutoff that deterministically assigns treatment
- 6.7Difference-in-differences and synthetic controlsState the difference-in-differences estimator as a 2×2 cell-mean calculation
- 6.8Sensitivity analysis for hidden confoundersState the central question of sensitivity analysis: how strong an UNOBSERVED confounder is needed to nullify a finding
- 7.1Prior, likelihood, posterior, the mechanicsState Bayes' theorem and identify its three pillars: prior, likelihood, posterior
- 7.2Conjugate priors and analytic posteriorsDefine a CONJUGATE prior as one for which the posterior belongs to the SAME parametric family
- 7.3Metropolis-Hastings by handState the Metropolis acceptance ratio α = min(1, π(θ*) / π(θ)) for symmetric proposals
- 7.4Gibbs sampling on a 2D exampleDefine a GIBBS SAMPLER as a Markov chain that updates one (or one block of) coordinate(s) at a time from the FULL CONDITIONAL distribution
- 7.5Hamiltonian Monte Carlo intuitionState HMC's central idea: introduce auxiliary momentum and evolve via Hamiltonian dynamics conserving H = U + K
- 7.6Posterior-predictive checksDefine the POSTERIOR-PREDICTIVE distribution p(y_rep | y) = ∫ p(y_rep | θ) p(θ | y) dθ
- 7.7Model comparison: Bayes factors and WAICDefine the BAYES FACTOR as the ratio of marginal likelihoods between two models
- 8.1Bootstrap, deeper: parametric vs nonparametricDistinguish PARAMETRIC bootstrap (resample from a fitted parametric model) from NONPARAMETRIC bootstrap (resample from the empirical distribution)
- 8.2Permutation tests and exchangeabilityState the EXCHANGEABILITY assumption that justifies permutation tests under H0
- 8.3Cross-validation done rightDistinguish in-sample (training) error from out-of-sample (cross-validation) error
- 8.4Rank-based methods and U-statisticsState the WILCOXON RANK-SUM (Mann-Whitney U) test and its connection to permutation tests
- 8.5Kernel density estimationDefine KDE: place a kernel at each data point; sum and normalise
- 8.6Quantile regression and distribution-free CIsDefine the QUANTILE REGRESSION (Koenker-Bassett 1978) by the asymmetric check loss
- 9.1The ML mindset: prediction vs explanationArticulate the PREDICTION vs EXPLANATION trade-off as the core ML choice
- 9.2Regularisation: ridge, lasso, elastic netDefine RIDGE regression as OLS + L2 penalty on coefficients
- 9.3Trees, random forests, and gradient boostingDefine a DECISION TREE as a recursive axis-aligned partition that minimises within-leaf variance (regression) or impurity (classification)
- 9.4Calibration and probability outputsDistinguish CALIBRATION (predicted probabilities match empirical frequencies) from DISCRIMINATION (AUC, accuracy)
- 9.5Fairness audits and equalised oddsDefine key fairness criteria: DEMOGRAPHIC PARITY, EQUALIZED ODDS, PREDICTIVE PARITY
- 9.6Causal forests and double MLState the DOUBLE/DEBIASED ML framework (Chernozhukov et al. 2017)
- 9.7Reporting an ML result so the reader can trust itList the SIX MANDATORY components of an ML report (data, model, evaluation, fairness, deployment, ethics)
- 9.8When NOT to use MLRecognise hypothesis testing and inference as classical-stats territory, not ML
- 10.1Capstone 1, a designed RCT, end to endExecute a complete RCT workflow: power analysis → preregistration → data simulation → confirmatory analysis → robustness checks → write-up
- 10.2Capstone 2, an observational study with confoundingSpecify a DAG distinguishing the causal pathway X → Y from the confounding pathway X ← Z → Y
- 10.3Capstone 3, a meta-analysis with publication-bias correctionSynthesise study-level effect estimates using fixed-effect and DerSimonian-Laird random-effects meta-analysis
- 10.4Capstone 4, a Bayesian dose-response analysisFit a 4PL (Emax) dose-response model by Bayesian MCMC with informative priors
- 10.5Capstone 5, a predictive ML deployment with fairness auditTrain and audit a binary classifier with a sensitive group attribute
- 10.6Capstone 6, a reproducibility audit of a published studyRecognise analytic degrees of freedom as a source of replication failure
- 11.1Quiz, Part 0: Probability from zeroCheck your recall of the Part 0 (probability axioms, random variables, distributions, expectations, CLT, LLN) material
- 11.2Quiz, Part 1: EstimationCheck your recall of the Part 1 (estimators, MLE, method of moments, Fisher info, bias-variance, sampling distributions, bootstrap, robust estimators, asymptotics) material
- 11.3Quiz, Part 2: Hypothesis testingCheck your recall of the Part 2 (NHST, Type-I/II/power, p-values, multiple testing, preregistration, equivalence, replication) material
- 11.4Quiz, Part 3: Confidence intervalsCheck your recall of the Part 3 (exact vs asymptotic CIs, bootstrap, profile likelihood, prediction intervals, calibration, communicating uncertainty) material
- 11.5Quiz, Part 4: Linear regressionCheck your recall of the Part 4 (OLS, assumptions, diagnostics, GLS, robust, interactions, model selection, causal warnings) material
- 11.6Quiz, Part 5: GLMsCheck your recall of the Part 5 (GLM components, logistic regression, Poisson + NB, deviance, mixed effects, GAMs) material
- 11.7Quiz, Part 6: Causal inferenceCheck your recall of the Part 6 (potential outcomes, RCTs, DAGs, propensity scores, IV, RDD, DiD, sensitivity analysis) material
- 11.8Quiz, Part 7: Bayesian methodsCheck your recall of the Part 7 (prior/likelihood/posterior, conjugate priors, MCMC, posterior-predictive checks, Bayes factors and WAIC) material
- 11.9Quiz, Part 8: Resampling and nonparametricsCheck your recall of the Part 8 (bootstrap, permutation tests, cross-validation, rank-based methods, KDE, quantile regression) material
- 11.10Quiz, Part 9: ML for researchersCheck your recall of the Part 9 (ML mindset, regularization, trees and forests, calibration, fairness, causal ML, reporting, when not to use ML) material
- 11.11Quiz, Part 10: CapstonesCheck your recall of the Part 10 (RCT, observational study, meta-analysis, Bayesian dose-response, ML deployment, reproducibility audit) material
- 11.12Final exam, integrated assessmentTest cumulative recall across the entire curriculum (Parts 0-10)