Pvalue=0 Moran test

Hello I am trying to computes Moran's I autocorrelation coefficient of x giving a matrix of weights using the ape package. The null hypothesis of no correlation is tested assuming normality of the Moran's coefficient under this null hypothesis. I got a p-value=0
Does it mean that the p value is incredibly small that R cannot approximate it?
What is the lowest number that R displays before rounding it to 0? Can I change any options to get a number different than zero?

Thanks a lot

ape::Moran.I(residuals(mod_glm), distm.inv)                 

moran.test

Results


$observed
[1] 0.04225105

$expected
[1] -0.001015228

$sd
[1] 0.001640934

$p.value
[1] 0

Base R's double data type can represent numbers down to 2e-308. You can see this in the help text of the double() function. My experience is that functions that return a p value have their own cutoff. The lm() function, for example, will list <2.2e-16 for very small values. I did not see a limit mentioned in the documentation of the ape package or the Moran.I() function.
The first thing I would do after getting such a low p value is check the values in residuals(mod_glm). Are they all zero?
My own experience is that when I get such a good result I have not run the fit I intended.

@FJCC mm no :thinking:
The are no 0

residuals(mod_GLM)
1 2 3 4 5 6
-0.4795879453 -0.5865959159 -0.1072381822 -0.1185835661 -0.0072076473 -0.0232430401
7 8 9 10 11 12
-0.0045346784 -0.0040632163 -0.0057323342 -0.3150560207 -0.6501913410 -0.0844160768
13 14 15 16 17 18
-0.6295543446 -0.1131041462 -0.0292285583 -0.3069409642 -0.2953554592 -0.0906589148
19 20 21 22 23 24
-0.2052807307 -0.0585149578 -0.0536559773 -0.2590147408 -0.2501625960 -0.2416918449
25 26 27 28 29 30
-0.2264125632 -0.2244894819 -0.2665110992 -0.5612372387 -0.6762955644 -0.2505871069
31 32 33 34 35 36
-0.4465504133 -0.0911007375 -0.3897845115 -0.1118957752 -0.0064747285 -0.1214453094
37 38 39 40 41 42
-0.0093220925 -0.0076578763 -0.0234966490 -0.0244239066 -0.0065412231 -0.0193059483
43 44 45 46 47 48
-0.0765151951 -0.0718666976 -0.0612580551 -0.0173491134 -0.0518765450 -0.0415465453
49 50 51 52 53 54

I am not too familiar with the {ape} package (I am more of a social sciences person). But having said that my first impulse should Moran's I start to behave funny on me would be to double check using other implementations; spdep::moran.test() and sfdep::global_moran_test() come to my mind.

1 Like

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.