To reproduce
set.seed(1)
N <- 100
x <- rep(1, N)
covar <- matrix(rnorm(N * 10), N)
lm(x ~ covar)
Because of the intercept, I would expect this to be singular and not solvable.
Instead, I just get very small values for the coefficients of covar
.
Anyone knows a way around this?
Edit: what is singular is
model.matrix(~ ., data = cbind.data.frame(x, covar))
(first two columns are all 1s)
zapsmall(coefficients(lm(x ~ covar)))
. (2) Typesummary(lm(x ~ covar))
. Together these should fully answer your question. $\endgroup$