Re: [R] NA-handling in

From: Gavin Simpson <>
Date: Fri 13 Oct 2006 - 12:20:32 GMT

On Fri, 2006-10-13 at 12:51 +0200, Fredrik Thuring wrote:
> Dear Sir or Madam,
> I'm wondering if there is any routine or argument in the function ''
> that makes it handle NA's. The function 'glm' can handle NA's but I can't
> make make it work (or find anything written on this in the help files) with
> ''.
> Is it even possible in''? How?
> Thanks before hand,
> Fredrik Thuring, Business Researcher

glm() deals with NAs etc via the na.action argument, which is missing from glm is a wrapper around, so look at the code of glm and see how it handles NAs when generating the x and y arguments that go into

You should also look at ?glm which points to ?na.omit and look at options("na.action") to set what your setting is currently. You'll probably want to run na.omit or na.exlude on a combination of the response and predictor matrix (the arguments you are passing as x and y to to remove incomplete cases.


 Gavin Simpson                 [t] +44 (0)20 7679 0522
 ECRC & ENSIS, UCL Geography,  [f] +44 (0)20 7679 0565
 Pearson Building,             [e]
 Gower Street, London          [w]
 London, UK. WC1E 6BT.         [w]

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Sat Oct 14 10:26:24 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 14 Oct 2006 - 00:30:10 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.