Why Condition on the Observed Predictor Values?
Simple regression studies how a response changes with a predictor. In applications, the predictor values may be deliberately chosen, such as specified exposure levels, or they may arise from sampling, such as observed ages or account sizes. These are different descriptions of how the data were collected. In the standard regression analysis, however, inference about the regression coefficients is usually made conditional on the predictor values that were observed.
Conditioning does not mean that the predictor must have been fixed in advance. It means that, for the coefficient calculations, we regard the observed predictor values as given and describe the randomness in the responses through the regression errors. This distinction helps clarify what the standard errors and confidence intervals do—and do not—represent.
The Standard Conditional Model
Write the simple linear regression model as \(Y_i=\beta_0+\beta_1x_i+\varepsilon_i\), where \(\beta_0\) and \(\beta_1\) are fixed but unknown parameters. For the standard conditional model, the predictor values are treated as given, and the errors satisfy \(E[\varepsilon_i\mid x_1,\ldots,x_n]=0\), \(\operatorname{Var}(\varepsilon_i\mid x_1,\ldots,x_n)=\sigma^2\), and are uncorrelated across observations. Thus, conditional on the observed predictors, the responses have means on the regression line and equal error variances.
For the usual exact small-sample \(t\)- and \(F\)-inference, the additional assumption is that the errors are conditionally independent and normally distributed with mean zero and variance \(\sigma^2\). If normality is not assumed, the least-squares estimates can still have useful properties under the mean, variance, and independence conditions, but the exact small-sample \(t\) distributions do not follow from those conditions alone.
Let \(\bar{x}\) be the mean of the observed predictor values and let \(S_{xx}=\sum_{i=1}^n(x_i-\bar{x})^2\). If \(S_{xx}>0\), the ordinary least-squares slope estimate is \(\hat{\beta}_1=\sum_{i=1}^n(x_i-\bar{x})Y_i/S_{xx}\). Under the conditional model, its mean is \(\beta_1\) and its variance is \(\sigma^2/S_{xx}\). The observed predictor spread therefore matters directly: greater \(S_{xx}\) gives a smaller conditional variance for the slope estimate, all else equal.
The notation emphasizes the conditioning. It describes the distribution of the estimate over repeated response samples with these same predictor values. It does not say that the predictor values have no randomness in the process that generated the data.
Why the Conditional Variance Formula Holds
The slope estimate can be rewritten by substituting the regression model into its formula. Since \(\sum_i(x_i-\bar{x})=0\), the intercept term contributes nothing:
Conditional on the predictors, the errors have mean zero, so the second term has conditional expectation zero. If the errors are conditionally uncorrelated and each has variance \(\sigma^2\), its conditional variance is
Conditional normality of the errors makes the weighted sum of errors normal, which gives the stated normal distribution for \(\hat{\beta}_1\). This argument also shows why the formula requires \(S_{xx}>0\): if every observed predictor value is the same, the slope cannot be estimated from those data.
Worked Example: A Slope Interval with Fixed Predictor Values
A hypothetical study records response \(Y\) at several deliberately selected predictor levels. The observed predictor spread is \(S_{xx}=10\), the estimated slope is \(\hat{\beta}_1=2.2\), and the error variance is known to be \(\sigma^2=4\). Assume the conditional errors are independent normal variables with mean zero and variance 4. Find a 95% confidence interval for the slope, conditional on the observed predictor values.
Method. With known error variance and conditional normality, use the normal interval \(\hat{\beta}_1\pm1.96\sqrt{\sigma^2/S_{xx}}\).
Step 1: Compute the conditional standard error. The variance is \(4/10=0.4\), so the standard error is \(\sqrt{0.4}=0.6324555\ldots\).
Step 2: Compute the margin using the unrounded standard error. The margin is \(1.96\sqrt{0.4}=1.2396128\ldots\), which rounds to 1.240 at three decimal places.
Step 3: Form the interval. Its unrounded endpoints are \(2.2-1.2396128\ldots=0.9603872\ldots\) and \(2.2+1.2396128\ldots=3.4396128\ldots\). Rounded to three decimals, the interval is \([0.960,3.440]\).
Check and common mistake. The interval is centered at 2.2, as a two-sided normal interval should be. Avoid mixing rounded and unrounded intermediate values: multiplying 1.96 by the displayed standard error 0.6325 gives 1.2397, whereas the margin calculated from \(\sqrt{0.4}\) is 1.2396. Both approaches give the same endpoints at three decimals, but each multiplication must match the precision shown.
When the Predictor Is Random
In many observational studies, predictor values are sampled rather than fixed by design. Suppose the observations are generated by \(Y_i=\beta_0+\beta_1X_i+\varepsilon_i\), where the \(X_i\) are random. If the conditional error assumptions hold given the observed predictors, then after observing \(X_1,\ldots,X_n\), the same conditional regression formulas apply. The random-predictor description concerns how the \(X_i\) arose; it does not by itself change the conditional response model.
For example, if \(E[\varepsilon_i\mid X_i]=0\), then the conditional mean response is \(E[Y_i\mid X_i]=\beta_0+\beta_1X_i\). If the errors are also independent of the predictors and have constant variance, conditioning on the observed predictor values leaves the familiar error variance \(\sigma^2\). If predictor and error behavior is dependent, or if the conditional error variance changes with the predictors, the standard conditional formulas may not apply as stated.
The conditional and unconditional statements should not be confused. If the random design satisfies the standard conditional assumptions and \(S_{XX}>0\), then \(E[\hat{\beta}_1\mid X_1,\ldots,X_n]=\beta_1\). Averaging this conditional expectation over the random predictors also gives \(E[\hat{\beta}_1]=\beta_1\), provided the expectation exists. But the unconditional variance includes the variation in conditional precision across possible predictor samples:
This expression is generally not equal to \(\sigma^2/E[S_{XX}]\). The reciprocal of a random quantity cannot generally be replaced by the reciprocal of its mean. Standard regression output usually reports precision conditional on the predictor values in the data, rather than averaging over all possible predictor samples.
Worked Example: A Random Predictor, Then a Conditional Interval
Suppose a hypothetical portfolio study follows the model \(Y=10+3X+\varepsilon\). The predictor \(X\) takes values 0 and 2 with equal probabilities, and the errors are independent of \(X\), with \(\varepsilon\sim N(0,4)\). In a sample of four policies, the observed predictor values are \(0,0,2,2\), and the observed responses are \(11,9,17,15\). Find the least-squares line and a conditional 95% interval for the slope, treating the error variance as known.
Step 1: Calculate the observed predictor mean and spread. Here \(\bar{x}=(0+0+2+2)/4=1\). Therefore \(S_{xx}=(-1)^2+(-1)^2+1^2+1^2=4\).
Step 2: Calculate the observed response mean and the centered cross-product. The response mean is \(\bar{y}=(11+9+17+15)/4=13\). The cross-product is \(S_{xy}=(-1)(-2)+(-1)(-4)+(1)(4)+(1)(2)=2+4+4+2=12\).
Step 3: Find the least-squares coefficients. The slope is \(\hat{\beta}_1=S_{xy}/S_{xx}=12/4=3\). The intercept is \(\hat{\beta}_0=\bar{y}-\hat{\beta}_1\bar{x}=13-3(1)=10\). Thus the fitted line is \(\hat{Y}=10+3x\).
Step 4: Calculate conditional uncertainty. The standard error of the slope is \(\sqrt{4/4}=1\). The 95% interval is \(3\pm1.96(1)\), or \([1.04,4.96]\).
Step 5: Relate this to the random-predictor description. The predictor’s population mean is \(E[X]=(0+2)/2=1\), and its variance is \(E[(X-1)^2]=1\). The model gives \(E[Y]=10+3(1)=13\), \(\operatorname{Cov}(X,Y)=3\operatorname{Var}(X)=3\), and \(\operatorname{Var}(Y)=3^2\operatorname{Var}(X)+4=13\). These are population statements. The interval above instead uses the particular observed predictor spread \(S_{xx}=4\).
Check and common mistake. The computed line matches the responses’ pattern: the two responses at \(x=0\) average 10, and those at \(x=2\) average 16. Do not substitute the population variance of \(X\) for the observed \(S_{xx}\) in the conditional standard error. The interval uses the observed spread and is conditional on these four predictor values.
Estimating the Error Variance
When \(\sigma^2\) is unknown, it is estimated from the residual sum of squares. Under the simple regression model with an intercept and slope, \(s^2=\mathrm{RSS}/(n-2)\), where \(\mathrm{RSS}=\sum_i(Y_i-\hat{Y}_i)^2\). The two fitted coefficients use two degrees of freedom. Under independent normal conditional errors, the slope statistic \((\hat{\beta}_1-\beta_1)/(s/\sqrt{S_{xx}})\) has a \(t\) distribution with \(n-2\) degrees of freedom, conditional on the observed predictors. The exact \(t\) result requires the normal-error assumption; it is not a consequence of merely having random or fixed predictors.
Worked Example: A Small-Sample Conditional \(t\) Interval
A hypothetical regression study has \(n=4\) observations, \(S_{xx}=5\), \(\hat{\beta}_1=1.8\), and \(\mathrm{RSS}=1.8\). Assume independent normal errors with constant variance conditional on the observed predictor values. Find the 95% conditional \(t\) interval for the slope and test \(H_0:\beta_1=1\) against a two-sided alternative at the 5% level.
Step 1: Estimate the error variance. The degrees of freedom are \(n-2=2\), so \(s^2=1.8/2=0.9\), and \(s=\sqrt{0.9}=0.9486833\ldots\).
Step 2: Compute the slope standard error. It is \(s/\sqrt{S_{xx}}=\sqrt{0.9/5}=\sqrt{0.18}=0.4242641\ldots\).
Step 3: Form the confidence interval. The 95% critical value for 2 degrees of freedom is approximately 4.30265. The margin, computed without rounding the standard error, is \(4.30265\sqrt{0.18}=1.82546\) to five decimals. The endpoints are \(1.8-1.82546=-0.02546\) and \(1.8+1.82546=3.62546\). Rounded to three decimals, the interval is \([-0.025,3.625]\).
Step 4: Perform the test. Under \(H_0:\beta_1=1\), the test statistic is \((1.8-1)/\sqrt{0.18}=0.8/0.4242641\ldots=1.88562\ldots\). Its absolute value is less than 4.30265, so the null hypothesis is not rejected at the 5% level.
Check and common mistake. The test conclusion agrees with the interval: the null value 1 lies inside the confidence interval. Retain sufficient precision when calculating the endpoints; in particular, the lower endpoint is \(-0.02546\) before rounding, not \(-0.026\).
Common Interpretation Traps
- Assuming random predictors invalidate regression inference. They do not, provided the conditional error assumptions hold. The standard calculations condition on the observed predictor values.
- Treating the observed predictors as the source of response error. The standard conditional model assigns the response randomness to the errors. The predictor spread controls coefficient precision through quantities such as \(S_{xx}\); it is not added to \(\sigma^2\).
- Using the conditional formula without its assumptions. If errors have nonzero conditional means, unequal conditional variances, or dependence that is not accounted for, the displayed standard errors and exact \(t\) inference need not be valid.
- Confusing a conditional statement with an unconditional one. A confidence interval based on the observed \(S_{xx}\) describes uncertainty conditional on those predictors. It does not average over the possible predictor samples that might have been collected.
Check Your Understanding
For each problem, identify the relevant conditional calculation or interpretation before checking the final answer.
- A fixed-predictor regression has \(\hat{\beta}_1=0.75\), \(S_{xx}=8\), and known \(\sigma^2=9\). Assuming normal errors, find a 90% conditional confidence interval using \(z_{0.95}=1.645\). Round endpoints to three decimals. (Answer: \([-0.995,2.495]\))
- A random predictor has \(E[X]=2\) and \(\operatorname{Var}(X)=3\). The model is \(Y=4+2X+\varepsilon\), with \(E[\varepsilon\mid X]=0\), \(\operatorname{Var}(\varepsilon\mid X)=1\), and errors uncorrelated with \(X\). Find \(\operatorname{Cov}(X,Y)\) and \(\operatorname{Var}(Y)\). (Answer: \(\operatorname{Cov}(X,Y)=6\), \(\operatorname{Var}(Y)=13\))
- For observed predictor values with \(S_{xx}=2\), a study reports \(\hat{\beta}_1=1.4\) and known \(\sigma^2=2\). Under normal conditional errors, calculate a 95% conditional interval using 1.96 as the critical value. (Answer: \([-0.560,3.360]\))
- A regression has \(n=6\), \(S_{xx}=10\), \(\mathrm{RSS}=8\), and \(\hat{\beta}_1=0.9\). Assume independent normal conditional errors. Using \(t_{0.975,4}=2.776\), find the 95% conditional interval, rounded to three decimals. (Answer: \([-0.341,2.141]\))
- A study samples predictor values at random, but the conditional error variance increases with \(X\). Can the usual constant-variance conditional slope standard error \(\sqrt{s^2/S_{xx}}\) be used without adjustment? State the reason. (Answer: No; the conditional error variance is not constant, so the standard formula’s variance assumption is violated.)