Re: [R] Re gression between adjacent columns - error with NAs

2008-07-31 Thread rcoder
Thank you both very much for your assistance. Both the suggestions worked out in the end, and I managed to achieve what I wanted. There is something else I want to try, which is a slight deviation on the theme. In the code I posted, I export Intercept and Slope regression coefficients to an o/p m

Re: [R] Re gression between adjacent columns - error with NAs

2008-07-30 Thread Krzysztof Sakrejda-Leavitt
A partial answer is... After doing debug(lm.fit) and debug(lm), and waiting to see where the messages come from, I can tell that when you do na.action=NULL, the R goes to call the Fortran routine dqrls (through .Fortran) and when R prepares the data to pass to the dqrls it triggers one of the

Re: [R] Re gression between adjacent columns - error with NAs

2008-07-30 Thread Gabor Grothendieck
That's good. Try this: 1. put set.seed(1) at the top of the code to make it reproducible. 2. replace body of loop with: sel_col<-SourceMat[, i] out <- try(coef(lm(tt~sel_col, na.action=NULL))) if (!inherits(out, "try-error")) ResultMat[,i] <- out 3. email tends to wrap long