Re: [R] prediction interval for new value

From: David Barron <mothsailor_at_googlemail.com>
Date: Fri 15 Sep 2006 - 19:45:26 GMT

> predict(s.lm,data.frame(x=30000),interval="prediction")

          fit lwr upr
[1,] 16073985 -9981352 42129323
> predict(s.lm,data.frame(x=30000),interval="confidence")

          fit lwr upr
[1,] 16073985 5978125 26169846

On 15/09/06, Sachin J <sachinj.2006@yahoo.com> wrote:
>
> Hi,
>
> 1. How do I construct 95% prediction interval for new x values, for
> example - x = 30000?
> 2. How do I construct 95% confidence interval?
>
> my dataframe is as follows :
>
> >dt
>
> structure(list(y = c(26100000,
> 60500000, 16200000, 30700000, 70100000, 57700000, 46700000, 8600000,
> 10000000, 61800000, 30200000, 52200000, 71900000, 55000000, 12700000
> ), x = c(108000, 136000, 35000,
> 77000, 178000, 150000, 126000, 24000, 28000, 214000, 108000,
> 190000, 308000, 252000, 71000)), .Names = c("y",
> "x"), class = "data.frame", row.names = c("1",
> "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13",
> "14", "15"))
>
> my regression eqn is as below:
>
> > s.lm <- lm(y ~ x)

>
> Thanks in advance.
>
>
> ---------------------------------
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
=================================
David Barron
Said Business School
University of Oxford
Park End Street
Oxford OX1 1HP

	[[alternative HTML version deleted]]

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Sat Sep 16 05:48:07 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 15 Sep 2006 - 20:30:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.