[R-sig-Geo] join count with a grid that has NA's

Roger Bivand Roger.Bivand at nhh.no
Mon Jan 9 14:10:52 CET 2006


On Mon, 9 Jan 2006, Ronnie Babigumira wrote:

> Hi listers
> I am trying to apply join counts stats however my grid has some NA's and so I get an error
> 
>  > joincount.multi(mygrid.f, nb2listw(mynb, style="B"))
> Error in joincount.multi(mygrid.f, nb2listw(mynb, style="B")) :
>          NA in factor
> 
> My feeling was that the NA's can be ignored but looking at
> ?joincount.multi I dont see any options for ignoring NA's.  Any ideas on
> a work around this

Two possibilities: subset the data and the neighbour list to remove the NA 
cells - use subset methods, or turn NA into a factor level - a different 
category - and include it in the analysis (so counting NA/NA and NA with 
real level joins too). Neither very good, nor very bad, depends on your 
needs.

You have to make the decision, there isn't an obviously right one,
especially not just omitting NA/other and NA/NA counts internally by
ignoring them, because then the join count sums will not agree with the
neighbour graph geometry sums.

Roger

> 
> Ronnie
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no




More information about the R-sig-Geo mailing list