Master advanced regression with 27 explained exercises on forecasting, logit, probit, dummy variables, and distributed lags.

Advanced Regression: 27 Explained Exercises

Advanced Regression: 27 Explained Exercises

ADVANCED REGRESSION • WORKED METHODS & NUMERICAL AUDIT

Advanced regression helps you forecast uncertain outcomes, estimate binary probabilities, model seasonal differences, and trace effects over time. However, the real skill lies in matching each formula to the question—and checking whether the numbers support the interpretation.

This guide works through 27 exercises, numbered 8.16–8.42 in the supplied textbook pages. It combines original explanations, recalculated examples, readable formulas, and historical data tables. Moreover, it separates results that we can reproduce from answers that rely on earlier tables outside the available pages.

Data provenance: supplied Chapter 8 pages 197–205, including Tables 8.17–8.22. The photographs do not establish a complete title, edition, or author citation. Historical figures below reproduce those classroom tables; they are not current economic statistics. All additional calculations are identified as calculations from these inputs.

Advanced regression: choose the method before the formula

A regression coefficient answers a question within a particular model. Consequently, the same number can represent a level change, an elasticity, a change in log-odds, or an immediate dynamic response. Start by identifying the outcome, the scale of each predictor, and the forecast horizon.

QuestionUseful modelMain outputCommon mistake
What might one future outcome equal?Linear regressionPoint forecast and prediction intervalReporting a mean-response interval
How likely is a binary event?Logit or probitProbability and marginal effectCalling the coefficient a probability change
Does a relationship vary by group?Indicators and interactionsIntercept or slope differencesConfusing an interaction with a level shift
Does an effect persist?Distributed lagsImmediate and cumulative effectsInterpreting the impact coefficient as the long-run effect
Does the response curve?Logs, reciprocal terms, polynomialsElasticity or changing slopeComparing R² across different response scales

Notation and units

Throughout the guide, ŷ denotes a fitted value, while y denotes an observed outcome. The symbol ℓ means log-likelihood; Λ denotes the logistic cumulative distribution function, and Φ denotes the standard normal cumulative distribution function. In addition, φ denotes the standard normal density.

For linear regression, k counts all estimated coefficients, including the intercept. Therefore, residual degrees of freedom equal n − k. A predictor entered as 15 means fifteen percentage points when the table uses percentage-point units; substituting 0.15 would change the calculation.

Forecasting and prediction intervals

A point forecast gives one central estimate. By contrast, an interval communicates uncertainty around either the conditional mean or a future individual observation. The distinction matters because a future observation includes its own unpredictable error.

Exercise 8.16: Forecasts, conditional forecasts, and forecast uncertainty

A forecast estimates an outcome using information available at the forecast origin. By contrast, a conditional forecast fixes an assumed path or value for the predictors. For example, forecasting sales under a specified advertising budget produces a conditional forecast even when the future budget has not yet become certain.

Errors come from unpredictable shocks, estimated coefficients, uncertain future predictors, and model misspecification. Moreover, structural changes can make a previously reliable relationship fail. A standard regression prediction interval handles only the uncertainty represented by its assumptions.

ŷF = b0 + b1xF
s² = Σ(yi − ŷi)² / (n − 2)  ;  Sxx = Σ(xi − x̄)²
SEmean = s √[1/n + (xF − x̄)²/Sxx]
SEprediction = s √[1 + 1/n + (xF − x̄)²/Sxx]
95% interval = ŷF ± t0.975, n−2 × relevant SE

The extra 1 inside the prediction formula represents the new observation’s error variance. Consequently, a larger sample can reduce uncertainty about the mean without eliminating individual unpredictability. Exact finite-sample t intervals require the classical normal-error model with independent, constant-variance errors and fixed or appropriately conditioned predictors.

Method reference: Penn State STAT 501: mean-response and new-response intervals.

Exercise 8.17: Recalculate two individual forecasts

The supplied inputs are ŷ = 59.13 − 2.60x, n = 15, x̄ = 11, Sxx = 442, and s² = 220.99. Therefore, the residual degrees of freedom equal 13, giving t0.975,13 ≈ 2.16037.

At xF = 15:   ŷF = 59.13 − 2.60(15) = 20.13
SEprediction = √{220.99[1 + 1/15 + 16/442]} = 15.6116
xFForecastPrediction SE95% prediction interval
1520.1315.6116−13.60 to 53.86
11.529.2315.3573−3.95 to 62.41

The second interval is slightly narrower because 11.5 lies closer to x̄. However, the new observation’s random error dominates both widths. The printed solution uses 2.18, which is not the correct critical value for 13 degrees of freedom; the table above uses the correct quantile with the stated rounded inputs.

A negative lower bound may be unsuitable when the outcome cannot fall below zero. In that case, investigate a model that respects the outcome’s support rather than silently clipping the interval and retaining the same coverage claim.

Exercise 8.18: Explain the shape of the interval bands

Both interval types reach their smallest width at xF = x̄ in simple regression. Moving away from that point increases leverage and therefore increases uncertainty. Nevertheless, the individual prediction interval remains wider than the confidence interval for the mean at every predictor value.

The chart below uses the numerical inputs from Exercise 8.17. Its shaded regions represent pointwise 95% intervals; they do not provide a 95% simultaneous guarantee for the entire curve.

2026-10-27T17:54:08.659367 image/svg+xml Matplotlib v3.10.8, https://matplotlib.org/ 2.5 5.0 7.5 10.0 12.5 15.0 17.5 20.0 Predictor X (percentage-point units) −20 0 20 40 60 80 Response Y 95% individual prediction interval 95% mean confidence interval Fitted response
Calculated pointwise intervals. The dotted line marks x̄ = 11; the curve uses the supplied rounded regression estimates.

Exercise 8.19: Multiple predictors and the covariance term

For several predictors, use the full estimated coefficient covariance matrix. This approach includes every covariance term and avoids a common expansion error.

Var̂(ŷF) = xF′ V̂(b) xF
Var̂(yF − ŷF) = s² + xF′ V̂(b) xF

The predictor vector includes its intercept entry of 1. In a centered two-predictor model, let d₁ = x₁F − x̄₁ and d₂ = x₂F − x̄₂. Under classical OLS, the centered intercept has zero covariance with the slopes, giving:

s²F = s² + Var̂(a) + d₁²Var̂(b₁) + d₂²Var̂(b₂) + 2d₁d₂Cov̂(b₁,b₂)

The supplied exercise reports d₁ = 17, d₂ = 13, s² = 1.95, Var̂(a) = 2.66, slope variances 0.06 and 0.07, and covariance −0.07. Therefore, the correctly expanded variance from those rounded inputs is:

s²F = 1.95 + 2.66 + 0.06(17²) + 0.07(13²) + 2(−0.07)(17)(13) = 2.84
ŷF = 31.98 + 0.65(35) + 1.11(25) = 82.48

Using the exercise’s rounded critical value of 2.37 gives 82.48 ± 2.37√2.84, or approximately 78.49 to 86.47. However, covariance rounding strongly affects this result because positive and negative components nearly cancel. The full-precision covariance matrix is necessary for an authoritative interval.

The printed calculation omits the factor 2 and reports variance 18.31. In addition, its stated covariance sign conflicts with its substitution. Accordingly, the reported interval 73.34–92.62 should not serve as a verified result.

Method reference: Penn State STAT 501: matrix-based multiple-regression prediction.

Binary choice models: logit and probit

Binary outcomes take values 0 and 1. Examples include whether a customer purchases, a borrower defaults, or a country receives a particular historical classification. Consequently, the fitted probability must remain between zero and one.

Exercise 8.20: Derive the binary likelihood

Let pᵢ = P(Yᵢ = 1 | xᵢ). Under conditional independence, each observation contributes pᵢ when yᵢ = 1 and 1 − pᵢ when yᵢ = 0. Multiplying those contributions gives the Bernoulli likelihood.

L(b) = ∏ pᵢyᵢ(1 − pᵢ)1−yᵢ
ℓ(b) = Σ[yᵢ ln(pᵢ) + (1 − yᵢ)ln(1 − pᵢ)]

For probit, pᵢ = Φ(xᵢ′b). In logit, pᵢ = Λ(xᵢ′b) = 1/[1 + exp(−xᵢ′b)]. Because both distributions are symmetric, an equivalent compact expression uses qᵢ = 2yᵢ − 1:

ℓprobit(b) = Σ ln Φ(qᵢxᵢ′b)  ;  ℓlogit(b) = Σ ln Λ(qᵢxᵢ′b)

Numerical software should evaluate these logarithms directly. Otherwise, extremely small probabilities may round to zero before the logarithm calculation.

Method reference: statsmodels: Logit.loglike and its symmetric formulation.

Exercise 8.21: Compare logit with probit

Both models turn a linear index into a smooth probability curve. However, logit uses a logistic distribution, while probit uses a standard normal distribution. Their latent-variable normalizations differ, so raw coefficients do not share a common scale.

FeatureLogitProbit
ProbabilityΛ(x′b)Φ(x′b)
Continuous marginal effectbⱼp(1 − p)bⱼφ(x′b)
Direct coefficient interpretationChange in log-oddsChange in normalized latent index
Error variance normalizationπ²/31
Typical practical comparisonProbabilities and marginal effectsProbabilities and marginal effects

A rough 1.6 scaling factor often aligns coefficients near the center of their probability curves. Specifically, matching slopes at zero gives φ(0)/Λ′(0) ≈ 0.39894/0.25 ≈ 1.596. Nevertheless, this local approximation does not create a universal conversion rule.

2026-10-27T17:54:08.732259 image/svg+xml Matplotlib v3.10.8, https://matplotlib.org/ 0 1000 2000 3000 4000 5000 6000 7000 Historical GDP per capita X (table units) 0.0 0.2 0.4 0.6 0.8 1.0 Probability of Y = 1 Logit: −3.605 + 0.0018X Probit: −2 + 0.001X Historical binary observations
Calculated logit and probit curves using rounded coefficients from the supplied exercises. Similar central predictions do not imply identical tails.

Exercise 8.22: Audit the probit log-likelihood grid

Hold the intercept at −2 and evaluate slopes −0.001, 0, 0.001, 0.002, and 0.003. The highest log-likelihood on this grid occurs at 0.001. However, a grid maximum only identifies the best tested value; it does not establish the unrestricted maximum-likelihood estimate.

SlopeStable calculationPrinted table
−0.001−449.4877−326.9333
0−38.0620−38.0620
0.001−6.8652−6.8651
0.002−14.9985−14.9985
0.003−36.8061−36.8047

The first discrepancy has a concrete numerical explanation. Hong Kong and Singapore have y = 1 but highly negative indices when the slope equals −0.001. Their true log-probabilities are approximately −174.43 and −110.96, whereas the table limits each contribution near −69.08, corresponding to ln(10−30).

Replacing just those two contributions with that floor produces approximately −326.93. Therefore, the published total reflects a probability floor rather than the unmodified probit likelihood. Smaller discrepancies elsewhere reflect numerical approximation or rounding.

2026-10-27T17:54:08.804761 image/svg+xml Matplotlib v3.10.8, https://matplotlib.org/ −0.0010 −0.0005 0.0000 0.0005 0.0010 0.0015 0.0020 0.0025 0.0030 Slope coefficient b₁, holding b₀ = −2 −400 −300 −200 −100 0 Probit log-likelihood
Stable probit log-likelihood calculations from the 20-country dataset. No artificial probability floor appears in this curve.

Exercise 8.23: Estimate and interpret the historical logit model

Fitting the visible 20-country observations gives an intercept of approximately −3.604995 and a slope of 0.001795768. The maximized log-likelihood equals approximately −6.766465. Consequently, the rounded index supplied in the exercise provides a close reproduction:

z = −3.6050 + 0.0018X  ;  p = 1/[1 + exp(−z)]

The coefficient 0.0018 is not a constant increase of 0.18 percentage points in probability. Instead, it changes log-odds per unit of X. For a 100-unit increase, the rounded model multiplies the odds by exp(0.18) ≈ 1.197, although the probability change still depends on the starting value.

Using the textbook’s reported standard errors gives Wald statistics of −3.6050/1.6811 ≈ −2.14 and 0.0018/0.0009 = 2.00. These asymptotic checks narrowly exceed 1.96 in absolute value. However, a sample of only 20 observations calls for caution about precision and influential observations.

Exercise 8.24: Separate coefficients, probabilities, labels, and fit statistics

A fitted probability can equal 0.61, but an observed outcome remains either 0 or 1. Next, a classification rule converts the probability into a label, such as ŷclass = 1 when p ≥ 0.50. Consequently, probability estimation and classification are distinct tasks.

For a Bernoulli variable, E(Y | X) equals P(Y = 1 | X). Therefore, a marginal effect describes a change in both the conditional mean and the success probability. By contrast, an odds ratio describes a multiplicative change in odds.

McFadden R² = 1 − ℓfitted/ℓnull

McFadden’s pseudo-R² compares log-likelihoods; it does not measure the percentage of outcome variance explained. Under an unpenalized maximum-likelihood fit that nests the intercept-only model, it lies between zero and one in the usual nondegenerate case. Nevertheless, poorly optimized or noncomparable fits need not obey that interpretation.

Exercise 8.25: Compute marginal effects and all country probabilities

Using the rounded model, the mean predictor equals 3,469.5 and its fitted probability is about 0.9334. Therefore, the marginal effect at the mean differs substantially from the average of the individual marginal effects.

ME(X) = 0.0018 × p(X)[1 − p(X)]
MEM = ME(3,469.5) ≈ 0.00011190
AME = (1/20)ΣME(Xᵢ) ≈ 0.00019368

A local 100-unit increase near the mean corresponds to about 1.12 percentage points under the derivative approximation. In comparison, averaging the local derivatives across observations gives about 1.94 percentage points per 100 units. For an actual finite change, calculate p(X + 100) − p(X) instead of treating the derivative approximation as exact.

The intercept-only model assigns probability 0.5 because the sample contains ten ones and ten zeros. Thus, ℓnull = 20 ln(0.5) ≈ −13.862944, and McFadden R² ≈ 0.5119. The likelihood-ratio statistic is 2(−6.766465 + 13.862944) ≈ 14.1930, which is a different quantity from pseudo-R².

Historical classroom data; probabilities use z = −3.6050 + 0.0018X. Values displayed as 1.0000 are rounded, not exactly one.
CountryXObserved YPredicted probabilityClass at 0.50
Burundi56900.07040
Chad40800.05360
Congo2,24000.60521
Egypt1,86900.44010
Hong Kong16,47111.00001
India1,28200.21460
Indonesia2,10210.54451
Ivory Coast1,10400.16550
Kenya91400.12350
Malaysia5,74610.99881
Morocco2,17310.57601
Nigeria97800.13650
Rwanda76200.09680
Singapore12,65311.00001
South Africa3,06810.87181
Tunisia3,07510.87321
Uganda54710.06780
Uruguay5,18510.99681
Venezuela7,08210.99991
Zimbabwe1,16200.18040
Confusion matrix at the 0.50 threshold
Actual outcomePredicted 0Predicted 1
091
119

The model correctly classifies 18 of 20 observations, or 90%, in the same sample used for estimation. Congo supplies the false positive, while Uganda supplies the false negative. However, this is training accuracy, not evidence of 90% accuracy on new countries or future periods.

In this balanced sample, sensitivity, specificity, and precision also equal 90%. Furthermore, the majority-class baseline achieves only 50%. A proper assessment would still examine held-out performance, calibration, and the consequences of each error type.

Method reference: statsmodels: marginal effects at the mean, averaged effects, and discrete changes.

Functional forms: transformations and interpretation

A model can curve in X while remaining linear in its unknown coefficients. Consequently, ordinary least squares can estimate many nonlinear-looking relationships after constructing appropriate regressors. The error structure still matters, especially when transforming the dependent variable.

Exercise 8.26: Turn nonlinear-looking functions into regression forms

Original formRegressor or transformationImportant condition
Y = b₀ exp(b₁X + u)ln Y = ln b₀ + b₁X + uY > 0 and b₀ > 0
Y = b₀ + b₁ ln X + uR = ln X; regress Y on 1 and RX > 0
Y = b₀ − b₁/X + uZ = 1/X; regress Y on 1 and ZX ≠ 0; coefficient on Z is −b₁
Y = b₀ + b₁X − b₂X² + b₃X³ + uUse X, X², and X³Linear in coefficients, cubic in X

Logging an additive-error equation does not automatically produce the first model. For example, ln[b₀ exp(b₁X) + u] does not simplify to ln b₀ + b₁X + u. Therefore, specify whether the original disturbance is additive or multiplicative before choosing the transformation.

Exercise 8.27: Interpret a double-log relationship

The printed answer gives ln Ŷ = 2.64 + 0.72 ln X, with R² = 83.26% on the log-outcome scale. Its slope is an elasticity: a small 1% increase in X corresponds to approximately a 0.72% increase in the fitted outcome.

For a 10% rise in X:   change = [1.100.72 − 1] × 100 ≈ 7.10%

Exponentiating the fitted log outcome does not generally recover the conditional arithmetic mean. Under a normal log-error model, a mean forecast needs the appropriate variance correction; alternative error distributions require a suitable retransformation method. Moreover, the earlier raw data in Table 6.12 are absent, so this section interprets the printed fit rather than independently reproducing it.

Method reference: Hyndman and Athanasopoulos: back-transformation and bias adjustment.

Exercise 8.28: Interpret a level-log relationship

The supplied fit is Ŷ = 2.62 + 27.12 ln X, with R² = 81.29%. Because Y remains in levels, a 1% increase in X changes the fitted response by approximately 0.2712 units.

Exact change for a 10% increase:   ΔŶ = 27.12 ln(1.10) ≈ 2.5848 units

The effect per unit of X equals 27.12/X, so it falls as X rises. Accordingly, this model describes diminishing level changes without requiring a turning point. As in Exercise 8.27, the missing Table 6.12 prevents an independent coefficient refit.

Exercise 8.29: Interpret the polynomial and compare fit fairly

The reported polynomial is Ŷ = −2.25 + 13.67X − 0.77X². Its slope changes with X, rather than remaining equal to 13.67.

dŶ/dX = 13.67 − 1.54X  ;  turning point = 13.67/1.54 ≈ 8.88

The negative squared term creates a maximum at approximately X = 8.88. However, that turning point has practical meaning only if the observed range and the subject matter support it.

The printed R² is 80.75%, compared with 81.29% for the level-log model. If both use identical observations and Y in levels, the level-log model has the higher raw R² and fewer coefficients. By contrast, the double-log R² of 83.26% uses ln Y, so it cannot establish superiority on the original Y scale.

For forecasting, compare predictions on a common scale with a common validation sample. Furthermore, examine residual patterns and whether the model extrapolates plausibly. Table 6.12 and the earlier linear-model results are unavailable, so the full original model ranking cannot be independently verified here.

Dummy variables, interactions, and seasonal effects

An indicator distinguishes groups using values zero and one. By comparison, an interaction multiplies that indicator by another predictor, allowing the slope to differ. Therefore, the coefficient on an indicator and the coefficient on its interaction answer different questions.

Exercise 8.30: Find the peacetime and wartime slopes

The reported model is Ŷ = −2.89 + 0.17X − 0.11XD, where D = 1 in wartime. Substituting the indicator gives:

PeriodEquationSlope
Peacetime: D = 0Ŷ = −2.89 + 0.17X0.17
Wartime: D = 1Ŷ = −2.89 + 0.06X0.06

The slope difference is −0.11. Moreover, the reported interaction t statistic of −7.56 indicates strong evidence of a difference under the model’s conventional test assumptions. The underlying Table 8.2 is not visible, so this conclusion uses the reported regression output.

Exercise 8.31: Allow both the intercept and the slope to change

The expanded reported model is Ŷ = −3.34 + 0.17X + 14.59D − 0.18XD. Therefore, peacetime has intercept −3.34 and slope 0.17, while wartime has intercept 11.25 and slope −0.01.

The reported t statistics for the intercept difference and slope difference are 0.67 and −1.64. At a conventional two-sided 5% level, neither provides sufficient evidence individually. However, this does not prove identical relationships, and a joint test of both terms requires their covariance information.

Centering X at a meaningful value can improve interpretation. In particular, the indicator coefficient would then compare the groups at that value rather than at X = 0. The predicted relationships remain unchanged after a consistent reparameterization.

Method reference: Penn State STAT 501: categorical predictors and interactions.

Exercise 8.32: Model quarterly reserves with a trend

The visible data contain 23 quarters from 1995 Q1 through 2000 Q3, measured in millions of dollars. Let T run from 1 to 23 and omit Q1 from the seasonal indicators. Then estimate R = a + bT + c₂D₂ + c₃D₃ + c₄D₄ + u.

Table 8.19 transcription; the supplied page credits the Federal Reserve Board of Governors.
YearQ1Q2Q3Q4
199557,57157,03157,16257,896
199654,87853,74251,04551,174
199747,55146,60646,06047,919
199845,59145,09444,19945,209
199943,22942,33141,31441,655
200039,75239,21739,257Not supplied

An OLS refit of these displayed values gives:

R̂ = 57,957.71 − 896.58T + 138.08D₂ + 203.99D₃ + 1,571.85D₄

The refitted R² is approximately 0.95835. Meanwhile, the trend t statistic is about −20.15, while the Q2, Q3, and Q4 statistics are 0.17, 0.25, and 1.84. Thus, at the exercise’s 10% two-sided level with 18 residual degrees of freedom, Q4 crosses the conventional threshold but Q2 and Q3 do not.

The unrestricted quarter-specific intercepts are 57,957.71, 58,095.79, 58,161.71, and 59,529.56. These values refer to the intercept at T = 0; they are not forecasts for any actual quarter without adding the trend term. In addition, a nonsignificant coefficient remains part of the fitted model until an explicit refit removes it.

The printed answer gives different coefficients, including a trend of −956.30 and R² = 0.98. Those values do not reproduce from the visible table under the stated trend coding. Accordingly, this guide reports the transparent refit and treats the printed discrepancy as unresolved.

Exercise 8.33: Interpret regional intercepts correctly

The reported model uses South Atlantic states as the baseline: Ŷ = 8.16 + 0.56X + 0.88DNE + 2.83DMA. Here, Y measures disposable income in thousands of dollars and X measures the percentage of adults with a college degree.

RegionIntercept in the reported unrestricted modelSlope on X
South Atlantic8.160.56
New England9.040.56
Mid-Atlantic10.990.56

Holding X constant, the model associates Mid-Atlantic membership with $2,830 higher disposable income than the baseline. Similarly, the fitted New England difference is $880, even though its reported t statistic of 0.79 does not establish significance at 10%.

The printed answer assigns New England the baseline intercept after dismissing its nonsignificant dummy. However, insignificance does not change an estimated coefficient to zero. If you remove that term and refit, the other estimates can also change.

This is an observational regional association. Consequently, the coefficient on educational attainment does not by itself identify the causal income effect of earning a degree.

Distributed lag models: effects that unfold over time

Some economic responses take several periods. For instance, a utility company may adjust its investment gradually after demand rises. A distributed lag model represents that delayed adjustment through current and past predictor values.

Exercise 8.34: Compare unrestricted, Koyck, and Almon lags

Yt = α + β₀Xt + β₁Xt−1 + … + βqXt−q + ut

An unrestricted q-lag model loses the first q usable observations unless earlier predictor values are available. Moreover, adjacent lagged predictors often correlate strongly, which makes individual lag coefficients imprecise.

The Koyck approach imposes geometric weights βⱼ = βλʲ. This restriction saves parameters but forces a particular response pattern. Under the classical infinite-lag derivation, the transformed disturbance ut − λut−1 correlates with lagged Y, so naive OLS can be inconsistent.

An Almon model instead imposes a polynomial on the lag coefficients. Consequently, it permits more flexible shapes while retaining fewer parameters than a fully unrestricted long lag. However, the polynomial degree, maximum lag, and endpoint restrictions require explicit choices.

Exercise 8.35: Recover Koyck parameters and distinguish printed from refitted results

The printed rounded equation is Ŷt = −1.92 + 0.01Xt + 0.40Yt−1. Conditional on that equation, λ = 0.40 and the original infinite-lag intercept is:

α = −1.92/(1 − 0.40) = −3.20
Immediate effect = 0.01  ;  long-run multiplier = 0.01/(1 − 0.40) ≈ 0.01667
Mean lag = λ/(1 − λ) = 0.40/0.60 ≈ 0.667 periods

These identities follow from the supplied rounded coefficients. However, an OLS refit of the visible Table 8.21, using 1961–1979 and one lag of Y, produces approximately:

Ŷt = −1.35759 + 0.0055368Xt + 0.732027Yt−1

Its R² is about 0.99402. The implied descriptive long-run multiplier is approximately 0.02066, and its mean lag is about 2.73 periods. Therefore, these results do not support silently treating the printed 0.40 lag coefficient as a verified refit of the displayed data.

Neither calculation alone resolves the endogeneity issue in the classical Koyck derivation. Furthermore, trending nominal series can produce a high R² even when a model lacks reliable forecasting or causal interpretation.

2026-10-27T17:54:08.894330 image/svg+xml Matplotlib v3.10.8, https://matplotlib.org/ 0 1 2 3 4 5 6 7 Lag j 0.000 0.002 0.004 0.006 0.008 0.010 Weight: 0.01 × 0.40ʲ
Illustration of the geometric weights implied by the printed coefficients, not by the refitted regression. The current-period response dominates when λ = 0.40.

Exercise 8.36: Estimate a quadratic Almon lag

For current income and three lagged income terms, impose βⱼ = a₀ + a₁j + a₂j² for j = 0, 1, 2, 3. Construct three transformed predictors:

Z₀t = Σj=0…3Xt−j  ;  Z₁t = Σj=0…3jXt−j  ;  Z₂t = Σj=0…3j²Xt−j
Yt = α + a₀Z₀t + a₁Z₁t + a₂Z₂t + ut

A refit of the visible 1960–1979 consumption and income table uses 17 observations after the three initial lags. Without extra endpoint restrictions, it gives α ≈ −32.54973, a₀ ≈ 0.762362, a₁ ≈ −1.126135, and a₂ ≈ 0.338141.

Lag jRecovered coefficient βj
00.762362
1−0.025631
2−0.137343
30.427228

The resulting R² is approximately 0.99933, and the sum of the four lag weights is about 1.02662. However, strong fit in trending nominal levels does not establish a stable long-run economic relationship. The negative middle weights also deserve substantive and statistical examination.

A quadratic Almon model also provides a useful internal consistency check on its four recovered weights. Specifically, quadratic weights require β₃ − 3β₂ + 3β₁ − β₀ = 0. Its displayed values yield 0.04 − 3(0.14) + 3(0.77) − 1.94 = −0.01, which could reflect rounding; nevertheless, its large reported contemporaneous coefficient and low printed R² do not match the refit above.

Only one significant individual lag coefficient would not prove poor overall fit. Instead, evaluate the joint restrictions, residual behavior, lag plausibility, and performance on future observations. Alternative endpoint restrictions or different data could change the estimates, but they must be stated explicitly.

Method reference: Hyndman and Athanasopoulos: time-series regression, distributed lags, and spurious regression.

Further forecasting and binary-choice exercises

The final exercises reinforce the same distinction between substitution, estimation, and interpretation. Some refer to earlier examples that the photographs do not include. Accordingly, the following solutions identify what the available information can support.

Exercise 8.37: Interpret a forecast with incomplete supporting inputs

The printed answer gives forecast variance approximately 1.19, a point forecast of 4.78, and a 95% interval of 4.78 ± 2.43. Therefore, the stated interval endpoints are 2.35 and 7.21.

The corresponding standard error is √1.19 ≈ 1.091. Its implied critical multiplier is about 2.23, which is plausible for a small-sample t interval. However, Problem 6.44 is absent, so the original forecast, variance calculation, and degrees of freedom cannot be independently verified.

Exercise 8.38: Identify a forecast inconsistency before using an interval

The displayed equation is Ŷ = 82.27 − 5.11X₁ + 0.02X₂. At X₁ = 2 and X₂ = 1,250, direct substitution gives:

Ŷ = 82.27 − 5.11(2) + 0.02(1,250) = 97.05

The page reports forecast variance 468.61, so the reported standard error is approximately 21.65. Using its rounded multiplier 2.18 gives an interval near 49.85 to 144.25.

However, the original regression output and its full covariance matrix are absent. The rounded slope variance for X₂ can dominate the result when multiplied by (1,250 − 1,100)². Consequently, the displayed variance should remain a reported textbook value rather than a verified precision estimate.

A reliable recomputation would use xF′V̂(b)xF and the exact residual degrees of freedom. Moreover, it should distinguish a future individual response from a conditional mean before adding the residual variance.

Exercise 8.39: Evaluate logit likelihood at three slopes

Fix b₀ = −3.6 and use the same 20-country observations. A stable calculation evaluates the negative sum of log[1 + exp(−qᵢzᵢ)] without first rounding probabilities.

SlopeRecalculated log-likelihoodPrinted answer
0−36.5391−36.59
0.001−9.6810−9.70
0.002−6.9186−6.91

Among these three candidates, slope 0.002 gives the best likelihood. However, the unrestricted fitted slope near 0.00179577 performs slightly better. The printed numbers are not exact evaluations of the displayed parameter combinations.

Exercise 8.40: Evaluate logit likelihood at three intercepts

Now fix b₁ = 0.0018. Holding one parameter constant makes the comparison easy to interpret, but it does not reoptimize the other coefficient at each point.

InterceptRecalculated log-likelihood
−3.8−6.803885
−3.6−6.766637
−3.4−6.815540

The best of these three intercepts is −3.6. Accordingly, the result agrees closely with the fitted intercept of −3.604995. These are conditional likelihood evaluations, not a profile likelihood, because the slope remains fixed rather than reestimated.

Exercise 8.41: Explain why logit and probit coefficients differ

No rule requires equal coefficients. The latent-variable scales differ, and the two cumulative distribution functions have different shapes. Therefore, compare fitted probabilities or effects on the probability scale before comparing raw coefficient magnitudes.

For the visible dataset, the independently optimized probit coefficients are approximately −1.99418 and 0.00100350. The logit slope divided by the probit slope is roughly 1.79, not exactly 1.6. Thus, this dataset itself illustrates the limitations of a universal scaling shortcut.

Exercise 8.42: Explain when marginal effects can look similar

Logit and probit can produce close marginal effects when they fit similar probability curves over the observed predictor range. However, equality is not guaranteed, particularly in the tails or under model misspecification.

Logit MEⱼ = bⱼΛ(z)[1 − Λ(z)]  ;  Probit MEⱼ = bⱼφ(z)

For a binary predictor, compute a discrete probability difference between values zero and one. In addition, report whether an effect represents a particular observation, a representative predictor profile, or an average over the sample. Those choices can matter more than the choice between logit and probit.

Numerical audit: what ordinary summaries often miss

A useful worked solution should explain discrepancies rather than repeat an answer key. The following checks make the calculations transparent and help prevent errors from spreading into reports, exams, or published articles.

IssueWhat the audit foundPractical lesson
Critical value, 8.17t(0.975,13) ≈ 2.16037, not 2.18Use exact degrees of freedom
Covariance expansion, 8.19Cross-product needs 2Cov(b₁,b₂)d₁d₂Prefer the full covariance matrix
Extreme probit likelihood, 8.22Two probability floors explain the largest discrepancyCompute log-CDF directly
Marginal effects, 8.25MEM ≈ 0.00011190; AME ≈ 0.00019368Label the averaging convention
Seasonal refit, 8.32Visible table yields a different trend and R²Check data transcription and coding
Regional intercepts, 8.33Nonsignificance does not erase the estimated coefficientDistinguish an unrestricted fit from a refit
Lag estimates, 8.35–8.36Visible tables do not reproduce the displayed answersReport the estimator and restrictions
Model comparison, 8.29R² changes meaning when Y becomes ln YEvaluate on a common response scale

How these calculations were checked

The numerical audit transcribed the visible country, reserve, utility-investment, and consumption tables. It then used stable log-probability functions, numerical likelihood optimization, and least-squares refits. Reported results retain more precision internally than the formatted article displays.

The binary-model audit optimized the intercept and slope jointly after rescaling the predictor for numerical stability. Meanwhile, the lag-regression calculations use only complete observations and explicitly include an intercept. Nevertheless, the photographs provide historical rounded data, so these calculations verify the transcribed tables rather than an unavailable original digital dataset.

Reproduce the most consequential binary-model checks

The following Python example needs NumPy and SciPy. It reproduces the probability table, MEM, AME, and probit likelihood grid without downloading additional data.

import numpy as np
from scipy.special import expit
from scipy.stats import norm, t

x = np.array([569,408,2240,1869,16471,1282,2102,1104,914,5746,
              2173,978,762,12653,3068,3075,547,5185,7082,1162])
y = np.array([0,0,0,0,1,0,1,0,0,1,1,0,0,1,1,1,1,1,1,0])
z = -3.605 + 0.0018*x
p = expit(z)
q = 2*y - 1
loglike = -np.logaddexp(0, -q*z).sum()
p_at_mean = expit(-3.605 + 0.0018*x.mean())
mem = 0.0018*p_at_mean*(1-p_at_mean)
ame = np.mean(0.0018*p*(1-p))
print("probabilities:", p)
print("log-likelihood, MEM, AME:", loglike, mem, ame)
for slope in [-0.001, 0, 0.001, 0.002, 0.003]:
    print("probit grid:", slope,
          norm.logcdf(q*(-2 + slope*x)).sum())
print("correct t critical value:", t.ppf(0.975, df=13))

Historical data behind the lag-model refits

The table below preserves all 20 annual observations used in the two lag-model checks. Utility investment and GNP belong to the Koyck exercise, while consumption and disposable income belong to the Almon exercise. Although each series uses billions of dollars, the columns represent different economic quantities.

Transcription of Tables 8.21–8.22. The supplied pages credit the Economic Report of the President, 1980, pages 203, 255, and 229. These are historical classroom inputs, not revised modern series.
YearUtility investment YGNP XConsumption YDisposable income X
19605.2506.0324.9349.4
19615.0523.3335.9362.9
19624.9563.8355.2383.9
19635.0594.7374.6402.8
19645.5635.7400.4437.0
19656.3688.1430.2472.2
19667.4753.0464.8510.4
19678.7796.3490.4544.5
196810.2868.5535.9588.1
196911.6935.5579.7630.4
197013.1982.4618.8685.9
197115.31,063.4668.2742.8
197217.01,171.1733.0801.3
197318.71,306.6809.9901.7
197420.61,412.9889.6984.6
197520.11,528.8979.11,086.7
197622.31,702.21,089.91,184.5
197725.81,899.51,210.01,305.1
197829.52,127.61,350.81,458.4
197933.22,368.51,509.81,623.2

For the Koyck refit, regress utility investment from 1961 onward on an intercept, contemporaneous GNP, and the previous year’s utility investment. By comparison, for the Almon refit, start in 1963 and construct the three polynomial lag sums from current disposable income and its three prior values. Consequently, the first model uses 19 observations and the second uses 17.

The following continuation uses the table’s consumption and income values. It applies no endpoint restrictions; therefore, another Almon implementation may legitimately differ if it imposes such restrictions explicitly.

# Refit the quadratic Almon specification with NumPy.
consumption = np.array([
    324.9,335.9,355.2,374.6,400.4,430.2,464.8,490.4,535.9,579.7,
    618.8,668.2,733.0,809.9,889.6,979.1,1089.9,1210,1350.8,1509.8])
income = np.array([
    349.4,362.9,383.9,402.8,437,472.2,510.4,544.5,588.1,630.4,
    685.9,742.8,801.3,901.7,984.6,1086.7,1184.5,1305.1,1458.4,1623.2])
lags = np.column_stack([income[3-j:20-j] for j in range(4)])
j = np.arange(4)
weights_map = np.column_stack([np.ones(4), j, j**2])
Z = lags @ weights_map
A = np.column_stack([np.ones(17), Z])
coef = np.linalg.lstsq(A, consumption[3:], rcond=None)[0]
lag_weights = weights_map @ coef[1:]
residuals = consumption[3:] - A @ coef
r_squared = 1 - (residuals @ residuals) / np.sum(
    (consumption[3:] - consumption[3:].mean())**2)
print("intercept and polynomial parameters:", coef)
print("recovered lag coefficients:", lag_weights)
print("R-squared:", r_squared)

A practical advanced regression workflow

  1. Define the target. Decide whether you need a mean, an individual future outcome, a probability, or a causal effect.
  2. Record units. State whether money uses dollars, thousands, or billions, and whether rates use fractions or percentage points.
  3. Choose the information set. For forecasting, exclude predictors unavailable at the forecast origin.
  4. State the specification. Identify transformations, baseline categories, lag lengths, and restrictions.
  5. Check numerical stability. Inspect rank, conditioning, convergence, and extreme fitted probabilities.
  6. Evaluate assumptions. Investigate heteroskedasticity, serial correlation, influential observations, and structural breaks as appropriate.
  7. Validate outside the estimation sample. Use time-ordered validation for time-series forecasts.
  8. Communicate uncertainty. Label intervals, marginal-effect conventions, and unresolved data limitations.

Complete or quasi-complete separation can prevent finite maximum-likelihood estimates in binary models. Moreover, a numerical convergence message alone does not establish that every parameter behaves well. The statsmodels pitfalls documentation discusses these identification and convergence issues.

Frequently asked questions about advanced regression

Is a prediction interval the same as a confidence interval?

No. A confidence interval for the conditional mean quantifies uncertainty about the average response at specified predictors. By contrast, an individual prediction interval also includes the new observation’s random variation, so it is wider under the same model and confidence level.

Does a high R² mean the model forecasts well?

Not necessarily. A flexible model can fit historical observations closely while performing poorly on future data. In addition, common trends can create impressive fit statistics without a stable predictive relationship.

Can I compare logit and OLS R² values directly?

No. Conventional OLS R² and McFadden pseudo-R² summarize different objects. Therefore, use prediction quality on an appropriate common target when comparing alternative approaches to the same task.

Why does the average marginal effect differ from the effect at the mean?

The probability transformation is nonlinear. Consequently, evaluating one derivative at the average predictor generally differs from averaging derivatives across all predictor values. The country example produces an AME about 73% larger than the MEM using the rounded model.

Should a nonsignificant dummy coefficient become zero?

No. Its estimate remains part of the unrestricted fitted model. If you choose a restricted model without that term, refit the regression and report the new specification rather than manually changing just one coefficient.

Does a negative lag coefficient prove the theory is wrong?

Not by itself. Correlated lags, small samples, misspecification, and imposed restrictions can generate unstable individual coefficients. However, a counterintuitive lag pattern deserves investigation through joint tests, substantive reasoning, and external validation.

Which model is better, logit or probit?

Neither wins universally. Compare the models using the purpose of the analysis, probability calibration, predictive performance, and interpretability. Moreover, check whether differences actually matter over the range of observations that supports your decision.

Conclusion: make the interpretation as rigorous as the calculation

Advanced regression becomes more useful when every number connects to a clearly defined question. Forecast intervals require the right uncertainty target, binary models require probability-scale interpretation, and dynamic regressions require a distinction between immediate and cumulative effects.

The 27 exercises also show why verification matters. Correcting a critical value, preserving covariance terms, and computing extreme probabilities accurately can change an answer even when the formula appears familiar. Therefore, combine transparent calculations with explicit assumptions before treating a regression result as evidence.

Sources and further reading

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *