Re: [R] covariance matrix of predictions

2006-08-27 Thread Ritwik Sinha
Hi, If I understand correctly the Var(X \hat{\beta}) = X (X'X)^{-1}X' \sigma^2, where X will now be x.pred. Which should be easily obtained by performing the matrix computation and multiplying it with the estimate of the variance. For more details about different aspects of the estimate and

[R] covariance matrix of predictions

2006-08-23 Thread Arnab mukherji
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