0

I am using localmoran from spdep, which adjusts p values for multiple comparisons based on p.adjustSP. I want to use the holm correction, but I'm not sure if something is wrong as I noticed that whether I specify holm, bonferroni, or hochberg, it all results in the same adjusted p values. If I don't specify a correction, the uncorrected p values look fine. Has anyone else encountered this, and does it mean something is wrong? Or is it possible for all of those corrections to result in the same value? Thanks!

edited to add example (not my actual data):

  library(spdep)
dat <- st_read(system.file("etc/shapes/bhicv.shp", package="spdep")[1])

# create neighborhood
neighbourhood <- poly2nb(dat, queen=TRUE)

neighbourhood_weights_list <- nb2listw(neighbourhood,style="W", zero.policy=TRUE)

# add unadjusted p values
dat$lmoran_pNONE <- localmoran(dat$ELCI,neighbourhood_weights_list,p.adjust.method="none",
                                    na.action=na.exclude,zero.policy=TRUE)[,5]

# add adjusted p values
dat$lmoran_pHOLM <- p.adjustSP(dat$lmoran_pNONE, neighbourhood, method = "holm")
dat$lmoran_pBONF <- p.adjustSP(dat$lmoran_pNONE, neighbourhood, method = "bonferroni")

# show p values
head(dat[10:12])
pbandj
  • 11
  • 1
  • 1
    It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. – MrFlick May 15 '20 at 19:29
  • `p.adjustSP` calls `stats::p.adjust`, which should be well tested. How many groups do you have? The adjustments might be similar numerically. – thorepet May 15 '20 at 19:34
  • I have 89 polygons with various neighborhood sizes. The largest number of neighbors is 10, average number is around 5. As p.adjustSP uses number of neighbors + 1, I think my largest group is 11. – pbandj May 18 '20 at 18:37

0 Answers0