Re: [R] conflicting results on NA in a qda predicted object:

About this list Date view Thread view Subject view Author view Attachment view

From: Prof Brian Ripley (ripley@stats.ox.ac.uk)
Date: Thu 20 Dec 2001 - 21:29:07 EST


Message-id: <Pine.GSO.4.31.0112201022490.7216-100000@toucan.stats>

This is a factor. You have to be careful with NAs in factors (and 1.4.0
is different there as it happens).

Nevertheless, there is no way to reproduce this from what you have given.
Check that the class really is "factor", and then unclass it to see what
the codes actually are. One or more of them should be NA from what you
have given.

On Thu, 20 Dec 2001, Agustin Lobo wrote:

>
> Dear list,
>
> (I've not upgraded to R1.4 yet)
>
> I have the following $class component in a predict.qda object:
> > unique(mod23S.qda.pred$class)
> [1] 12 17 8 10 4 9 5 13 14 19 20 15 6 3 7 1 23 11 18 21 16 2 22 NA
> Levels: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
>
> Nevertheless, when I try to identify the individual(s) with NA, I get:
> > any(is.na(mod23S.qda.pred$class))
> [1] FALSE
>
> and
>
> > mod23S.qda.pred$class[is.na(mod23S.qda.pred$class)]
> factor(0)
> Levels: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
>
> So, actually, is there a NA value in mod23S.qda.pred$class or not?
>
> (screening by eye it`s impossible:
> length(mod23S.qda.pred$class) is 26375 )
>
> Agus
>
> Dr. Agustin Lobo
> Instituto de Ciencias de la Tierra (CSIC)
> Lluis Sole Sabaris s/n
> 08028 Barcelona SPAIN
> tel 34 93409 5410
> fax 34 93411 0012
> alobo@ija.csic.es
>
>
>
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> 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@stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Thu 17 Jan 2002 - 11:10:10 EST