Two examples run through the same steps: a dense technical topic and an applied business case. The steps follow the card-making instructions Claude uses; the search, the checks, the approval and the write are done by the server against a practice collection. The model's answers were recorded once and replay here, so this runs without an API key.
What you hand over: notes, a chapter, a case.
# Lecture notes: heteroskedasticity in linear regression
**Setting.** In the linear model \(y = X\beta + u\), ordinary least squares (OLS) gives
\(\hat{\beta} = (X'X)^{-1}X'y\). Unbiasedness needs only exogeneity, \(E[u \mid X] = 0\). The usual formula for the
variance of \(\hat{\beta}\), \(\sigma^2 (X'X)^{-1}\), needs one more assumption: homoskedasticity, a constant error
variance, \(Var(u_i \mid X) = \sigma^2\) for every observation.
**What heteroskedasticity is.** The error variance changes with the regressors. Typical case: in a regression of
household spending on income, spending varies much more among high-income households than among low-income ones.
**What it breaks, and what it does not.**
- OLS stays unbiased and consistent (exogeneity still holds).
- The usual standard errors are wrong, so t-tests and confidence intervals are invalid; in the spending example
they are usually too small, so we reject the null too often.
- OLS is no longer efficient: the Gauss-Markov theorem needs homoskedasticity, so OLS is not BLUE (best linear
unbiased estimator) any more.
**How to detect it.**
- Plot the residuals against the fitted values: a funnel shape is the classic sign.
- Breusch-Pagan test: regress the squared residuals on the regressors; under the null of homoskedasticity,
\(nR^2\) from that auxiliary regression follows a chi-squared distribution with k degrees of freedom.
- White test: same idea, adding squares and cross-products of the regressors, so it also catches non-linear
forms, at the cost of many degrees of freedom.
**What to do.**
1. Keep OLS and use heteroskedasticity-robust standard errors (White, 1980). The "sandwich" estimator replaces
\(\sigma^2 X'X\) in the middle by \(\sum_i \hat{u}_i^2 x_i x_i'\). Valid in large samples whatever the form of
heteroskedasticity. This is the default in applied work.
2. Weighted least squares (WLS): if the form of the variance is known, e.g. \(Var(u_i \mid x_i) = \sigma^2 h(x_i)\),
divide each observation by \(\sqrt{h(x_i)}\); the transformed model is homoskedastic and WLS is efficient.
If \(h\) is estimated (feasible GLS), efficiency holds only asymptotically and a wrong \(h\) can hurt.
3. Transform the variable: logs often reduce heteroskedasticity in money variables.
**Questions raised in class.**
- Q: If the coefficients are still unbiased, why care? A: because inference is what we report; a wrong standard
error turns a noisy estimate into a "significant" one.
- Q: Should robust standard errors always be used? A: in large samples they cost little; in small samples they can
be biased downward, so small-sample corrections (HC2, HC3) are preferred.
- Open: when exactly does WLS with an estimated variance function beat OLS with robust errors in practice?
# Case notes: unit economics of a subscription box (fictitious company) **The company.** Northwind Coffee Club sells a monthly coffee subscription at $30. Cost of goods and shipping per box is $18, so the contribution margin is $12 per subscriber per month (40%). Customers are acquired mostly through paid social ads. **The numbers the team tracks.** - Customer acquisition cost (CAC): marketing spend divided by new subscribers in the same period. Last quarter: $90,000 spent, 1,500 new subscribers → CAC of $60. - Monthly churn: share of subscribers who cancel each month. Currently 8%. - Expected lifetime in months ≈ 1 / churn → about 12.5 months at 8%. - Lifetime value (LTV), on margin, not revenue: $12 × 12.5 ≈ $150. - LTV / CAC ≈ 2.5. A common rule of thumb asks for at least 3 before scaling paid acquisition. - CAC payback: months of margin needed to recover CAC = $60 / $12 = 5 months. **The decision on the table.** Marketing wants to double ad spend. Two problems: (1) CAC usually rises as spend grows, because the cheapest audiences are reached first; (2) at 8% churn, LTV/CAC is already below the target. **Levers discussed.** - Reduce churn: an annual plan paid upfront with a discount; a "skip a month" button instead of cancel. Cutting churn from 8% to 6% raises expected lifetime to about 16.7 months and LTV to about $200. - Raise margin: a price increase to $33 for new subscribers, tested on a share of traffic first. - Measure CAC by channel and cohort, not blended: a blended CAC hides an expensive channel behind a cheap one. **Pitfalls the mentor pointed out.** - LTV computed on revenue instead of margin overstates value by 2.5× here. - Churn in the first month is usually much higher than later; one average churn rate hides it, so look at cohort retention curves. - Payback matters for cash: a 5-month payback means each new subscriber is a cash outflow for 5 months, so fast growth burns cash even when LTV/CAC looks fine. **Open question.** Is the annual plan's discount worth the lower margin, given that it also brings the cash forward?
What was learned and what was asked, grouped by theme.
The collection is searched first; only what is missing gets planned.
Heteroskedasticity (Var(u|x) varies with x) -> OLS still unbiased and consistent (exogeneity holds) -> standard errors wrong -> t-tests and CIs invalid -> OLS not BLUE, efficiency lost -> detect with residual plot, Breusch-Pagan (nR^2 ~ chi2(k)), White (adds squares and cross-products) -> remedies: keep OLS with robust sandwich SE (large-sample default; HC2/HC3 in small samples) or change the estimator: WLS with known h(x) (divide by sqrt(h)) or FGLS with estimated h (efficient only asymptotically, can hurt if h is misspecified) -> log transform as a possible fix of the variance pattern (mention only).
| Concept | Verdict | Existing card / reason |
|---|---|---|
| OLS stays unbiased and consistent | ALREADY HAVE | Econometrics: OLS Why is exogeneity decisive for reading \(\hat{\beta}\) as unbiased? |
| Standard errors are wrong | GAP | No card covers why sigma^2(X'X)^-1 fails under heteroskedasticity and why tests over-reject. |
| OLS loses efficiency | GAP | Existing Gauss-Markov card asks for the conditions; the consequence (OLS not BLUE under heteroskedasticity) is the missing layer. |
| Residuals against fitted values | OUT OF SCOPE | Single-sentence mention (funnel shape) with no marker or correction; folded into the Breusch-Pagan card context only if needed. |
| Breusch-Pagan test | GAP | Marked APPLIED; no card on the auxiliary regression and the nR^2 chi-squared(k) statistic. |
| White test | GAP | No card on the squares and cross-products auxiliary regression and its degrees-of-freedom trade-off. |
| Robust standard errors (sandwich estimator) | GAP | Marked VERIFY; no card on the sandwich form and its large-sample validity. |
| Weighted least squares with known variance form | GAP | No card on dividing by sqrt(h(x)) and why WLS is efficient. |
| Feasible GLS with estimated h | GAP | No card on asymptotic-only efficiency and the risk of misspecifying h. |
| Log transformation | OUT OF SCOPE | One-line mention with no marker or correction; not a concept that needs its own card. |
| Small-sample corrections HC2 and HC3 | GAP | Merged into the doubt card on robust errors (its resolution); no separate card, so no extra count. |
| Doubt: If the coefficients are still unbiased, why care? | GAP | Doubt becomes a direct card; no existing card links bias of estimates to wrong inference. |
| Doubt: Should robust standard errors always be used? | GAP | Doubt becomes a direct card; existing cards do not cover the small-sample bias of robust SE or HC2/HC3. |
| Open doubt: When exactly does WLS with an estimated variance function beat OLS with robust errors in practice? | GAP | Open doubt becomes a direct card kept verbatim, answer left for the user to resolve. |
Price and cost -> contribution margin per subscriber -> LTV on margin (lifetime = 1/churn) -> CAC (same-period spend / new subscribers) -> payback = CAC / monthly margin -> LTV/CAC vs 3 with cash timing -> decision: double ad spend (CAC rises with spend, LTV/CAC already below 3) -> levers: churn (annual plan, skip month), margin (price to $33), measurement (CAC by channel and cohort). Pitfall: revenue instead of margin overstates LTV 2.5x.
| Concept | Verdict | Existing card / reason |
|---|---|---|
| Contribution margin | GAP | No card covers $30 price minus $18 cost = $12 margin (40%) as the value basis. Planned as card 1. |
| CAC | ALREADY HAVE | Business: metrics How is customer acquisition cost calculated? |
| LTV on margin | GAP | No card for margin x lifetime = $12 x 12.5 = $150. Planned as card 2, which also carries churn sensitivity (8% to 6%, 16.7 months, about $200). |
| LTV/CAC target | GAP | VERIFY marker: 2.5 here versus rule-of-thumb minimum 3 before scaling paid acquisition. No card. Planned as card 4 together with payback. |
| CAC payback | GAP | No card for $60 / $12 = 5 months and the cash outflow during those months. Planned as card 3. |
| Expected lifetime | GAP | REVERSE marker: lifetime is about 1/churn (12.5 months at 8%). No card. Planned as card 5, run in both directions. |
| Churn sensitivity | GAP | Cutting churn 8% to 6% raises lifetime to 16.7 months and LTV to about $200. Folded into card 2. |
| First-month churn | GAP | A single average churn rate hides early drop-off. Planned as card 6 with cohort curves. |
| Cohort retention curves | GAP | No card on building retention by signup cohort. Planned as card 6. |
| Revenue instead of margin pitfall | GAP | APPLIED marker: LTV on revenue overstates value 2.5x (30/12). No card. Planned as card 7. |
| Fast growth burns cash | GAP | Search returned only an unrelated discount-rate card (score 0.23). Planned as card 4, with LTV/CAC and payback read together. |
| CAC by channel and cohort | GAP | APPLIED marker: a blended CAC hides an expensive channel behind a cheap one. No card. Planned as card 8. |
| Price test on a traffic share | GAP | Price rise to $33 tested on part of traffic is a margin lever. Deferred: over the 10-card cap, first in the next batch. |
| Northwind decision: double ad spend | GAP | No decision card on doubling paid ads when CAC rises with spend and LTV/CAC is below 3. Planned as card 9. |
| Levers on the table | GAP | Churn levers (annual plan, skip-a-month), price rise and measurement have no card as a set. Covered by card 9; the price lever is deferred and the annual plan lever is in card 10. |
| Open doubt: annual plan discount vs lower margin and cash forward | GAP | Doubt must end as a card, kept verbatim. Planned as card 10 with the doubt as front; the resolution stays open until the user supplies it. |
Three layers, each within its size limit; questions that do not give the answer away.
A dry run: duplicates skipped, similar cards cited, tags and sizes checked.
Nothing is written until you click. The model cannot approve for you.
Add 10 note(s) to “Statistics”
Add 10 note(s) to “Business”
Written, read back and compared; large cards get a blue flag.