Not sure what you mean.
yi <- c(2,3,2,4,3,6)
xi <- c(1,4,3,2,4,5)
res <- lm(yi ~ xi)
hatvalues(res)
X <- cbind(1, xi)
diag( X%*%solve(t(X)%*%X)%*%t(X) )
Same result.
Best,
--
Wolfgang Viechtbauerhttp://www.wvbauer.com/
Department of Methodology and StatisticsTel: +
Sigmund Freud wrote:
Hello:
I am trying to understand the method 'hatvalues(...)', which returns something similar to the diagonals of the plain vanilla hat matrix [X(X'X)^(-1)X'], but not quite.
A Fortran programmer I am not, but tracing through the code it looks like perhaps some sort of co
2 matches
Mail list logo