# Predicting $y$ when response variable is $\ln(y)$

My estimated model is

$$\hat \ln(y_t)=9.873-0.472\ln(x_{t2})-0.01x_{t3}$$

I'm asked to find a predictive CI at 95% confidence for the mean of $y_0$, when $x_{02}=250$, and $x_{03}=8$. We're to assume that $s^2 x_0(X^TX)^{-1}x_0^T=0.000243952$, where $x_0=(250,8)$.

I have a solution from a previous year, that goes like this:

I find the CI of the form $\text{CI}(E[ln(y_0)|x_0])=\left[\hat\ln(y_t)-t_{\alpha/2}s_E,\hat \ln(y_t)+t_{\alpha/2}s_E\right]$, where $t$ is the $\alpha/2$ upper-quantile of distribution $t(n-k)$ and $s_E=\sqrt{0.000243952}$. This gives me $[7.1563,7.2175]$.

Then the author does $\text{CI}(E[y_0|x_0])=[e^{7.1563},e^{7.2175}]=[1282.158,1363.077]$.

I disagree with this last step (by Jensen's inequality we'll underestimate). In Wooldridge's Intro to Econometrics, in page 212, he states that if we're sure the error terms are normal, then a consistent estimator is:

$$\hat E[y_0|x_0]=e^{s^2/2}e^{\hat \ln(y_0)}$$

So, I was thinking of doing

$$\text{CI}(E[y_0|x_0])=\left[e^{s^2/2} 1282.158,e^{s^2/2}1363.077 \right] = \left[ 1282.314,1363.243 \right]$$

Is this correct?

Also, the solution to this exercise states that $\text{CI}(E[y_0|x_0])=[624.020,663.519]$, which is far from either solution I've got.

Any help would be appreciated.

P.S: I've also read that the correction should not be used to the CI but only for the point estimation $\hat E[y_0|x_0]$

You do not find the same answer because of what I suspect to be a typographical error, which would thus be the main reason of your problem: $x_{03}$ would be set to $80$, not $8$. Another possibility, if you keep $x_{03}=8$, is an error in the second estimated coefficient, say, $\hat{\beta}_2 = -0.1$ instead of $-0.01$.

Anyway, one of these modifications solves everything and yields the same result as the solution to this exercise.

Considering this change, with $t_{\alpha/2}=1.96476138969835$, one gets

### Method 1

$\text{CI}(E[y_0|x_0])=[e^{6.43618291164626},e^{6.49755798189177}]=[624.020307335178,663.519326788772]$ (the given solution to this exercise)

or

### Method 2

(as stated In Wooldridge's Intro to Econometrics, in page 212) if we're sure the error terms are normal (and one is extremely lucky)

$$\text{CI}(E[y_0|x_0])=\left[e^{s^2/2}624.0203,e^{s^2/2}663.5193 \right] = \left[ 624.0960,663.6002 \right]$$

## however

the method 2 is very unlikely to be correct, since as you mention in your question [...] the (underestimation) correction should not be used to the CI but only for the point estimation.

Why ? I would say because of the dependency betweeen the two terms, knowing the expectations of $e^{s^2/2}$ on the one hand and $\hat{y_0}$ on the other hand does not mean one knows the one of $e^{\frac{s^2}{2} + \hat{\ln(y_0)}}$.

Point prediction and CI are different.

For point prediction, we are better off by correcting the bias as much as possible. For CI, what is required from the beginning is that the probability equals $100(1-\alpha)\%$. When $[a,b]$ is the 95% CI for $\ln(y_0)$ for example, $[e^a,e^b]$ is certainly a 95% CI for $y_0$ because $P(a\le \ln X\le b) = P(e^a \le X \le e^b)$. So your $[e^{7.1563}, e^{7.2175}]$ is certainly a valid CI.

But the center of this CI is neither the naive predictor (exp[predictor of $\ln y_0$]) nor the corrected predictor of $y_0$ (a correction factor times the naive predictor) due to Jensen's inequality, but it does not really matter. In some cases (not always), you may be able to change the CI to $[e^{a-p}, e^{b-q}]$ for some $p$ and $q$ so that the probability is still 95% and its center is the bias-corrected predictor, but I don't see the point in it.

What you suggested, i.e., $[e^{s^2/2}e^a,e^{s^2/2}e^b]$ is not a 95% CI. To see why, let the correction factor be $h$ (nonrandom and perfectly known, for simplicity), so the bias-corrected predictor is $he^{\theta}$, where $\theta$ is the unbiased predictor of $\ln y_0$ ($\hat\beta_0 + \hat\beta_2 \ln x_2 + \hat\beta_3 x_3$ in your example). This "$h$" can be estimated by $e^{s^2/2}$ for example, but while the latter is random, $h$ is assumed nonrandom in order to make it simple. Let $[a,b]$ be the 95% CI for $\ln y_0$, i.e., $P(a\le \ln y_0\le b)=0.95$. Then, $$P(he^a \le y_0 \le he^b) = P(\ln h+a \le \ln y_0 \le \ln h+b),$$ which is not equal to $P(a\le \ln y_0\le b)=0.95$ unless the distribution of $\ln y_0$ is uniform, which is usually not.

EDIT

The above is about the CI of $y_0$, not of $E(y|X=x_0)$. The original question is about the CI for $E(y|X=x_0)$. Let $E(y|X=x_0) = h\exp(x_0\beta)$, which is estimated by $\hat{h} \exp(x_0 \hat{\beta})$. In that case, I think the Delta method is a useful option (see luchonacho's answer).

To be rigorous, we need the joint distribution of $\hat{h}$ and $\hat\beta$, or to be precise, the asymptotic distribution of the vector $\sqrt{n}[(\hat\beta-\beta)', \hat{h}-h]'$. Then the limit distribution of $\sqrt{n}[\hat{h} \exp(x_0\hat{\beta}) - h\exp(x_0\beta)]$ is derived using the Delta method and then CI's for $h\exp(x_0\beta)$ can be constructed.

• Thanks for you answer Chan. By the way, in this exercise, the point estimator for either $y_0$ or $E(y|X_0)$ is equal. The resulting estimate is outside the CI for $E(y|X_0)$ but inside the CI for $y_0$. Shouldn't they both be inside their CI? – An old man in the sea. May 24 '17 at 12:06
• Yes, it helps. Could you check this question of mine. It's related to this. economics.stackexchange.com/questions/16891/… – An old man in the sea. May 24 '17 at 15:44
• In a comment I made and deleted, I made a mistake. $E(y|X=x_0)$ is of course different from $\exp\{E(\log y|X=x_0)\}$ as the answer by Alecos Papadopoulos to your question states. Many thanks @Anoldmaninthesea, and sorry about that. I was perhaps thinking that $\exp(x_0{\hat\beta})$ is sufficiently close to $\exp(x_0 \beta)$, which is not what you raised. Hmm, in that case your remark is even more interesting. – chan1142 May 25 '17 at 1:17
• I've never thought about this issue. I will now. So it is about the CI for $E(y|X=x_0)$. The Delta method explained by luchonacho looks useful in this case. Thank you @Anoldmaninthesea for raising it. – chan1142 May 25 '17 at 1:26
• Chan, I've linked another question of mine to this one. In there, you'll find an answer I've written which you might find interesting. – An old man in the sea. May 28 '17 at 9:32

Use the Delta Method. Say the large samples asymptotic distribution of a single parameter $\beta$ is:

$$\hat{\beta} \xrightarrow{a} N\left(\beta,\frac{Var(\hat{\beta})}{n}\right)$$

Furthermore, you are interested in a function of $\hat{\beta}$, say, $F(\hat{\beta})$. Then, a first order Taylor approximation of the above leads to the following asymptotic distribution:
$$F(\hat{\beta}) \xrightarrow{a} N\left(F(\beta),\left(\frac{\partial F(\hat{\beta})}{\partial \hat{\beta}}\right)^2\frac{Var(\hat{\beta})}{n}\right)$$
In your case, $F(\hat{\beta})$ is $e^\hat{\beta}$. From here, you can construct the CI as normal.