[R-sig-Geo] correlogram for missing values

Roger Bivand Roger.Bivand at nhh.no
Fri May 27 07:42:09 CEST 2011


On Thu, 26 May 2011, Advait Godbole wrote:

> Dear List,
>
> I am performing a spatial analysis for gridded data with ~8000 cells. Each
> grid cell is 10 x 10 km and has one dependent and 4 independent variables.
> The dependent variable is log-transformed and has some NAs. I generated a
> first order queen neighbour object:

The missing values are almost certainly the source of your problem. Subset 
both your data and your neighbour object to retain only complete cases.

You did not state your command for Moran's I, but I guess that you set 
na.action=na.omit - you do not seem to have passed this to correlog, which 
gives the message you see irrespective of the cause of the error. The 
problem will be resolved by removing incomplete cases.

Roger

>
>> vulcgrid.queen.nb
>
> Neighbour list object:
> Number of regions: 8281
> Number of nonzero links: 64944
> Percentage nonzero weights: 0.09470512
> Average number of links: 7.842531
>
> and then ran a Moran's I (after accounting for the missing values using
> na.omit):
>
>> lnemitpcap.morans.queen.1st
>
>        Moran's I test under randomisation
>
> data:  LNEMITPCAP
> weights: vulcgrid.queen.nb.w
> omitted: 7, 176, 259, 1304, 1424, 1473, 1532, 2101, 2273, 2436, 2451, 2884,
> 2921, 4260, 4271, 4454, 4577, 4957, 5111, 5126, 5589, 5837, 5871, 5994,
> 6084, 6315, 6527, 6528, 6696, 6697, 6865, 6946, 7022, 7034, 7115, 7558,
> 7638, 7658, 7780, 7898
>
> Moran I statistic standard deviate = 58.0851, p-value < 2.2e-16
> alternative hypothesis: greater
> sample estimates:
> Moran I statistic       Expectation          Variance
>     3.249438e-01     -1.213592e-04      3.131927e-05
>
> I wanted to test for the suitability of higher order neighbours and hence
> tried sp.correlogram which does not work with NAs. Is there a workaround?
> Also, on trying correlog() following suggestions in the ASDAR book, gives
> the following output:
>
>> vulcgrid.correlog <- correlog(coords, LNEMITPCAP, method = "Moran",
> nbclass=NULL)
> Error in correlog(coords, LNEMITPCAP, method = "Moran", nbclass = NULL) :
>  Bad selection of class breaks, try another one...
>
> How may I go about this? Do I need to manually specify distance bands? the
> data are not on a regular grid. The GIS file is an extract from a larger
> dataset for the conterminous US in North American Lambert Conformal Conic
> projection with NAD 1983 datum. Suggestions are greatly appreciated.
>
> Regards,
>
>

-- 
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