methods_localsrq: Methods for class localsrq

methods_localsrqR Documentation

Methods for class localsrq

Description

The plot() function allows the user to plot significant observations. The print() function is used to print the number of runs in each localization. Additional information of expected values and standard deviation, z-value ans p-value is prited for each observation.

Usage

## S3 method for class 'localsrq'
print(x, ...)

## S3 method for class 'localsrq'
plot(x, ..., sf = NULL, coor = NULL, sig = 0.05)

Arguments

x

a localsrq object created by Q.test.

...

further arguments passed to or from other methods.

sf

optional argument for plot() method to include a sf object (default = NULL)

coor

optional argument for plot() method to include coordinates of points (default = NULL)

sig

significant level for each observation in plot() method. Default sig = 0.05

Value

No return value, called for side effects

Author(s)

Fernando López fernando.lopez@upct.es
Román Mínguez roman.minguez@uclm.es
Antonio Páez paezha@gmail.com
Manuel Ruiz manuel.ruiz@upct.es

References

  • Ruiz, M., López, F., and Páez, A. (2021). A test for global and local homogeneity of categorical data based on spatial runs. working paper.

Examples

# Example 1: Local spatial runs test based on knn
library(lwgeom)
N <- 100
cx <- runif(N)
cy <- runif(N)
x <- cbind(cx,cy)
listw <- spdep::knearneigh(cbind(cx,cy), k = 10)
p <- c(1/6,3/6,2/6)
rho <- 0.5
fx <- dgp.spq(p = p, listw = listw, rho = rho)

# Asymtotic version
lsrq <- local.sp.runs.test(fx = fx, listw = listw, alternative = "less")
print(lsrq)
plot(lsrq, sig = 0.05)


spqdep documentation built on March 28, 2022, 5:06 p.m.