On 03/07/12 03:58, chuck.01 wrote:
Hi,
I was playing around with something else and I noticed this matrix code for
residuals in a linear model doesn't say what lm() says. Please tell me if I
am completely misguided here.
data(mtcars)
Y <- as.matrix(mtcars[,1])
X <- as.matrix(mtcars[,c(2:11)])
nevermind...
I forgot the column of 1's for the intercept term
chuck.01 wrote
>
> Hi,
> I was playing around with something else and I noticed this matrix code
> for residuals in a linear model doesn't say what lm() says. Please tell
> me if I am completely misguided here.
>
> data(mtcars)
>
Hi,
I was playing around with something else and I noticed this matrix code for
residuals in a linear model doesn't say what lm() says. Please tell me if I
am completely misguided here.
data(mtcars)
Y <- as.matrix(mtcars[,1])
X <- as.matrix(mtcars[,c(2:11)])
# shouldnt this:
H <- X %*% solve(
FYI:
As you are likely thinking: this doesn't belong here (It just occurred to
me), I am questioning what I did, not the output of lm()
But if someone knows why I am wrong please let me know.
chuck.01 wrote
>
> Hi,
> I was playing around with something else and I noticed this matrix code
> fo
4 matches
Mail list logo