Lawfare Academy

Regression Analysis for Business · Chapter 3 of 8

Sampling uncertainty, contrasts and prediction intervals

Return to the linked course unit →

DEVELOPED COURSE TEXT

Sampling uncertainty, contrasts and prediction intervals

Separate an estimator from its uncertainty model

Under a correctly specified conditional mean E[y|X]=X beta, the OLS coefficient error is (X transposed X) inverse X transposed u. If conditional errors have covariance sigma squared I, its covariance is sigma squared times (X transposed X) inverse. Estimate sigma squared using residual sum of squares divided by n-k. The degrees-of-freedom adjustment reflects estimating k parameters. A Gaussian conditional-error assumption gives exact finite-sample t and F reference distributions; without Gaussian errors, large-sample approximations require their own regularity conditions.
These are conditional statements. The Harbor generator deliberately has changing innovation scale and serial dependence, and the deployable baseline omits latent demand. The conventional standard errors in its output are therefore a benchmark calculation, not validated confidence coverage for the economic price effect. A software package prints a covariance choice; the analyst must explain why its assumptions match the estimand and data process. Statistical significance does not repair an invalid conditioning set.

Construct a contrast with the full covariance matrix

A business question often concerns a combination of coefficients. For contrast a transposed beta, the estimated variance is a transposed V-hat a. Adding individual standard errors is wrong, and even adding variances misses covariance terms. For a promotion-price interaction model, the price slope during promotion is beta_price+beta_interaction. Its variance includes twice their covariance. A hypothesis about equality of two group slopes is a contrast, not two separate significance tests.
For several restrictions R beta=r, a joint quadratic form compares the vector of estimated deviations using R V-hat R transposed. Under the conventional Gaussian model this leads to an F test with the appropriate restriction count and residual degrees of freedom. Robust versions use an appropriate covariance and asymptotic reference, with small-sample caution. The test answers a restriction question within the specified model; it does not decide which operational objective is important.

Distinguish a mean prediction from a new observation

For a known predictor row x_0, the estimated conditional mean is x_0 transposed beta-hat. Under the conventional benchmark its standard error is sigma-hat times the square root of x_0 transposed (X transposed X) inverse x_0. Predicting a new independent observation adds its own error variance, giving sigma-hat times the square root of 1+x_0 transposed (X transposed X) inverse x_0. The new-observation interval is therefore wider than the mean interval. Neither formula accounts automatically for uncertainty in future predictor values.
At x_0=[1,23,10,0,25], the computed baseline prediction is about 94.773 hundreds. Under the explicitly hypothetical IID Gaussian benchmark, the 95 percent fitted-mean interval is approximately [92.238,97.308], while the new-observation interval is [88.647,100.898]. These intervals illustrate the distinction; the known generator and omitted variable mean their nominal coverage has not been validated for the actual record.

Connect statistical precision to a decision

Suppose an operating plan requires sales above 95 hundreds to avoid idle capacity. A point prediction near 94.8 is not a categorical statement that demand will fall short. The decision needs the consequences of over- and under-capacity, a calibrated predictive distribution or defensible scenarios, and the timing of any adjustment. A narrow confidence interval for the mean cannot substitute for the distribution of a single future outcome. The uncertainty relevant to staffing differs from uncertainty about an average association.
Report the estimand, point estimate, uncertainty procedure and practical threshold separately. If robust covariance changes coefficient uncertainty, the fitted values remain the same unless the estimation method also changes. If the prediction model is revised, preserve the old forecast and evaluate the new one out of sample. The goal is to let a decision-maker inspect how uncertainty changes the action, rather than turn a p-value or interval endpoint into an automatic business rule.

Worked records

Record 1

Use the actual baseline fit and predictor row [1,23,10,0,25]. The following interval calculations assume IID homoscedastic Gaussian errors only as a contrast to the known fictional generator.

Develop the reasoning

Prediction=94.772552; t critical=2.093024; mean SE=1.211173; new-observation SE=2.926541. Multiply each SE by the t critical and add/subtract from the prediction. Mean interval=[92.237538, 97.307566]; prediction interval=[88.647232, 100.897872]. Label these benchmark intervals instead of presenting unsupported coverage.

Progressive practice — optional

1. Foundation

Why does predicting a new observation require a wider interval than estimating its conditional mean?

Compare the worked reasoning

It adds the new observation’s error variance to coefficient-estimation variance.

Change the record

The future outcome is an average of 100 independent observations with the same predictors.

Compare the changed-record reasoning

The new-noise contribution becomes sigma squared/100 under the stated independence assumption, while coefficient-estimation variance remains.

2. Application

For beta_1+beta_2 with variances 4 and 9 and covariance -2, calculate the SE.

Compare the worked reasoning

Variance=4+9+2(-2)=9, so SE=3.

Change the record

Covariance becomes 2.

Compare the changed-record reasoning

Variance=17, so SE=sqrt(17)≈4.1231. The marginal SEs alone cannot determine contrast uncertainty.

3. Transfer

Can HC3 standard errors turn the baseline price association into a causal effect?

Compare the worked reasoning

No. Covariance correction does not remove omitted-variable bias.

Change the record

A randomized price experiment with valid implementation supplies exogenous variation.

Compare the changed-record reasoning

Identification may improve under the experiment’s assumptions, but uncertainty must still reflect its assignment and dependence structure; the old observational interval cannot simply be relabeled causal.

Sources and scope