Skip to content
Prev 25795 / 29559 Next

[Local.moran.exact] Error in integrate : evaluation of function gave a result of wrong type

On Mon, 17 Jul 2017, Lisa Menez wrote:

            
Thanks for providing a reprex.

First, the points you are using are in geographical coordinates, which you 
ignore when calculating distances, so the distance criterion and the 
first nearest neighbours are wrong.

Second, you include all NUTS regions, including Reunion and other very 
overseas territories, with the consequence that most regions are defined 
as each other's neighbours (there are ~ 50% non-zero weights). This is far 
from sparse! Please motivate your choice of regions - it is very hard to 
argue that Reunion influences its nearest neighbours (Crete, Cyprus??). 
With so many neighbours on average, the spatial weights are all small.

Third, you do not motivate using the error Durbin model. If you do not use 
it, localmoran.exact.alt() does complete. However, few of the exact 
p-values for alternative="greater" are "significant" (t0 with Omega=Omega, 
t1 with Omega=diag(276) - the identity matrix):
0.9, 0.99, 0.999, 1)))

   1   2   3   4   5   6   7
   1   6  34 108 104  21   2
0.9, 0.99, 0.999, 1)))

  1  2  3  4  5  6  7
  7 13 48 94 90 22  2

So using the alternative model taking account of global autocorrelation 
does have an effect (7 not 20 regions with unadjusted p < 0.01), but for 
an odd selection of units and weights).

Note that p-values must be adjusted for multiple comparisons, for example:
0.01, 0.1, 0.5, 0.9, 0.99, 0.999, 1)))

   3   4   5   6   7
   1  13 133 125   4
0.01, 0.1, 0.5, 0.9, 0.99, 0.999, 1)))

  1  2  3  4  5  6  7
  1  2 11 91 71 96  4


So unless we know that you actually wanted to do what you did, 1-3 above 
suggest that your choices need to be motivated.

Hope this clarifies,

Roger