p-Values, Regression Coefficients, and L1 vs L2 Penalties
Statistics & ExperimentsModel answerLast updated
Rapid-fire statistics: define p-values correctly, interpret regression coefficients with confounders, and choose between Lasso and Ridge penalties.
You are in a statistics rapid-fire round. For each part, give a plain-language answer a product stakeholder could follow, then a precise technical answer.
Part A — p-values
- In plain language, what is a p-value?
- State the formal definition.
- How should it be interpreted, and what misreadings should be avoided?
- An A/B test on the primary metric returns p = 0.03. What do you decide, and what else would you want to know before shipping the change?
Part B — Linear regression with confounding 5. With several features in a regression and suspected confounding, how do you read each coefficient? 6. What does "holding the other variables constant" really mean, and when does that reading break down? 7. How does an associational reading of a coefficient differ from a causal one? 8. What checks or designs would you use to shrink confounding bias?
Part C — L1 vs L2 regularization 9. Define L1 (Lasso) and L2 (Ridge) penalties and describe how their effects differ. 10. When would you favor one over the other — thinking about feature selection, correlated features, prediction accuracy, and interpretability? 11. How would you pick the penalty strength, and what trade-offs come with that choice?
Hints
Hint 1
A p-value is computed assuming the null is true — it is a statement about the data, not about the hypothesis.
Hint 2
An omitted confounder bends a coefficient only if it affects the outcome and is correlated with the focal feature; that is the omitted-variable bias formula.
Hint 3
The L1 penalty's geometry puts solutions exactly at zero; the L2 penalty shrinks smoothly but keeps every coefficient nonzero — think about what that means for correlated features.
Hint 4
Pick λ by cross-validation, but remember that the λ minimizing error need not be the λ giving the most stable or honest coefficients.
Model answer
Easy Try it yourself first — then compare your approach, complexity and edge cases.
What this round is testing
The interviewer wants crisp definitions, no overclaiming, and judgment about when a number means what it seems to. For each part, lead with a one-sentence stakeholder version, then the technical version. Keep it short — this is rapid-fire.
Part A — p-values
1. Plain language. Imagine the change did nothing. The p-value answers: how often would random noise alone produce a difference at least this large? A small value means the result would be surprising under "no effect" — evidence of something real, not proof of it.
2. Formal definition. With null hypothesis H₀, test statistic T, and observed value t:
- One-sided: p = P(T ≥ t | H₀)
- Two-sided: p = P(|T| ≥ |t| | H₀)
It is computed assuming H₀ holds and that the test's assumptions hold (independence, the sampling distribution of T, a test chosen in advance). Under H₀ with a continuous statistic, p is Uniform(0,1) — which is exactly why rejecting at p ≤ α caps the false-positive rate at α.
3. Interpretation and pitfalls. The correct reading: the p-value measures compatibility between data and H₀; you compare it to a pre-chosen α to make a decision. Misreadings to avoid:
- "p = probability H₀ is true." No — it is P(this-extreme data | H₀), not P(H₀ | data); the latter needs a prior.
- "1 − p = probability the effect is real." Same inversion, also wrong.
- "Small p = large or important effect." No — p blends effect size with sample size; at large scale, trivial lifts turn significant.
- "p > 0.05 = no effect." No — absence of evidence is not evidence of absence; check the confidence interval and power.
- "p = 0.03 = 3% chance it's a fluke." Same inversion again.
- Ignoring the process: peeking, testing many metrics, or slicing until something is significant inflates false positives and makes the nominal p meaningless.
4. A/B test at p = 0.03. If α = 0.05 was pre-registered for this primary metric, reject H₀ — statistically significant. Shipping is a separate judgment. Before shipping I'd ask for the effect size and confidence interval (is the lift practically meaningful?); design integrity (sample size fixed by power analysis up front? any peeking or early stopping without a sequential correction? did it run full weekly cycles?); a sample-ratio-mismatch check plus correct randomization unit; whether this was the single pre-declared primary metric or one of many (Bonferroni / Benjamini–Hochberg if many); guardrail metrics (errors, latency, fraud or chargeback rates); whether the lift is stable over time and not driven by one segment or novelty; and, for a surprising claim, replication or a holdout — p = 0.03 is weak evidence against a strong prior.
Part B — Regression with confounding
5. Reading coefficients. In Y = β₀ + Σβⱼxⱼ + ε, βⱼ is the expected difference in Y for a one-unit difference in xⱼ, with all other included features held fixed. It is a conditional association. If a confounder z is left out, omitted-variable bias applies: plim β̂ₓ = βₓ + β_z · δ, where δ is the slope of z regressed on x. Bias appears only if z affects Y (β_z ≠ 0) and is correlated with x (δ ≠ 0).
6. "Holding others constant." By Frisch–Waugh–Lovell, βⱼ is the slope of residualized Y on residualized xⱼ — it uses only variation in xⱼ that the other covariates cannot linearly explain. That reading fails when a confounder is omitted or unmeasured; when a bad control is included (adjusting for a mediator strips out part of the effect you want; adjusting for a collider opens a spurious path); when covariates carry measurement error (residual confounding); when the model is misspecified (a nonlinear confounder entered linearly is still a confounder); when overlap/positivity is poor (the comparison is extrapolation); when multicollinearity is severe (little independent variation, unstable estimates); or when reverse causality exists.
7. Associational vs causal. Associational: "Among units alike on the controls, one more unit of x goes with βⱼ more Y on average" — needs only that the model fits. Causal: "Intervening to raise x by one unit raises Y by βⱼ" — needs conditional ignorability (no unmeasured confounding given covariates), correct functional form, positivity, and no interference between units (SUTVA). The same number can support the first claim and not the second.
8. Reducing bias. Draw a DAG first: adjust for pre-treatment common causes, never for post-treatment variables or colliders. Randomize when you can. Otherwise use quasi-experimental designs — difference-in-differences with a parallel-trends check, fixed effects for time-invariant unobservables, instrumental variables, regression discontinuity, synthetic control. Design-based adjustment (propensity weighting or matching with balance and overlap checks; doubly robust AIPW, double ML) handles flexible confounding. Then probe with sensitivity analysis (E-values, Oster's δ, Cinelli–Hazlett), placebo/negative-control outcomes, and coefficient stability as controls are added.
Part C — L1 vs L2 regularization
9. Definitions. Standardize features and leave the intercept unpenalized. Ridge minimizes ‖y − Xβ‖² + λΣβⱼ², with closed form β̂ = (XᵀX + λI)⁻¹Xᵀy — it shrinks all coefficients smoothly toward zero, rarely to exactly zero. Lasso minimizes ‖y − Xβ‖² + λΣ|βⱼ|; its diamond-shaped constraint has corners on the axes, so solutions land exactly at zero, producing sparse models and automatic feature selection. (In the orthogonal case, Lasso is soft-thresholding: sign(β̂)·max(|β̂| − λ, 0).)
10. When to prefer which. Use Lasso when you want a compact, interpretable model from many candidate features, or when you believe only a few matter. It is fragile with correlated features — it picks one arbitrarily and zeroes its twins. Ridge suits many small, correlated effects (dense signals, multicollinearity); it stabilizes estimates and usually predicts well but keeps every feature. For prediction with sparsity, Elastic Net blends both and handles correlated groups better than pure Lasso. If interpretability of individual coefficients matters, remember that penalty-induced sparsity is not causal feature selection.
11. Choosing λ. Use k-fold cross-validation on a grid (log-spaced); for time series, use rolling-origin validation. Prefer one-standard-error or nested CV when you want a conservative choice. Trade-offs: larger λ means more bias and less variance, a smoother/more regularized fit but shrunken signal; small λ overfits. Standardize first so the penalty is fair across scales, and refit the chosen λ on all data for the final model. Be careful with data leakage (tune inside folds) and remember the CV-optimal λ is about prediction, not about which features are "truly" important.