# [R] confidence / prediction ellipse

Bert Gunter gunter.berton at gene.com
Sun Jan 27 00:19:30 CET 2013

```Well, I'd guess you have to first define what you mean by "prediction
ellipse," as the confidence ellipses are for the bivariate
distribution of 2 parameter estimates -- as I understand it --
whereas predictions depend on the covariate values and are for a
single response value (unless you have fitted multiple responses, I
suppose).

-- Bert

On Sat, Jan 26, 2013 at 1:12 PM, Giuseppe Amatulli
<giuseppe.amatulli at gmail.com> wrote:
> Hi,
> I'm using the R library(car) to draw confidence/prediction ellipses in a
> scatterplot.
> >From what i understood  the ellipse() function return an ellipse based
> parameters:  shape, center,  radius .
> If i read  dataEllipse() function i can see how these parameters are
> calculated for a confidence ellipse.
>
> ibrary(car)
>
> a=c(12,12,4,5,63,63,23)
> b=c(13,15,7,10,73,83,43)
>
> v <- cov.trob(cbind(a, b))
> shape <- v\$cov
> center <- v\$center
>
> radius <- sqrt(2 * qf(0.95, 2, length(a) - 1))   # radius <- sqrt(dfn *
> qf(level, dfn, dfd))
>
> conf.elip = ellipse(center, shape, radius,draw = F)
> plot(conf.elip, type='l')
> points(a,b)
>
> My question is how I can calculate shape, center and radius  to obtain a
> prediction ellipses rather than a confidence ellipse?
> Giuseppe
>
> --
> Giuseppe Amatulli
> Web: www.spatial-ecology.net
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> and provide commented, minimal, self-contained, reproducible code.

--

Bert Gunter
Genentech Nonclinical Biostatistics

Internal Contact Info:
Phone: 467-7374
Website: