1. Data and sampling
- Population
- Every unit you care about.Every customer of a bank, not just those you surveyed.
- Sample
- The slice of the population you actually measure.500 customers picked at random.
- Parameter
- A number that describes the population. Usually unknown.The true average balance μ of all customers.
- Statistic
- A number computed from a sample. It changes from sample to sample., the average balance of your 500.
- Simple random sample
- Every possible sample of size n has the same chance of being picked.50 names drawn from a hat holding every name.
- Stratified sample
- Split the population into groups, then sample at random inside each.20 customers from each region, so every region shows up.
- Qualitative variable
- Labels or categories, even if they come in an order.Shirt size S, M, L.
- Quantitative variable
- Numbers you can do arithmetic on.Monthly sales in dollars.
- Discrete vs continuous
- Discrete values are counted; continuous ones are measured and can fall anywhere.Number of children vs height.
- Levels of measurement
- Nominal (names), ordinal (order), interval (equal steps, no true zero), ratio (true zero).Temperature in °C is interval; income is ratio.
2. Where is the middle
- Mean
- The balance point: add everything up and divide by how many.2, 4, 9: mean 5.
- Median
- The middle value once sorted. Outliers barely move it.2, 4, 90: median 4, mean 32.
- Mode
- The most common value.Shoe sizes 8, 9, 9, 10: mode 9.
- Skew
- A long tail on one side. The mean gets pulled toward the tail.Incomes skew right, so mean > median.
- Outlier
- A value far from the rest.One $5M house on a street of $400k homes.
3. How spread out is it
- Range
- Largest minus smallest.3 to 11: range 8.
- Variance
- The average squared distance from the mean (divide by n − 1 for a sample).Units are squared, so we take the root.
- Standard deviation
- The typical distance from the mean, in the data's own units.Returns average 8% with SD 6%.
- Coefficient of variation
- SD divided by the mean: risk per unit of reward.SD 6 on mean 8 is CV 75%.
- z score
- How many SDs a value sits from the mean.z = 2 means two SDs above average.
- Empirical rule
- For bell-shaped data, about 68%, 95% and 99.7% fall within 1, 2 and 3 SDs.Mean 100, SD 15: 95% between 70 and 130.
- Interquartile range
- Q3 minus Q1, the spread of the middle half.Ignores the extremes on both ends.
4. Probability rules
- Sample space
- Every possible outcome.A die: 1, 2, 3, 4, 5, 6.
- Event
- A set of outcomes you care about.Rolling an even number.
- Complement
- Everything that is not the event. P(not A) = 1 − P(A).P(at least one) = 1 − P(none).
- Mutually exclusive
- Two events that cannot happen together.Rolling a 2 and a 5 on one roll.
- Independent
- Knowing one happened does not change the chance of the other.Two separate coin flips.
- Conditional probability
- The chance of A once you know B happened: P(A and B) / P(B).P(bag arrives | flight on time).
- Bayes' rule
- Flip a conditional around: from P(B | A) to P(A | B).From test accuracy to the chance you really have it.
5. Random variables and expected value
- Random variable
- A number whose value depends on chance.Profit next month.
- Expected value
- The probability-weighted average: the long-run average over many repeats.A die averages 3.5, though you never roll 3.5.
- Probability distribution
- A list or curve of every value and its probability.Visits 0, 1, 2 with chances 0.5, 0.3, 0.2.
6. Two variables: covariance, correlation, portfolios
- Covariance
- Whether two variables move together, in their combined units.Positive when both rise together.
- Correlation
- Covariance rescaled to sit between −1 and 1.r = 0.8: a strong upward pattern.
- Diversification
- Mixing assets that don't move together lowers total risk.Low correlation means a lower portfolio SD.
7. Counting and the binomial
- Factorial
- n! = n × (n − 1) × … × 1: ways to order n things.4! = 24.
- Combination
- Ways to choose k from n when order does not matter.C(5, 2) = 10 pairs.
- Permutation
- Ways to choose k from n when order matters.P(5, 2) = 20 ordered pairs.
- Binomial distribution
- Count of successes in n independent tries with the same chance p.Heads in 10 flips.
- Hypergeometric distribution
- Successes when you draw without replacement from a small group.Defective parts in 4 picked from a box of 10.
8. Poisson: counts per unit
- Poisson distribution
- Events in a fixed window when they arrive at a steady rate λ.Calls per hour at a help desk.
- Rate λ
- The average count per window. Mean and variance both equal λ.3 per hour is λ = 6 over 2 hours.
9. The normal curve and z
- Normal distribution
- The bell curve, set by its mean and SD.Heights, measurement errors, many averages.
- Standard normal
- The normal with mean 0 and SD 1. Every z table uses it.Z ~ N(0, 1).
- Percentile
- The value with a given share of the data below it.The 90th percentile has 90% below it.
- Uniform distribution
- Every value in a range is equally likely.A wait between 0 and 20 minutes.
10. Sampling distributions and the CLT
- Sampling distribution
- The distribution of a statistic over every possible sample.All the 's you could get with n = 36.
- Standard error
- The SD of a statistic: how much it wobbles from sample to sample.σ / √n for a sample mean.
- Central Limit Theorem
- Averages of large samples are close to normal, whatever the population looks like.Skewed incomes, but averages of 50 form a bell.
- Unbiased estimator
- A statistic whose average over all samples equals the parameter. for μ, and s² with n − 1 for σ².
- Efficient estimator
- The unbiased estimator with the smallest spread. beats the median for estimating μ.
11. Confidence intervals and sample size
- Point estimate
- A single best guess for a parameter. = 42.5.
- Confidence interval
- Estimate plus or minus a margin. Built this way, 95% catch the truth.42.5 ± 2.6.
- Margin of error
- The plus-or-minus part of an interval.± 3 points in a poll.
- Confidence level
- How often the method catches the truth in the long run.95%: about 95 of 100 intervals.
- t distribution
- Like the normal, with fatter tails. Used when σ is unknown and you use s.t with 15 df for n = 16.
- Degrees of freedom
- How many values are free to vary. For one sample, n − 1.n = 20 gives 19 df.
12. Hypothesis tests
- Null hypothesis H₀
- The boring claim of no effect or no change. It holds the equals sign.μ = 250 ml.
- Alternative hypothesis H₁
- What you want evidence for.μ ≠ 250, or μ < 250.
- Test statistic
- How many standard errors the sample landed from H₀.z = −2.5.
- p-value
- The chance of data at least this extreme if H₀ were true.p = 0.012: rare under H₀.
- Significance level α
- The cutoff for rejecting H₀, and the chance of a false alarm.α = 0.05.
- Type I error
- Rejecting a true H₀: a false alarm.Calling a fair machine broken.
- Type II error
- Keeping a false H₀: a missed signal.Missing that the machine pours short.
- Power
- The chance of catching a real effect: 1 − β.Bigger samples have more power.
- One-sided vs two-sided
- One-sided looks in one direction; two-sided looks for any difference.H₁: μ < 500 vs H₁: μ ≠ 500.
13. Simple regression
- Regression line
- The straight line that best predicts y from x by least squares.ŷ = 2 + 0.5x.
- Slope
- How much predicted y changes when x rises by 1.0.5 more sales per ad dollar.
- Intercept
- Predicted y when x is 0. Sometimes meaningless.Sales with zero advertising.
- Residual
- Actual minus predicted: what the line missed.Actual 10, predicted 8: residual 2.
- Least squares
- Pick the line with the smallest sum of squared residuals.SSE is minimized.
- R²
- The share of the variation in y that the model explains.R² = 0.81: 81% explained.
- Extrapolation
- Predicting outside the range of x you observed. Risky.Ad spend of 50 when the data stop at 12.
14. Multiple regression
- Multiple regression
- Predicting y from several x's at once.Price from size, age and location.
- Adjusted R²
- R² with a penalty for adding predictors that do not help.Falls when you add a useless variable.
- Dummy variable
- A 0/1 column for a category. Use k − 1 of them for k categories.North = 1, else 0.
- Multicollinearity
- Predictors that move together, which makes slopes unstable.VIF above 5 or 10 is a warning.
- F test
- Tests whether the model as a whole explains anything.F = MSR / MSE.