moranPermutationTest: Derive Moran's I p-value using permutation testing

View source: R/correlationStatistics.R

moranPermutationTestR Documentation

Derive Moran's I p-value using permutation testing

Description

Derive Moran's I p-value using permutation testing

Usage

moranPermutationTest(
  z,
  w,
  alternative = "greater",
  N = 10000,
  seed = 0,
  ncores = 1,
  plot = FALSE,
  ...
)

Arguments

z

Feature value

w

Adjacency weight matrix

alternative

"two.sided", "less", or "greater"

N

Number of permutations

seed

Random seed

ncores

Number of cores for parallel processing

plot

Plot permutated distribution

...

Additional parameters to pass to histogram plotting

Value

Observed Moran's I statistic, the expected statistic under the null hypothesis of no spatial autocorrelation, the standard deviation under the null hypothesis, permutation p-value, and number of permutations

Examples

data(mOB)
pos <- mOB$pos
weight <- getSpatialNeighbors(pos)
gexp <- normalizeCounts(mOB$counts, log=FALSE, verbose=FALSE)['Camk4',]
moranPermutationTest(gexp, weight)


JEFworks/MERingue documentation built on June 11, 2022, 4:16 a.m.