Re: [R] lm without error

From: Erik Iverson <eriki_at_ccbr.umn.edu>
Date: Fri, 11 Jun 2010 09:46:29 -0500

  1. please use reproducible, minimal examples when discussing behavior of R.
  2. perhaps ?try could help.

ivo welch wrote:
> this is not an important question, but I wonder why lm returns an
> error, and whether this can be shut off. it would seem to me that
> returning NA's would make more sense in some cases---after all, the
> problem is clearly that coefficients cannot be computed.
>
> I know that I can trap the lm.fit() error---although I have always
> found this to be quite inconvenient---and this is easy if I have only
> one regression in my lm() statement.
>
> but, let's presume I have a matrix with a few thousand dependent y
> variables (and the same independent X variables). Let's presume one
> of the y variables contains only NA's. I believe I now cannot use
> lm(y ~ X), because one of the regressions will throw the lm.fit
> exception. (all the other y vectors should have worked.)
>
> or is there a way to get lm() to work in such situations?
>
> /iaw
>
> ----
> Ivo Welch (ivo.welch_at_brown.edu, ivo.welch_at_gmail.com)
>
> ______________________________________________
> R-help_at_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.



R-help_at_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. Received on Fri 11 Jun 2010 - 14:48:52 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 11 Jun 2010 - 15:40:29 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive