[R-sig-Geo] Correlograms of Moran's I with progressive Bonferroni correction
Mingke Li
m||@er|n1919 @end|ng |rom gm@||@com
Sun Mar 17 00:48:31 CET 2019
Dear list,
I am trying to generate a correlogram of Moran's I, with symbols showing if
the coefficient is significant or not after the progressive Bonferroni
correction. Now I'm using the "correlog" function in the package ncf to
calculate the coefficients among all distance classes. I symbolized the
dots in the plot to show if they are significant or not (after progressive
Bonferroni correction), say, open circles for non-significant coefficients,
and solid circles for significant coefficients.
These are the codes I used in R:
>correlog.L2.2014new <- correlog(Grid.2014.all$Lng, Grid.2014.all$Lat,
Grid.2014.all$L2_Average,latlon = T, na.rm=T, increment=5, resamp=200)
>for (i in list(1:length(correlog.L2.2014new$p))) {
correlog.L2.2014new$adjp[i]=correlog.L2.2014new$p[i]*i
}
>plot(correlog.L2.2014new$correlation[1:80], type="b", cex=1.5, lwd=1.5,
ylim=c(-0.1,0.7),
pch=ifelse(((correlog.L2.2014new$adjp>0.05)),1,16),
xlab="Distance (km)", ylab="Moran's I", cex.lab=2, cex.axis=1.5);
abline(h=0)
I also found the function "sp.correlogram" in the package spdep to make the
correlogram with Bonferroni correction.
Now I have three questions:
1. Can I set a "up-limit" to the "correlog" function? For example, if I
just need the first 80 distance classes to generate the graph (as shown in
the plot code), is it possible to let the "correlog" function skip the rest
distance classes to save the computation time?
2. Is my code of generating p values after the progressive Bonferroni
correction correct? If not, how should I fix it?
3. Now I'm kind of correcting the p value manually based on my
understanding of progressive Bonferroni correction. Is there any function
in any R packages for creating correlograms with progressive Bonferroni
correction? "sp.correlogram" has a parameter setting "p.adj.method" but it
seems do not have a progressive Bonferroni correction option?
I just start to work with the correlograms recently; any advice or
solutions are welcome. Thank you in advance!
Erin
[[alternative HTML version deleted]]
More information about the R-sig-Geo
mailing list