Hi !

I am trying to get at the covariance of the predictions of a linear model. 
Suppose the we have:

> x<-runif(1000)
> y<-2 + 25x*x +rnorm(1000)
> lm1 <-lm(y~x, data = data.frame(y  = y, x=x))
> x.pred <-runif(10)
> y.hat <- predict(lm1, newdata = data.frame(x=x.pred))

I was wondering how to get an estimate of the covariance of y.hat which would 
be a 10 x 10 matrix telling be the uncertainty in each of the predictions.

thanks

Arnab

______________________________________________
[email protected] 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.

Reply via email to