Learn R Programming

spots (version 0.1.0)

PermutationLag: Permutation based p-value for spatial lag

Description

Calculate permutation based p-value for spatial lag.

Usage

PermutationLag(
  x,
  W,
  n = 999,
  seed = 1,
  alternative = c("two.sided", "less", "greater"),
  p.adjust.method = "BH",
  condition = 0,
  return.permutation = FALSE
)

Arguments

x

A numerical vector.

W

A weight matrix across all observations, i.e inverse of a pairwise distance matrix.

n

The number of permutations to be conducted, set to 999 by default.

seed

Random seed used. Default is 1.

alternative

Alternative hypothesis used, default is two.sided.

p.adjust.method

Method used for multiple comparisons correction, default is BH. See p.adjust.

condition

Value under null hypothesis to compare with, default is 0.

return.permutation

Return permutations. Default is FALSE.

Value

A list containing the following:

  • lag, spatial lag.

  • p.val, permutation based p-value.

  • p.adj, adjusted p-values.

  • return.permutation, permutation used if returned.