Learn R Programming

spqdep (version 0.1.3.6)

methods_localjc: Methods for class localjc

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 localjc
print(x, ...)

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

Value

No return value, called for side effects

Arguments

x

a localjc 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

Author

Fernando Lópezfernando.lopez@upct.es
Román Mínguezroman.minguez@uclm.es
Antonio Páezpaezha@gmail.com
Manuel Ruizmanuel.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

Run this code
# Example 1: Local spatial runs test based on knn
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)

Run the code above in your browser using DataLab