Key ideas
Collecting data1. A parameter describes the population, a statistic the sample.
- Sampling: simple random (every subset equally likely), stratified (random sample inside each group, e.g. each district — gives comparisons between groups), cluster (sample whole groups), multistage.
- Bias in surveys: voluntary response (only people with strong opinions call in), non-response (follow up non-responders rather than ignore them), response bias (leading wording), convenience samples. A bigger sample does not fix bias.
- Observational study: researchers only observe → association, possibly due to a confounding (lurking) variable. Experiment: researchers assign treatments at random → causal conclusions1.
- Experimental principles: control (the control group gets the identical procedure minus the treatment, e.g. a placebo), randomise, replicate, block (group similar units, e.g. by sex, then randomise within blocks to reduce variation within treatments)1. Double-blind: neither subjects nor evaluators know the treatment. Matched pairs: each unit gets both treatments (or units are paired) and you analyse the differences. A full factorial design has one treatment group per combination of factor levels: 3 doses × 2 diets give 6 groups.
Describing data. Mean (pulled by outliers; raising one of values by raises the mean by ), median, quartiles, SD. Adding a constant shifts the mean but not the SD; multiplying scales both. counts SDs from the mean2. Charts: histogram (distribution of one numeric variable — more bins, finer detail), KDE (smooth estimate of it), bar chart (categories), line chart (trends over time), pie or waffle chart (parts of a whole), scatter plot (two numeric variables; colour, size or shape add a third), facets (one panel per value of a variable). Truncated or reversed axes and too many pie slices mislead.
Normal model2: 68–95–99.7% within 1, 2, 3 SDs. Key quantiles: , , , , , .
Sampling distribution and CLT. A statistic varies from sample to sample; its distribution over all samples of size is the sampling distribution, and its SD is the standard error2. has mean and SE ; by the CLT it is approximately normal when the observations are independent and is large, whatever the population's shape (finite variance) 2. With small from a skewed population it is still skewed.
Confidence intervals. estimate ± critical value × SE. "95% confidence" describes the procedure: about 95% of intervals built this way contain the parameter; it is not a 95% probability that this particular interval does3. The margin of error is SE, about SE at 95%2. Higher confidence → wider; four times the data → half the width. The width scales with : 95% instead of 90% multiplies it by .
Hypothesis tests3: (no effect) vs . The p-value is the probability, computed assuming , of a test statistic at least as extreme as the one observed; reject when .
| true | false | |
|---|---|---|
| reject | Type I error, probability | correct; probability = power |
| keep | correct | Type II error, probability |
cannot be computed from alone (it depends on the true effect and ); more data raises power at fixed 3. Use a distribution with df when is estimated — heavier tails, approaching the normal as df grows3. Chi-square test of independence on an table: df , expected counts at least 5 in every cell8; larger df shift the distribution right, so the critical value grows with df8. Correlation has no units; is the share of the variation in explained by the least-squares line7, so it grows with the square of ( explains 25%).
Estimation for ML. Maximum likelihood picks the parameters that make the data most probable; in practice minimise the negative log-likelihood (sums instead of products, no underflow)4. Gaussian: , (biased; is unbiased). An estimator's MSE = bias² + variance, so a biased estimator with small variance can have a lower MSE than an unbiased one3. Bayesians put a prior distribution on parameters; frequentists do not. Beta() prior + successes in Bernoulli trials → Beta(, ) posterior, predictive 5.
MCMC. Random-walk Metropolis–Hastings proposes near and accepts with probability , so the normalising constant is never needed6. Discard the early burn-in samples, which still reflect the start point. Tiny proposals: almost all accepted but the chain crawls; huge proposals: most rejected, long flat stretches. Correlated samples carry less information (smaller effective sample size)6.
Formulas
Worked example
, , known : SE ; 95% CI . Test : , two-sided → reject; consistently, 50 lies outside the 95% CI. MLE for data under a Gaussian: , (unbiased: ). Uniform Beta(1, 1) prior, 6 heads in 8 tosses → Beta(7, 3), predictive (MLE ).
Common pitfalls
- Correlation/association ≠ causation: only randomised experiments support causal claims1.
- Blocking reduces variability within treatments; it is not about removing bias in sampling.
- CI interpretation: the parameter is fixed, the interval is random3; and a CI targets the population parameter, not individual observations2.
- p-value ≠ P( true) — it assumes 3.
- Choosing α sets P(Type I); it does not determine β.
- MLE variance divides by and is biased low.
- Stratified sampling improves precision and comparisons, but does not remove bias from a flawed frame or wording.
References
- OpenIntro, Introduction to Modern Statistics (2nd ed.), Ch. 2 Study design — Sec. 2.1 Sampling principles and strategies (Four sampling methods); 2.2 Experiments (Principles of experimental design; Reducing bias in human experiments); 2.3 Observational studies
- OpenIntro, Introduction to Modern Statistics (2nd ed.), Ch. 13 Inference with mathematical models — Sec. 13.1 Central Limit Theorem; 13.2 Normal Distribution (Standardizing with Z scores); 13.3 Quantifying the variability of a statistic (68-95-99.7 rule; Standard error; Margin of error); 13.6.3 Interpreting confidence intervals
- Dive into Deep Learning — Sec. 22.10.1 Evaluating and Comparing Estimators; 22.10.2 Conducting Hypothesis Tests; 22.10.3 Constructing Confidence Intervals
- Dive into Deep Learning — Sec. 22.7.1 The Maximum Likelihood Principle; 22.7.2 Numerical Optimization and the Negative Log-Likelihood; 22.7.3 Maximum Likelihood for Continuous Variables
- Wikipedia: Conjugate prior — Example; Interpretations (Pseudo-observations); Table of conjugate distributions
- Wikipedia: Metropolis–Hastings algorithm — Description; Step-by-step instructions
- OpenIntro, Introduction to Modern Statistics (2nd ed.), Ch. 7 Linear regression with a single predictor — Sec. 7.1 Fitting a line, residuals, and correlation (Describing linear relationships with correlation); 7.2 Least squares regression (Describing the strength of a fit)
- OpenIntro, Introduction to Modern Statistics (2nd ed.), Ch. 18 Inference for two-way tables — Sec. 18.1 Randomization test of independence (Expected counts in two-way tables); 18.2 Mathematical model for test of independence (degrees of freedom; conditions)