misolationmap: Interactive multivariate isolation plot and map

View source: R/misolationmap.r

misolationmapR Documentation

Interactive multivariate isolation plot and map

Description

The function misolationmap draws a scatterplot with the pairwise Mahalanobis distances calculated using variables names.var between the observations and their neighbors on the y-axis and the "degree of isolation" of the observations on the x-axis and a map

Usage

misolationmap(sf.obj, nb.obj, names.var, propneighb = 0.4, chisqqu = 0.975,
  criteria = NULL, carte = NULL, identify = NULL, 
  cex.lab = 0.8, pch = 16, col = "lightblue3", xlab = "degree of isolation", 
  ylab = "Pairwise Mahalanobis distances", axes = FALSE, 
  lablong = "", lablat = "")

Arguments

sf.obj

object of class sf

nb.obj

object of class nb

names.var

a vector of character; attribute names or column numbers in attribute table

propneighb

proportion of neighbors included in ellipsoid

chisqqu

value of alpha for the definition of global outliers

criteria

a vector of size n of boolean which permit to represent preselected sites with a cross, using the tcltk window

carte

matrix with 2 columns for drawing spatial polygonal contours : x and y coordinates of the vertices of the polygon

identify

if not NULL, the name of the variable for identifying observations on the map

cex.lab

character size of label

pch

16 by default, symbol for selected points

col

color of the points on the cloud map

xlab

a title for the graphic x-axis

ylab

a title for the graphic y-axis

axes

a boolean with TRUE for drawing axes on the map

lablong

name of the x-axis that will be printed on the map

lablat

name of the y-axis that will be printed on the map

Details

The pairwise Mahalanobis distances are calculated using the robust Minimum Covariance Determinant (MCD) estimator associated with 75\% of observations (function covMcd in the robustbase package) calculated on the variables names.var. For each observation, the degree of isolation is a chi-square quantile of the conditional distribution of the pairwise Mahalanobis distances associated with the ellipsoid containing the proportion propneighb of neighbors. The parameter propneighb gives the proportion of neighbors that is expected to be quite similar to the observation in order to conclude that the observation is not a local outlier. Under independence and normality conditions, the user can expect a degree of isolation close by the parameter propneighb (vertical line on the scatterplot). An observation with a high degree of isolation is suspected to be a local outlier. Users have also the possibility to plot bubbles on the map which size depends on the robust Mahalanobis distance of each observation to the center of the distribution (function arw in the package mvoutlier).

Value

In the case where user click on save results button, a matrix of integer is created as a global variable in last.select object. It corresponds to the numbers of spatial unit corresponding to couple of sites selected just before leaving the Tk window.

Author(s)

Fizmoser P., Thomas-Agnan C., Ruiz-Gazen A., Laurent T.,

References

Thibault Laurent, Anne Ruiz-Gazen, Christine Thomas-Agnan (2012), GeoXp: An R Package for Exploratory Spatial Data Analysis. Journal of Statistical Software, 47(2), 1-23.

See Also

mvariocloudmap

Examples

if (require(robustbase, quietly = TRUE)) {
  ## data radarImage
  require("robustbase")
  data(radarImage)
}

# creation of a sf object
require(sf)
radarImage_sf <- st_as_sf(radarImage[1300:1573, ], coords = c("X.coord", "Y.coord"))

# creation of a spatial weight matrix nb
radarImage.nb <- spdep::dnearneigh(radarImage_sf, 0, 1.5)

# example of use of misolationmap
# The statistics are calculated by taking into account variables
# Ag,As,Bi,Cd,Co,Cu,Ni
misolationmap(radarImage_sf, radarImage.nb, names.var = c("Band.1","Band.2","Band.3"),
   propneighb = 0.30, chisqqu = 0.95, cex.lab = 0.5)

tibo31/GeoXp documentation built on April 8, 2023, 7:50 a.m.