Howdy, I am trying to invert a matrix for the purposes of least squares. I have tried a number of things, and the variety of results has me confused. 1. When I try solve() I get the following: >Error in solve.default(t(X) %*% X) : system is computationally singular: reciprocal condition number = 3.76391e-20 2. When I try qr.solve(), I get: >Error in qr.solve(t(X) %*% X) : singular matrix 'a' in solve 3. I can, however, use lm(y~X) to get coefficients. This confuses me since I thought that lm() used qr(). So why did qr.solve() not work earlier? 4. I have even tried using ginv(). The process works, but I end up with a different set of regression coefficients after I finish the process than what I had with lm(). To the best of my knowledge, this shouldn't happen.
I've been digging around all day and can't figure this out. Thanks, Ben Domingue PhD Student, School of Education University of Colorado at Boulder ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.