Calculating variance of sum of random variables - not sure if they are independent? Consider the standard regression model with i.i.d. observations $(X_i,Y_i)$ for $i=1,2,\dots,n$:
$$
Y_i = \beta_0 + \beta_1 X_{i} + \varepsilon_i, \quad \quad i = 1,2,\dots,n,
$$
where the regressors $X_i$ are considered to be random variables as opposed to fixed observations, and the errors are normally distributed conditional on the regressors and have fixed variance.
Suppose we solve this model using ordinary least squares and obtain estimated coefficients $\hat \beta_0, \hat \beta_1$.
Now define $n$ new random variables
$$
Z_i = \hat \beta_0 + \hat \beta_1 X_{i}, \quad \quad i=1,2,\dots,n.
$$
How do we calculate $\text{Var}[\sum_{i=1}^n Z_i]$? I'm not sure if $Z_i$ are independent because they are constructed using $\hat \beta_0$ and $\hat \beta_1$ which makes it seem like the $Z_i$ could be dependent on each other?
Note: I want to treat $\hat \beta_0$ and $\hat \beta_1$ as random. Wikipedia says these estimates are normally distributed since the errors are normally distributed.
 A: If the regression coefficients are estimated using OLS and the variance of the errors is $\sigma^2$, then
$$
\begin{bmatrix} \hat{\beta}_0 \\ \hat{\beta}_1 \end{bmatrix} |X \sim N\Big(  
\begin{bmatrix} \beta_0 \\ \beta_1 \end{bmatrix}
,
\sigma^2\begin{bmatrix} n & \sum_i X_i\\ \sum_i X_i & \sum_i X_i^2 \end{bmatrix}^{-1}
\Big).
$$
where $X=(X_1...X_n)$. Now, let
$$
Z = \begin{bmatrix} \hat{\beta}_0 \\ \hat{\beta}_1 \end{bmatrix}'
\begin{bmatrix} n \\ \sum_i X_i \end{bmatrix}.
$$
Then using the law of total variance
$$
Var(Z) = Var(E(Z|X)) + E(Var(Z|X))
$$
$$
=Var\Big(\begin{bmatrix} \beta_0 \\ \beta_1 \end{bmatrix}'
\begin{bmatrix} n \\ \sum_i X_i \end{bmatrix}\Big)
+
E\Big(
\sigma^2
\begin{bmatrix} n \\ \sum_i X_i \end{bmatrix}'\begin{bmatrix} n & \sum_i X_i\\ \sum_i X_i & \sum_i X_i^2 \end{bmatrix}^{-1}\begin{bmatrix} n \\ \sum_i X_i \end{bmatrix}
\Big).
$$
If the variance of $X$ is $\sigma_x^2I_n$ then the first term above is $n\beta_1^2\sigma_x^2$, and I believe the second term is $n\sigma_2^2$. So the answer to your question is
$$
n(\beta_1^2\sigma_x^2 + \sigma_2^2).
$$
