Description Usage Arguments Details Value Control arguments Author(s) References See Also Examples
View source: R/similarity.test.R
This function compute the similarity test for categorical spatial process.
1 2 |
formula |
a symbolic description of the factor (optional). |
data |
an (optional) data frame or a sf object containing the variable to testing for. |
fx |
a factor (optional). |
alternative |
a character string specifying the type of cluster, must be one of "High" (default), "Both" or "Low". |
distr |
A string. Distribution of the test "asymptotic" (default) or "bootstrap" |
nsim |
Number of permutations. |
control |
List of additional control arguments. |
Escribir aquí cosas
A object of the htest
data.name | a character string giving the names of the data. |
statistic | Value of the similarity test |
N | total number of observations. |
Zmlc | Elements in the Most Likelihood Cluster. |
alternative | a character string describing the alternative hypothesis. |
p.value | p-value of the similarity test |
similiarity.mc | values of the similarity test in each permutation. |
seedinit | Numerical value for the seed (only for boot version). Default value seedinit=123 |
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 |
Farber, S., Marin, M. R., & Paez, A. (2015). Testing for spatial independence using similarity relations. Geographical Analysis. 47(2), 97-120.
sp.runs.test
, dgp.spq
, Q.test
, , scan.test
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | rm(list = ls())
N <- 100
cx <- runif(N)
cy <- runif(N)
listw <- knearneigh(cbind(cx,cy), k = 3)
p <- c(1/4,1/4,1/4,1/4)
rho <- 0.5
fx <- dgp.spq(p = p, listw = listw, rho = rho)
W <- (nb2mat(knn2nb(listw)) >0)*1
similarity <- similarity.test(fx = fx, data = FastFood.sf, listw = listw)
print(similarity)
# Case 2: SRQ test with formula, a sf object (points) and knn
rm(list = ls())
data("FastFood")
coor <- cbind(FastFood.sf$Lon,FastFood.sf$Lat)
listw <- spdep::knearneigh(coor, k = 4)
formula <- ~ Type
similarity <- similarity.test(formula = formula, data = FastFood.sf, listw = listw)
print(similarity)
# Case 3:
rm(list = ls())
data("Spain")
listw <- spdep::poly2nb(as(spain.sf,"Spatial"), queen = FALSE)
formula <- ~ MenWoman
similarity <- similarity.test(formula = formula, data = spain.sf, listw = listw)
print(similarity)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.