# How to find the variance for a mean response in a multiple linear regression model

The question is the following:

1. Our regression model can be written as $y_i = \beta^Tx_i + \epsilon_i, 1 \leq i \leq n$. Find the $100(1- \alpha)\%$ confidence interval for the mean response $\beta^Tx$ at a given vector $x$ of regressor observations.

2. Now suppose a future observation y is taken at a regressor $x$. Find a $100(1-\alpha)\%$ prediction interval for $y$.

Let:

• $k$ denote the # of regressors
• $n$ denotes the sample size
• $\sigma^2$ is ${\rm Var}(\epsilon|X)$ where $X$ is the $nxk$ matrix containing all the regressor values.
• $x_i$ is a $nx1$ vector of all the sampled values of the $i^{th}$ regressor

So from my understanding the mean response is $E[y_i|x_i]$ where $1 \leq j \leq n$. And it is obvious that $E[y_i|x_i] = \beta^Tx$. However, I am unsure of how to get the variance needed to get the confidence interval for #1. Using $y_i \pm t_{\alpha/2, n-k-1}\sigma_{y_i}$.

I used the following method as an attempt:

$${\rm Var}(\beta^Tx_i|x_i) = x^T_i {\rm Var}(\beta|x_i) x_i$$

I took ${\rm Var}(\beta|x_i) = \sigma^2 (x^Tx)^{-1}$, which is the value ${\rm Var}(\beta_{OLS}|X)$, where $X$ is the $nxk$ matrix containing all the regressor values.

$$y_i \pm t_{\alpha/2, n-k}\sqrt{x_i^T\sigma^2(x^Tx)^{-1}x_i}$$

which is little more than a horrible guess since for a mean response only $x_i$ is given.

I tried doing it this way too:
$${\rm Var}(\Sigma_{j=1}^k \beta_jx_{ij}|x_i)$$ but the expansion was too ugly to bear...

For #2, I got the following answer: $$\hat y_{OLS} \pm t_{\alpha/2, n-k}\sqrt{\frac{e^Te}{n-k}}$$ which I am afraid another guess... where I assumed it was just an estimate using Ordinary Least Square method.

• Please check the first line of your quoted question. Is there something missing after $\beta^T$? – Glen_b Aug 11 '14 at 0:31
• What's your estimate of $\beta^Tx$? Can you use basic properties of variances or expectations to compute its variance? – Glen_b Aug 11 '14 at 0:33
• This is a theoretical question. There are no concrete values. In my post, I talked about computing $Var(\Sigma_{j=1}^k\beta_jx_{ij}|x_i)$ directly, but it is difficult because the $\beta$ can be correlated which creates one big mess. – itzjustricky Aug 11 '14 at 1:00
• I edited my post so that it specifies that $x_i$ are nx1 vectors – itzjustricky Aug 11 '14 at 1:02