[R] Hat Matrix
hyak
shaneskinner01 at gmail.com
Mon Aug 22 12:35:14 CEST 2011
Hi, I'm a new user of R - Is this how you construct a hat matrix?
H <- x %*% solve(t(x) %*% x) %*% t(x)
H
colnames(H) = rep('', 11)
round(H,2)
If so can you make them for more than 2 matrices? Why do you have to use
the 2nd piece of code to round and stuff? Shouldn't it be correct from the
start?
Thanks for any feedback,
Hyak
--
View this message in context: http://r.789695.n4.nabble.com/Hat-Matrix-tp3759728p3759728.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list