Regression with Dummy Variables When I analyzed a data set with two categories, I used a dummy variable $z=1$ for category 1, and 0 otherwise, and added the extra term $\beta z$ to the regression model. Suppose the least squares estimate for $\beta$ is $b$. I tried to calculate some prediction intervals for the two categories. For category 1, since $z=1$, I needed to count the variance for $b$, but for category 2, since $z=0$, I did not count this variance. It then appeared that the variance for category 1 includes an additional variance because I happened to code it as $z=1$. I am new to study econometrics. Could anyone please help with this puzzle? Am I missing anything here?
That is natural and you are not missing anything.

Let $y=\alpha + \beta z + u$. Your prediction of $y$ given $z=1$ is $\hat{y} = a + b$, where $a$ and $b$ are the OLS estimates. The prediction error ($y - \hat{y}$) for $z=1$ is, thus, $(\alpha - a) + (\beta-b) + u$, which is involved with $b$. On the other hand, for $z=0$, the prediction of $y$ is $a$ and the prediction error is $(\alpha-a) + u$, which has nothing to do with $b$. As you said, the former depends on $b$, while the latter does not. (Perhaps it would help to remember that the value of $z$ is given for the prediction, and thus the prediction intervals depend on the value of $z$.)

(Calculation of the prediction intervals:) You can calculate the prediction intervals using the formula $(a+b) \pm se((\alpha-a)+(\beta-b)+u) \cdot \textit{critical value}$ for $z=1$, and the formula $a \pm se((\alpha-a)+u) \cdot \textit{critical value}$ for $z=0$. which is fine. Note that these two prediction intervals can also be written as $(a+b) \pm se(a+b+u) \cdot cv$ and $a\pm se(a+u) \cdot cv$, respectively, because $\alpha$ and $\beta$ are constant (nonrandom). How to estimate the standard errors can be found in Wooldridge's textbook (the "Prediction and Residual Analysis" section; 6.4 in 5ed).