spatialDiag {geocmeans}R Documentation

Spatial diagnostic

Description

Utility function to facilitate the spatial diagnostic of a classification

Calculate the following indicators : Moran I index (spdep::moranI) for each column of the belonging matrix, Join count test (spdep::joincount.multi) for the most likely groups of each datapoint, Spatial consistency index (see function spConsistency)

Usage

spatialDiag(belongmatrix, nblistw, undecided = NULL, nrep = 50)

Arguments

belongmatrix

A membership matrix

nblistw

A list.w object describing the neighbours (spdep package)

undecided

A float between 0 and 1 giving the minimum value that an observation must get in the membership matrix to not be considered as uncertain (default = NULL)

nrep

An integer indicating the number of permutation to do to simulate the random distribution of the spatial inconsistency

Value

A named list with :

Examples

data(LyonIris)
AnalysisFields <-c("Lden","NO2","PM25","VegHautPrt","Pct0_14","Pct_65","Pct_Img",
"TxChom1564","Pct_brevet","NivVieMed")
dataset <- LyonIris@data[AnalysisFields]
queen <- spdep::poly2nb(LyonIris,queen=TRUE)
Wqueen <- spdep::nb2listw(queen,style="W")
result <- SFCMeans(dataset, Wqueen,k = 5, m = 1.5, alpha = 1.5, standardize = TRUE)
spatialDiag(result$Belongings, Wqueen, undecided=0.45, nrep=30)

[Package geocmeans version 0.1.1 Index]