[R] removing NA values from data frame & identification function

Faheem Mitha faheem at email.unc.edu
Thu Apr 20 03:05:31 CEST 2000


I should probably clarify. I can fit a glm model to my data fine, even
with missing values. The default na.action appears to be to omit the rows
with NAs in them. However, there is the following warning in the doc page
for step (written by Brian Ripley, I assume):

*********************************************************************
The model fitting must apply the models to the same dataset. This may be a
problem if there are missing values and R's default of na.action = na.omit
is used. We suggest you remove the missing values first.
*********************************************************************

I think he means that the NA values should be explicitly removed from the
data set. Indeed, funny things seem to happen when I try to use step or
its sister function stepAIC, which I think may possibly be due to NAs
being present. (In all cases, I am using na.action with the default value
of na.omit).
                                 Faheem.

On Wed, 19 Apr 2000, Pierre Kleiber wrote:

> For your first question look at the function na.omit() or the optional
> argument, na.action, in glm, gam, etc.  I think they will do what you
> want.
> 
> -- 
> -----------------------------------------------------------------
> Pierre Kleiber             Email: pkleiber at honlab.nmfs.hawaii.edu
> Fishery Biologist                     Tel: 808 983-5399/737-7544
> NOAA FISHERIES - Honolulu Laboratory         Fax: 808 983-2902
> 2570 Dole St., Honolulu, HI 96822-2396 
> -----------------------------------------------------------------
>  "God could have told Moses about galaxies and mitochondria and
>   all.  But behold... It was good enough for government work."
> -----------------------------------------------------------------

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list