Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# st: Intervals for predicted mean value vs predicted individual value

 From Adam Guerrero To statalist@hsphsun2.harvard.edu Subject st: Intervals for predicted mean value vs predicted individual value Date Mon, 24 Feb 2014 00:32:08 -0600

```Dear Statalist,

I am trying to reproduce an example in Bowerman et al.'s "Forecasting,
Time Series, and Regression."

I have inputted the following data into Stata

. input temp fuelcons
. 28 12.4
. 28 11.7
. 32.5 12.4
. 39 10.8
. 45.9 9.4
. 57.8 9.5
. 58.1 8
. 62.5 7.5
. end

After regressing fuelcons on temp, I can obtain predicted values of
fuelcons using

. regress fuelcons temp

. predict pfuelcons

I can also get the standard errors of the predicted mean using

. predict pmfuelcons, stdp

Finally, I can get the standard errors of the predicted individuals
fuelcons values using

. predict pyfuelcons, stdf

I know that I can use this information to obtain a confidence interval
for the conditional mean and a confidence interval for a particular
value of fuelcons given a value for temp in the data.

My question is whether there is a command that will allow me to
estimate a 95% confidence interval for the mean value of fuelcons
given a particular value of temp that is not included in the data, but
is in the range of temp (e.g., given a temp of 40).

I would also like to get a 95% confidence interval for an individual
value of fuelcons given a particular value of temp that is not
included in the original data, but is in the range of temp (e.g.,
given a temp of 40).

The confidence interval for the mean value of fuelcons when temp
equals 40, and the prediction interval for an individual value of
fuelcons when temp equals 40 are computed automatically in MINITAB as

Fit            SE Fit                95% CI                          95% PI
10.721     .241                  (10.130, 11.312)          (9.015, 12.427)

Is it possible to do this in Stata with a single command?

I am a bit worried that I am overlooking something simple in, so I
apologize in advance if that's the case, and thank you for assisting
with such a long question.

Cheers,