Dear list,

Maybe someone can shed some light on this error. I have a dataset with
thousands of candidates with electoral support per city. I wrote a R script
to calculate both Moran.test and Moran.MC (99999 iterations), and also
Geary C test.
The script run very fine, but at the end I have noticed that a few of my
cases (candidates) didn't have a result to Moran.test's standard deviation
and p-value. All estimates and values were normal for Moran.MC and Geary's
C.

The problem seems to be the following error:



Moran's I test under randomisation

data:  votoscandidato
weights: UF.listw.W

Moran I statistic standard deviate = NaN, p-value = NA
alternative hypothesis: two.sided
sample estimates:
Moran I statistic       Expectation          Variance
     5.723951e-03     -2.409639e-03     -8.785771e-09
Mensagens de aviso perdidas:1: In sqrt(VI) : NaNs produzidos2: In
moran.test(x = votoscandidato, listw = UF.listw.W, zero.policy = TRUE,
 :
  Out-of-range p-value: reconsider test arguments





I checked the source data and those cases with such an error seem to
be cases with a lot of zero votes in many of the cities. But the same
problem does not affect Geary's C or Moran.MC (probably because of the
high number of iterations).



Maybe this is the problem? Any help or tips will very much appreciated.



Best regards,



FABRICIO

	[[alternative HTML version deleted]]

