methods_localsrq {spqdep} | R 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 |
... |
further arguments passed to or from other methods. |
sf |
optional argument for |
coor |
optional argument for |
sig |
significant level for each observation in |
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
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)