View
7
Download
0
Category
Preview:
Citation preview
The GeoXp PackageOctober 23 2006
Type Package
Title Interactive exploratory spatial data analysis
Version 10
Date 2006-10-20
Author Christine Thomas-Agnan Yves Aragon Anne Ruiz-Gazen Thibault Laurent LaurianneRobidou
Maintainer Christine Thomas-Agnan ltcthomascictfrgt
Depends R (gt= 221) tcltk maptools fields splancs KernSmooth stats
Description GeoXp is a tool for researchers in spatial statistics spatial econometrics geographyecology etc allowing to link dynamically statistical plots with elementary maps This couplingconsists in the fact that the selection of a zone on the map results in the automatic highlighting ofthe corresponding points on the statistical graph or reversely the selection of a portion of thegraph results in the automatic highlighting of the corresponding points on the map GeoXpincludes tools from different areas of spatial statistics including geostatistics as well as spatialeconometrics and point processes Besides elementary plots like boxplots histograms or simplescatterplos GeoXp also couples with maps Moran scatterplots variogram cloud LorentzCurvesIn order to make the most of the multidimensionality of the data GeoXp includes somedimension reduction techniques such as PCA
License GPL Version 2 or later
URL httpw3univ-tlse1frGREMAQStatistiqueSP_etheme3pdf
R topics documentedGeoXp-package 2afcon 4angleplotmap 5auckpolys 7auckland 8baltimore 9barmap 10boston 12boxplotmap 13carte 15
1
2 GeoXp-package
clustermap 17dbledensitymap 20dblehistomap 22densitymap 24distchi2 27driftmap 28eire 29eirepolys 30findneighbors 31genpca 32gini 34ginimap 35graphique 37histobarmap 39histomap 41makedistanceW 43makeneighborsw 44map2list 45meuseall 46meuseriv 48moranplotmap 48neighbourmap 51nonormmoran 53normw 54oldcol 55oldcolpolys 56pcamap 57polyboxplotmap 60polylist2list 62rotation 63scattermap 64selectgraph 66selectmap 67selectstat 68slider1 69slider2 70spdf2list 71variocloudmap 72
Index 75
GeoXp-package Interactive exploratory spatial data analysis
Description
GeoXp is a tool for researchers in spatial statistics spatial econometrics geography ecology etcallowing to link dynamically statistical plots with elementary maps This coupling consists in thefact that the selection of a zone on the map results in the automatic highlighting of the correspondingpoints on the statistical graph or reversely the selection of a portion of the graph results in theautomatic highlighting of the corresponding points on the map GeoXp includes tools from differentareas of spatial statistics including geostatistics as well as spatial econometrics and point processes
GeoXp-package 3
Besides elementary plots like boxplots histograms or simple scatterplos GeoXp also couples withmaps Moran scatterplots variogram cloud Lorentz Curves In order to make the most of themultidimensionality of the data GeoXp includes some dimension reduction techniques such asPCA
Details
Package GeoXpType PackageVersion 10Date 2006-10-20License GPL Vesion 2 or later
GeoXp donrsquot use classes yet The coordinates of sites are represented by two vectors long (forx minus axis) and lat (for y minus axis) of size n of numeric values Attribute value is designed by ar-gument var of size n and can be a vector of numeric values (function histomap densitymap)or a factor (function barmap) Some functions use both a vector of numeric values and a factor(function histobarmap polyboxplotmap) Few functions as pcamap and clustermap use a matrixof numeric variablesContrary to spdep package (Roger Bivand) a site cannot be represented by latticearea style How-ever user can represent a spatial polygonal contour as background map with option carte A spatialpolygonal contour is a matrix of numeric values with 2 columns (x and y coordinates of the ver-tices of the polygons) where polygons are seperated from each other by 3 rows of NaN We includein GeoXp 3 functions (polylist2list spdf2list and map2list) which convert some spatial objects(lsquoPolylistrsquo lsquoSpatialPolygonDataFramersquo and lsquoMaprsquo object) into matrix as decribed above to draw abackground mapAmong options which are common to each function users have the possibility to give a criteriavector of boolean of size n with TRUE on specific sites These sites are then represented by a croiceon the map by clicking on lsquonon intercative selectionrsquo buttonMoreover users have the possibility to make bubbles and add some graphs (histogram barplot orscattermap) giving both a matrix of variables listvar of size n times p and a list of character of sizep for variable names Users can choose a proportional symbol mapping in function plot we givevalue var05 to argument cex User can choose if a legend has to appear on the map He couldchoose then three values represented by bubbles of corresponding sizesFinally users can choose to represent sites on map with different colors (choosed by default and notmodifiable by users) in the case of a graph using a factor (argument color with 1 for different col-ors 0 otherwise) Users could choose if a legend with corresponding colors will appear on the mapUsers can also modify the representation of sites on map (choosed by default and not modifiable byusers) with argument symbol (with 1 for different symbols 0 otherwise)
Author(s)
Christine Thomas-Agnan Yves Aragon Anne Ruiz-Gazen Thibault Laurent Laurianne Robidou
Maintainer Christine Thomas-Agnan ltcthomascictfrgt
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
4 afcon
afcon Spatial patterns of conflict in Africa 1966-78
Description
The afcon data frame has 42 rows and 5 columns for 42 African countries exclusing then SouthWest Africa and Spanish Equatorial Africa and Spanish Sahara The dataset is used in Anselin(1995) and downloaded from before adaptation
Usage
data(afcon)
Format
A data frame with 42 observations on the following 5 variables
x an easting in decimal degrees (taken as centroiumld of shapefile polygon)
y a northing in decimal degrees (taken as centroiumld of shapefile polygon)
totcon index of total conflict 1966-78
name country name
id country id number as in paper
Details
This data provides from spdep package
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin L and John OrsquoLoughlin (1992) ldquoGeography of international conflict and cooperationspatial dependence and regional context in Africardquo In The New Geopolitics ed M Ward pp39-75
Anselin L (1995) ldquoLocal indicators of spatial associationrdquo In Geographical Analysis 27 Table1 p103
Examples
data(afcon)
angleplotmap 5
angleplotmap Detection of an eventual directional trend
Description
The function lsquoangleplotmaprsquo is used to detect an eventual directional trend associated to variablevar It represents the absolute difference between the value of var at two sites as a function of theangle between vector minusminusrarrsisj and the x-axis
Usage
angleplotmap(long lat var quantiles = NULLlistvar = NULL listnomvar = NULLcriteria = NULL carte = NULL label = symbol = 0 labvar = lablong = lablat = axis = FALSE)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
6 angleplotmap
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
axis a boolean with TRUE for drawing axes on the map
Details
For each couple of sites (si sj) the graphic represents on the y-axis the absolute difference betweenvari and varj
Dij = |vari minus varj |and on the x-axis the angle θij between the vector minusminusrarrsisj and the x-axis Possibility to represent asmoothing spline regression quantile gα For 0 lt α lt 1
Pr[Dij lt gα(θij)] = α
If that case only the pair of sites (si sj) verifying
Dij gt gmax(α)(θij)
are represented
Value
A matrix of boolean of size ntimes n TRUE if pair of sites was in the last selection
Author(s)
Thomas-Agnan Christine Aragon Yves Ruiz-Gazen Anne Laurent Thibault Robidou Laurianne
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
variocloudmapdriftmap
Examples
Data afcondata(afcon)obslt-angleplotmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon))symbol=1)
Data Meusedata(meuseall)data(meuseriv)obslt-angleplotmap(meuseall$xmeuseall$ymeuseall$copperlablong=Xlablat=Yquantiles=c(0105095)listvar=meusealllistnomvar=names(meuseall)labvar=Concentration en plomb (en ppm))points(meuseriv type = l asp = 1)
auckpolys 7
auckpolys Spatial polygonal contours of auckland dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of auckland dataset
Usage
data(auckpolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonDataFramersquo or rsquoMaprsquo object because a site can only berepresented by a pair of coordinates and not by a polygonnal contour However users have the pos-sibility to repesent spatial polygonal contours as a backgroud map Thatrsquos why we created functionslsquospdf2listrsquo lsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of thepolygons
Source
Marshall R M (1991) Mapping disease and mortality rates using Empirical Bayes Estimators Ap-plied Statistics 40 283-294
Bailey T Gatrell A (1995) Interactive Spatial Data Analysis Harlow Longman - INFOMAP dataset used with permission
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)
8 auckland
auckland Marshallrsquos infant mortality in Auckland dataset
Description
The Auckland data frame has 167 rows (census area units - CAU) and 4 columns
Usage
data(auckland)
Format
A data frame with 167 observations on the following 4 variables
Easting a numeric vector of x coordinates in an unknown spatial reference system
Northing a numeric vector of y coordinates in an unknown spatial reference system
Deaths197785 a numeric vector of counts of infant (under 5 years of age) deaths in Auckland1977-1985
Under51981 a numeric vector of population under 5 years of age at the 1981 Census
Details
This data provides from spdep package
Source
Bailey T Gatrell A (1995) Interactive Spatial Data Analysis Harlow Longman - INFOMAP dataset used with permission
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Marshall R M (1991) Mapping disease and mortality rates using Empirical Bayes Estimators Ap-plied Statistics 40 283-294
Examples
data(auckland)
baltimore 9
baltimore House sales prices Baltimore MD 1978
Description
House sales price and characteristics for a spatial hedonic regression Baltimore MD 1978
Usage
data(baltimore)
Format
A data frame with 211 observations on the following 17 variables
STATION StationPRICE PriceNROOM Number of roomsDWELL Presence of well (0 or 1)NBATH Number of bathsPATIO Presence of patio (0 or 1)FIREPL Presence of fire stationAC ACBMENT BMENTNSTOR NSTORGAR Number of garagesAGE AgeCITCOU CITCOULOTSZ LOTSZSQFT SQFTX a vector x of size n
Y a vector y of size n
Details
This data provides from spdep package
Source
Prepared by Luc Anselin Original data made available by Rodin Dubin Weatherhead School ofManagement Case Western Research University Cleveland OH
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Dubin Robin A (1992) Spatial autocorrelation and neighbourhood quality Regional Scienceand Urban Economics 22(3) 433-452
10 barmap
Examples
data(baltimore)
barmap Interactive Bar plot and map
Description
The function lsquobarmaprsquo draws a bar plot (vertical bar) of the given factor variable var and a mapwith sites of coordinates (long lat)
Usage
barmap(long lat var listvar = NULL listnomvar = NULLcriteria = NULL carte = NULL label = color = 1symbol = 0 labvar = labmod = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of factor of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with name of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
barmap 11
labvar name of variable var
labmod names of factors of var
axis 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 selection of a bar on the bar plot results in the corresponding sites coloured on the map with thecorresponding colour observed on the bar Reversely the selection of sites on the map by lsquopointsrsquoor lsquopolygonrsquo results in the drawing of the sub-barplot in red
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
Examples
data oldcoldata(oldcol)data(oldcolpolys)oldcolcontourslt-polylist2list(oldcolpolys)barmap(oldcol$X oldcol$Y oldcol$NSA listvar=oldcolcarte=oldcolcontourslistnomvar=names(oldcol)criteria=(oldcol$CP==1)axis=TRUElablong=Xlablat=Y)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)barmap(eire$V1eire$V2eire$palecarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
12 boston
boston Corrected Boston Housing Data
Description
The boston data frame has 506 rows and 20 columns It contains the Harrison and Rubinfeld(1978) data corrected for a few minor errors and augmented with the latitude and longitude of theobservations Gilley and Pace also point out that MEDEV is censored in that median values at orover USD 50000 are set to USD 50000
Usage
data(boston)
Format
A data frame with 506 observations on the following 22 variables
x a vector x of size n
y a vector y of size n
TOWN a factor with levels given by town names
TOWNNO a numeric vector corresponding to town
TRACT a numeric vector of tract ID numbers
LON a numeric vector of tract point longitudes in decimal degrees
LAT a numeric vector of tract point latitudes in decimal degrees
MEDV a numeric vector of median values of owner-occupied housing in USD 1000
CMEDV a numeric vector corrected median values of owner-occupied housing in USD 1000
CRIM a numeric vector of per capita crime
ZN a numeric vector of proportions of residential land zoned for lots over 25000 sq ft per town(constant for all Boston tracts)
INDUS a numeric vector of proportions of non-retail business acres per town (constant for allBoston tracts)
CHAS a factor with levels 1 if tract borders Charles River 0 otherwise
NOX a numeric vector of nitric oxides concentration (parts per 10 million) per town
RM a numeric vector of average numbers of rooms per dwelling
AGE a numeric vector of proportions of owner-occupied units built prior to 1940
DIS a numeric vector of weighted distances to five Boston employment centres
RAD a numeric vector of an index of accessibility to radial highways per town (constant for allBoston tracts)
TAX a numeric vector full-value proprty-tax rate per USD 10000 per town (constant for all Bostontracts)
PTRATIO a numeric vector of pupil-teacher ratios per town (constant for all Boston tracts)
B a numeric vector of 1000 lowast (Bk minus 063)2 where Bk is the proportion of blacks
LSTAT a numeric vector of percentage values of lower status population
boxplotmap 13
Details
This data provides from spdep package
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Harrison David and Daniel L Rubinfeld ldquoHedonic Housing Prices and the Demand for CleanAirrdquo Journal of Environmental Economics and Management Volume 5 (1978) 81-102 Originaldata
Gilley OW and R Kelley Pace ldquoOn the Harrison and Rubinfeld Datardquo Journal of EnvironmentalEconomics and Management 31 (1996) 403-405 Provided corrections and examined censoring
Pace R Kelley and OW Gilley ldquoUsing the Spatial Configuration of the Data to Improve Estima-tionrdquo Journal of the Real Estate Finance and Economics 14 (1997) 333-340
Examples
data(boston)
boxplotmap Interactive boxplot and map
Description
The function lsquoboxplotmaprsquo draws a boxplot of the given variable var and a map with site of coor-dinates (long lat)
Usage
boxplotmap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
14 boxplotmap
listnomvar list of character of size p with names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar name of variable var
axis 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
There is an interactivity only in one direction the sites selected by interquartile on the boxplot arerepresented on the map in red
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
carte 15
Examples
donnees oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)boxplotmap(oldcol$X oldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CP==1)axis=TRUElablong=Xlablat=Y)
donnees bostondata(boston)boxplotmap(boston$xboston$yboston$CRIMlistvar=bostonlistnomvar=names(boston)criteria=(boston$CHAS==1))
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)boxplotmap(eire$V1eire$V2eire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Taux deacutevolution de la population de 1921 agrave1962)
carte Drawing a map
Description
The function lsquocartersquo draws a map with sites of coordinates (long lat) and represents sites whichhave been selected (obs) in red if symbol=0 or with star if symbol=1 This function is called bymost of the functions of GeoXp (this is not an interactive function)
Usage
carte(long lat obscriteria=NULLbuble=FALSEcbuble=NULLnointer=FALSE carte=NULLnocart=FALSE label=symbol=0col=0 lablong= lablat= method= W=NULL couleurs=classe obsqlegmap=NULLlegends=list(FALSEFALSE)labmod=axis=FALSE)
Arguments
long a vector x of size n
lat a vector y of size n
obs a boolean vector of size n with TRUE on selected sites
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
16 carte
buble a boolean with TRUE for drawing bubbles FALSE otherwise
cbuble vector of size n with size of each site depending on variable with which bubblesare constructed
nointer a boolean with TRUE for drawing sites selected by criteria FALSE otherwise
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
nocart a boolean with TRUE for drawing spatial contours FALSE otherwise
label vector of character of size n with name of each site
col 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points are inred if 1 selected points are stars
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
method Specification for some graphics such as lsquoNeighbourplot1rsquo lsquoNeighbourplot2rsquolsquoClusterrsquo lsquoAngleplotrsquo lsquoVariocloudrsquo
W neighbourhood matrix of size ntimes n necessary when method=lsquoNeighbourplotrsquo
couleurs Possibility to change colors (only for admin)
classe vector of n whith class necessary when method=lsquoClusterrsquo
obsq vector of size n with number of quadrant to which the site belongs necessarywhen method=lsquoQuadrantrsquo
legmap a list of (numericnumericnumericnumericnumericnumericcharacter) with thesizes and the corresponding values of the 3 bubbles represented in the legend andthe variable name of variable choosed
clustermap 17
legends a list of c(booleanbooleanc(numericnumeric)c(numericnumeric)) with TRUEfor drawing legends of bubbles (1st argument) or factors (2nd argument) and thecoordinates of the location of the upper left corner of the legend box
labmod Name of factors
axis a boolean with True for drawing axes on the map
Details
For factors possibility to represent sites with different colors for each level Others options permitto represent with a croice some sites with special lsquocriteriarsquo with lsquobubblersquo according to a variablegiven a spatial contours with lsquocartersquo names of sites with lsquolabelrsquo or a representation in flowerPossibility to draw a legend giving the sizes of bubbles and colors of levels
Value
No values only drawing of a map
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
clustermap Classification of dataset using kmeansr or hclustr and representationof clusters on a map
Description
The function lsquoclustermaprsquo performs a classification of the sites from the variables included indataset and computes a bar plot of the clusters calculated Classification methods comes fromhclustR (hierarchical cluster analysis) and kmeansR (k-means clustering) and number of class ischosen with clustnum
Usage
clustermap(longlatdatasetclustnummethod=kmeanstype=NULLcenters=NULLscale=FALSElistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabvar=Clusterlabel=symbol=0color=1labmod=axis=FALSElablong= lablat=)
18 clustermap
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix of variables of numeric values
clustnum Number of clusters
method two methos lsquokmeansrsquo by default or lsquohclustrsquo
type If method=lsquohclustrdquo type=ldquocompleterdquo by default (the possibilities are given inhelp(hclust) as lsquowardrsquo lsquosinglersquo etc) If method=lsquokmeansrsquo type=Hartigan-Wong by default (the possibilities are given in help(kmeans) as lsquoForgyrsquo etc)
centers If method=rsquokmeansrsquo user can give a matrix with initial cluster centers
scale If scale=TRUE the dataset is reducted
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
labvar name of variable var
label vector of size n with names of each site
color 0 or 1 (by default) choice of representation of selected points If 0 sites arerepresented in blue if 1 sites are represented with different colors for eachcluster
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labmod names of Clusters
clustermap 19
axis 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 two windows are interactive the sites selected by a bar chosen on the bar plot are representedon the map in red and the values of sites selected on the map by lsquopointsrsquo or lsquopolygonrsquo are representedin red on the bar plot The dendogram is also drawn for rsquohclustrsquo method In option possibility tochoose the classification method
Value
A vector of boolean of size n (TRUE if the site was in the last selection) and a vector of size nwhith the number of cluster for each site
Note
To use the functions hclustr and kmeansr we take many arguments by default If the user wouldlike to modify these arguments he should call these functions first and then use the functionbarmapr to visualize the calculated clusters
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Murtagh F (1985) ldquoMultidimensional Clustering Algorithmsrdquo
Hartigan J A and Wong M A (1979) A K-means clustering algorithm Applied Statistics 28100-108
See Also
barmap pcamap
Examples
donneacutees oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)obslt-clustermap(oldcol$X oldcol$Yoldcol[712]3listvar=oldcollistnomvar=names(oldcol)carte=contoursOLDcriteria=(oldcol$CP==1))
20 dbledensitymap
data avifaunelibrary(ade4)data(mafragh)dlt-distchi2(mafragh$flo)
obslt-clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4method=hclusttype=wardlistvar=mafragh$partitionlistnomvar=class)
claslt-obs$vectclasselt-by(dclasmean)glt-rbind(e[1]$1e[2]$2e[3]$3e[4]$4)
clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4centers=glistvar=mafragh$partitionlistnomvar=class)
dbledensitymap Double Kernel density estimates and map
Description
The function lsquodbledensitymaprsquo plots two kernel density estimates from var1 and var2 computedwith lsquobkdeRrsquo and a map with sites of coordinates (long lat) Each site is associated to a value ofvar1 and var2 and the two windows are interactive
Usage
dbledensitymap(long lat var1 var2kernel=triweight listvar = NULLlistnomvar = NULL carte = NULL criteria = NULL label = symbol = 0 color = 1 labvar = c(var1 var2) axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
dbledensitymap 21
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar list of character with names of variables var1 and var2
axis 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 user can choose an interval on the density curve by mouse clicking on the lower and upperboundaries of the interval or by giving directly these values The selected sites are then representedon the map in red A selection by lsquopointsrsquo or lsquopolygonrsquo on the map results in the drawing of thedensity of the corresponding sub-distribution on the density plot Finally the user can modify thebandwith parameter with a cursor in the tcltk window (parameter α) α is the smoothing parameterfor the kernel smooth it represents the mean percentage of sample points involved in the localaveraging (example α = 20 means that on average ntimes 02 points are in any interval of length 2hwhere h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
22 dblehistomap
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dbledensitymap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785))) listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-dbledensitymap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)dbledensitymap(eire$V1eire$V2eire$Aeire$townslabvar=c(Taux dindividus au groupe sanguin ASurface urbaine)carte=eirecontourskernel=normallistvar=eirelistnomvar=names(eire))
dblehistomap Double Interactive Histogram and map
Description
The function lsquodblehistomaprsquo draws two histograms of the given variables var1 and var2 and a mapwith sites of coordinates (long lat) Each site is associated to a value of var1 and var2 and thereis interactivity between the two windows created
dblehistomap 23
Usage
dblehistomap(long lat var1 var2 listvar = NULL listnomvar = NULLnbcol1 = 10 nbcol2 = 10 carte = NULL criteria = NULLsymbol = 0 color = 1 labvar = c( ) label = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
nbcol1 number of cells for histogram 1 (10 by default)
nbcol2 number of cells for histogram 2 (10 by default)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
24 densitymap
Details
The selection of sites by lsquopointsrsquo or lsquopolygonsrsquo on the map results in the drawing of the red his-tograms of the subdistributions corresponding to this subset of sites
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dblehistomap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785)))listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadblehistomap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
densitymap Kernel density estimates and map
Description
The function lsquodensitymaprsquo draws kernel density estimates of the variable var with rsquobkdeRrsquo anda map with sites of coordinate (long lat) Each site is associated to a value of var and there isinteractivity between the two windows
densitymap 25
Usage
densitymap(long lat varkernel=triweightlistvar=NULLlistnomvar=NULLcarte=NULL criteria=NULLlabel=symbol=0color=1 labvar=axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
labvar name of variable var
axis 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
26 densitymap
Details
The user can choose an interval on the density curve by mouse clicking on the graph on the extremi-ties of interval or by specifying directly values The sites selected by an interval are then representedon the map in red The selection of sites on the map by lsquopointsrsquo or lsquopolygonrsquo results in the draw-ing of the kernel densities of the subdistributions corresponding to this subset of sites Finally theuser can modify the bandwith parameter with a cursor in the tcltk window (parameter α) α is thesmoothing parameter for the kernel smooth it represents the mean percentage of sample pointsinvolved in the local averaging (example α = 20 means that on average ntimes 02 points are in anyinterval of length 2h where h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
library tcltk and KernSmooth data olcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)densitymap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadensitymap(colombuscontours$Xcolombuscontours$Ycolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)
distchi2 27
data(eirepolys)eirecontourslt-polylist2list(eirepolys)densitymap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
distchi2 It gives an euclidian distance matrix for factors using metric of χ2
Description
The function lsquodistchi2rsquo calculates an euclidian distance matrix for factors using metric of χ2
Usage
distchi2(mat)
Arguments
mat A matrix of factors given as numeric values
Details
The euclidian distance between two individuals i and k using the metric of χ2 is given by
d2χ2 =
n
p
sumj
p
mjsuml
δjlik
1nj
l
with n number of individuals p number of variables mj is the number of possibilities for variableY j nj
l is the number of individuals where l has been observed for Y j and δjlik = 1 if there is a
discordance between i and k for l and 0 otherwise It is not an interactive function
Value
It returns a dist object (see help(dist))
Author(s)
Laurent Thibault
References
Besse Philippe ldquoData mining 2 Modeacutelisation statistique et apprentissagerdquo Publication du LSPhttpwwwlspups-tlsefrBesse
See Also
clustermap
28 driftmap
driftmap Detection of an eventual trend
Description
The function lsquodriftmaprsquo creates a grid on the map and calculates the mean and median for each cellThe right plot (resp left plot) represents means and medians calculated by row (resp column)
Usage
driftmap(long lat var interpol = 1nuage = 0 carte = NULLlablong = lablat = labvar = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
interpol if 1 the mean and median calculated are linearly interpoled
nuage if 1 the individuals are also represented on the graphics
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
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
labvar name of variable lsquovarrsquo
Details
Possibility to change the number of cells in the grid with the tcltk window to interpolate the meansand medians calculated (by default) to work on a rotated map Notice that this is not an interactivefunction
Value
No values returned only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
eire 29
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmaprotation
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)driftmap(auckland$Eastingauckland$Northingauckland$Deaths197785interpol=0nuage=1lablong=Xlablat=Ylabvar=Deaths197785)
data afcondata(afcon)driftmap(afcon$xafcon$yafcon$totconinterpol=0nuage=1lablong=Xlablat=Ylabvar=Number of conflicts)
data meusedata(meuseall)data(meuseriv)driftmap(meuseall$xmeuseall$ymeuseall$coppernuage=1lablong=Xlablat=Ylabvar=Concentration de cuivre (en ppm))
eire Eire data sets
Description
The lsquoeirersquo data frame has 26 rows and 11 columns
Usage
data(eire)
Format
A data frame with 26 observations on the following 11 variables
V1 a vector x of size n
V2 a vector y of size n
A Percentage of sample with blood group A
towns Townsunit area
pale Beyond the Pale 0 within the Pale 1
size number of blood type samples
ROADACC arterial road network accessibility in 1961
30 eirepolys
OWNCONS percentage in value terms of gross agricultural output of each county consumed by itself
POPCHG 1961 population as percentage of 1926
RETSALE value of retail sales c000
INCOME total personal income c000
Details
This data provides from spdep package
Source
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
Examples
data(eire)
eirepolys Spatial polygonal contours of eire dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of eiredataset
Usage
data(eirepolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or rsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibility torepesent spatial polygonal contours as a backgroud map Thatrsquos why we create functions lsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of the polygons
Source
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
findneighbors 31
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
findneighbors Research of the m nearest neighbors for sites
Description
The function lsquofindneighborsrsquo gives for each site of coordinates (xc yc) the m nearest neighbors inthe set of sites
Usage
findneighbors(xc yc m)
Arguments
xc a numerical vector x of size n
yc a numerical vector y of size n
m number of nearest neighbors
Details
In case of ties the nearest neighbor is randomly chosen among the ties This function is called inmakeneighborswr
Value
A matrix of size ntimes n containing 1 on position (i j) if j is m-nearest neighbour to i
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakedistanceWmakeneighborsw
32 genpca
Examples
data(auckland)Wlt-findneighbors(auckland$Eastingauckland$Northing1)
genpca Generalized Principal Component Analysis (PCA)
Description
The function lsquogenpcarsquo computes a generalized Principal Component Analysis (PCA) It calculatesthe principal components the coordinates of the variables and in these principals components axesand the inertia of these principal components
Usage
genpca(data w=rep(1nrow(data)length=nrow(data)) m=diag(1ncol(data)ncol(data))center=TRUE reduc=TRUE)
Arguments
data matrix ntimes p
w vector of size n of weight (by default weight = t(1n 1n))
m matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centered PCA (by default center=TRUE)
reduc boolean if TRUE reduced PCA (by default reduce=TRUE)
Details
LetW = diag(w)
x = data = (xprime1 x
primen)prime
withxi = (x1
i xpi )
Let1n = (1 1)prime
with n rows and 1p = (1 1)prime
with p rows Normalization of weight
wi =wisumi wi
genpca 33
Vector of means x = (x1 xp)prime
withxj =
sumi
wixji
If center=Truexc = xminus 1nxprime
Standart deviation (σj)2 =
sumi
wi(xji )
2 minus (xj)2
Σ = diag((σ1)2 (σp)2)prime
If reduc=True xcr = xc times Σminus12
Variance-Covariance matrix
C = xprimecrWxcr
Cholesky decomposition M = LLprime where M=mLet
Cl = LCLprime
Let U and D as ClU = UD
with D = diag(λ1 λp)Let
V = LprimeU
Then Coordinates of individuals in the principals components basis
CC = xcrV
Coordinates of variables in principals components
V C = CV Dminus12
Inertia I = D1p
Value
Returns lsquoinertiarsquo vector of size p with percent of inertia of each component (corresponding to I)lsquocasecoordrsquo matrix ntimes p (corresponding to matrix CC) lsquovarcoordrsquo matrix ptimes p (corresponding tomatrix V C)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
34 gini
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermappcamap
gini Calculates a Gini Index
Description
The function lsquoginirsquo calculates the Gini Index associated to the variable lsquovarrsquo
Usage
gini(var)
Arguments
var a vector of numerical values of size n
Details
Let xk k = 1 K be the distinct values taken by V ar For each site Ginir returns two pairs offrequencies The pair (f g) where f represents
fk =1n
sumi
1(V ari = xk)
(n is the length of lsquovarrsquo) and g represents
gk =xk
xfk
The pair (FG) represents the corresponding cumulative frequenciesThe Gini Index is calculated as
IG =12x
Ksumi=1
Ksumj=1
|xi minus xj |
Value
(f F g G gini) where f F g and G are vectors of size K and gini a numeric value
Note
This function is used in ginimapR but it is not an interactive function
ginimap 35
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
ginimap
ginimap Lorentz curve and map
Description
The function lsquoginimaprsquo computes a Lorentz curve from rsquovarrsquo and calculates the Gini Index associ-ated to var
Usage
ginimap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
2 GeoXp-package
clustermap 17dbledensitymap 20dblehistomap 22densitymap 24distchi2 27driftmap 28eire 29eirepolys 30findneighbors 31genpca 32gini 34ginimap 35graphique 37histobarmap 39histomap 41makedistanceW 43makeneighborsw 44map2list 45meuseall 46meuseriv 48moranplotmap 48neighbourmap 51nonormmoran 53normw 54oldcol 55oldcolpolys 56pcamap 57polyboxplotmap 60polylist2list 62rotation 63scattermap 64selectgraph 66selectmap 67selectstat 68slider1 69slider2 70spdf2list 71variocloudmap 72
Index 75
GeoXp-package Interactive exploratory spatial data analysis
Description
GeoXp is a tool for researchers in spatial statistics spatial econometrics geography ecology etcallowing to link dynamically statistical plots with elementary maps This coupling consists in thefact that the selection of a zone on the map results in the automatic highlighting of the correspondingpoints on the statistical graph or reversely the selection of a portion of the graph results in theautomatic highlighting of the corresponding points on the map GeoXp includes tools from differentareas of spatial statistics including geostatistics as well as spatial econometrics and point processes
GeoXp-package 3
Besides elementary plots like boxplots histograms or simple scatterplos GeoXp also couples withmaps Moran scatterplots variogram cloud Lorentz Curves In order to make the most of themultidimensionality of the data GeoXp includes some dimension reduction techniques such asPCA
Details
Package GeoXpType PackageVersion 10Date 2006-10-20License GPL Vesion 2 or later
GeoXp donrsquot use classes yet The coordinates of sites are represented by two vectors long (forx minus axis) and lat (for y minus axis) of size n of numeric values Attribute value is designed by ar-gument var of size n and can be a vector of numeric values (function histomap densitymap)or a factor (function barmap) Some functions use both a vector of numeric values and a factor(function histobarmap polyboxplotmap) Few functions as pcamap and clustermap use a matrixof numeric variablesContrary to spdep package (Roger Bivand) a site cannot be represented by latticearea style How-ever user can represent a spatial polygonal contour as background map with option carte A spatialpolygonal contour is a matrix of numeric values with 2 columns (x and y coordinates of the ver-tices of the polygons) where polygons are seperated from each other by 3 rows of NaN We includein GeoXp 3 functions (polylist2list spdf2list and map2list) which convert some spatial objects(lsquoPolylistrsquo lsquoSpatialPolygonDataFramersquo and lsquoMaprsquo object) into matrix as decribed above to draw abackground mapAmong options which are common to each function users have the possibility to give a criteriavector of boolean of size n with TRUE on specific sites These sites are then represented by a croiceon the map by clicking on lsquonon intercative selectionrsquo buttonMoreover users have the possibility to make bubbles and add some graphs (histogram barplot orscattermap) giving both a matrix of variables listvar of size n times p and a list of character of sizep for variable names Users can choose a proportional symbol mapping in function plot we givevalue var05 to argument cex User can choose if a legend has to appear on the map He couldchoose then three values represented by bubbles of corresponding sizesFinally users can choose to represent sites on map with different colors (choosed by default and notmodifiable by users) in the case of a graph using a factor (argument color with 1 for different col-ors 0 otherwise) Users could choose if a legend with corresponding colors will appear on the mapUsers can also modify the representation of sites on map (choosed by default and not modifiable byusers) with argument symbol (with 1 for different symbols 0 otherwise)
Author(s)
Christine Thomas-Agnan Yves Aragon Anne Ruiz-Gazen Thibault Laurent Laurianne Robidou
Maintainer Christine Thomas-Agnan ltcthomascictfrgt
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
4 afcon
afcon Spatial patterns of conflict in Africa 1966-78
Description
The afcon data frame has 42 rows and 5 columns for 42 African countries exclusing then SouthWest Africa and Spanish Equatorial Africa and Spanish Sahara The dataset is used in Anselin(1995) and downloaded from before adaptation
Usage
data(afcon)
Format
A data frame with 42 observations on the following 5 variables
x an easting in decimal degrees (taken as centroiumld of shapefile polygon)
y a northing in decimal degrees (taken as centroiumld of shapefile polygon)
totcon index of total conflict 1966-78
name country name
id country id number as in paper
Details
This data provides from spdep package
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin L and John OrsquoLoughlin (1992) ldquoGeography of international conflict and cooperationspatial dependence and regional context in Africardquo In The New Geopolitics ed M Ward pp39-75
Anselin L (1995) ldquoLocal indicators of spatial associationrdquo In Geographical Analysis 27 Table1 p103
Examples
data(afcon)
angleplotmap 5
angleplotmap Detection of an eventual directional trend
Description
The function lsquoangleplotmaprsquo is used to detect an eventual directional trend associated to variablevar It represents the absolute difference between the value of var at two sites as a function of theangle between vector minusminusrarrsisj and the x-axis
Usage
angleplotmap(long lat var quantiles = NULLlistvar = NULL listnomvar = NULLcriteria = NULL carte = NULL label = symbol = 0 labvar = lablong = lablat = axis = FALSE)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
6 angleplotmap
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
axis a boolean with TRUE for drawing axes on the map
Details
For each couple of sites (si sj) the graphic represents on the y-axis the absolute difference betweenvari and varj
Dij = |vari minus varj |and on the x-axis the angle θij between the vector minusminusrarrsisj and the x-axis Possibility to represent asmoothing spline regression quantile gα For 0 lt α lt 1
Pr[Dij lt gα(θij)] = α
If that case only the pair of sites (si sj) verifying
Dij gt gmax(α)(θij)
are represented
Value
A matrix of boolean of size ntimes n TRUE if pair of sites was in the last selection
Author(s)
Thomas-Agnan Christine Aragon Yves Ruiz-Gazen Anne Laurent Thibault Robidou Laurianne
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
variocloudmapdriftmap
Examples
Data afcondata(afcon)obslt-angleplotmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon))symbol=1)
Data Meusedata(meuseall)data(meuseriv)obslt-angleplotmap(meuseall$xmeuseall$ymeuseall$copperlablong=Xlablat=Yquantiles=c(0105095)listvar=meusealllistnomvar=names(meuseall)labvar=Concentration en plomb (en ppm))points(meuseriv type = l asp = 1)
auckpolys 7
auckpolys Spatial polygonal contours of auckland dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of auckland dataset
Usage
data(auckpolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonDataFramersquo or rsquoMaprsquo object because a site can only berepresented by a pair of coordinates and not by a polygonnal contour However users have the pos-sibility to repesent spatial polygonal contours as a backgroud map Thatrsquos why we created functionslsquospdf2listrsquo lsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of thepolygons
Source
Marshall R M (1991) Mapping disease and mortality rates using Empirical Bayes Estimators Ap-plied Statistics 40 283-294
Bailey T Gatrell A (1995) Interactive Spatial Data Analysis Harlow Longman - INFOMAP dataset used with permission
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)
8 auckland
auckland Marshallrsquos infant mortality in Auckland dataset
Description
The Auckland data frame has 167 rows (census area units - CAU) and 4 columns
Usage
data(auckland)
Format
A data frame with 167 observations on the following 4 variables
Easting a numeric vector of x coordinates in an unknown spatial reference system
Northing a numeric vector of y coordinates in an unknown spatial reference system
Deaths197785 a numeric vector of counts of infant (under 5 years of age) deaths in Auckland1977-1985
Under51981 a numeric vector of population under 5 years of age at the 1981 Census
Details
This data provides from spdep package
Source
Bailey T Gatrell A (1995) Interactive Spatial Data Analysis Harlow Longman - INFOMAP dataset used with permission
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Marshall R M (1991) Mapping disease and mortality rates using Empirical Bayes Estimators Ap-plied Statistics 40 283-294
Examples
data(auckland)
baltimore 9
baltimore House sales prices Baltimore MD 1978
Description
House sales price and characteristics for a spatial hedonic regression Baltimore MD 1978
Usage
data(baltimore)
Format
A data frame with 211 observations on the following 17 variables
STATION StationPRICE PriceNROOM Number of roomsDWELL Presence of well (0 or 1)NBATH Number of bathsPATIO Presence of patio (0 or 1)FIREPL Presence of fire stationAC ACBMENT BMENTNSTOR NSTORGAR Number of garagesAGE AgeCITCOU CITCOULOTSZ LOTSZSQFT SQFTX a vector x of size n
Y a vector y of size n
Details
This data provides from spdep package
Source
Prepared by Luc Anselin Original data made available by Rodin Dubin Weatherhead School ofManagement Case Western Research University Cleveland OH
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Dubin Robin A (1992) Spatial autocorrelation and neighbourhood quality Regional Scienceand Urban Economics 22(3) 433-452
10 barmap
Examples
data(baltimore)
barmap Interactive Bar plot and map
Description
The function lsquobarmaprsquo draws a bar plot (vertical bar) of the given factor variable var and a mapwith sites of coordinates (long lat)
Usage
barmap(long lat var listvar = NULL listnomvar = NULLcriteria = NULL carte = NULL label = color = 1symbol = 0 labvar = labmod = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of factor of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with name of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
barmap 11
labvar name of variable var
labmod names of factors of var
axis 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 selection of a bar on the bar plot results in the corresponding sites coloured on the map with thecorresponding colour observed on the bar Reversely the selection of sites on the map by lsquopointsrsquoor lsquopolygonrsquo results in the drawing of the sub-barplot in red
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
Examples
data oldcoldata(oldcol)data(oldcolpolys)oldcolcontourslt-polylist2list(oldcolpolys)barmap(oldcol$X oldcol$Y oldcol$NSA listvar=oldcolcarte=oldcolcontourslistnomvar=names(oldcol)criteria=(oldcol$CP==1)axis=TRUElablong=Xlablat=Y)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)barmap(eire$V1eire$V2eire$palecarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
12 boston
boston Corrected Boston Housing Data
Description
The boston data frame has 506 rows and 20 columns It contains the Harrison and Rubinfeld(1978) data corrected for a few minor errors and augmented with the latitude and longitude of theobservations Gilley and Pace also point out that MEDEV is censored in that median values at orover USD 50000 are set to USD 50000
Usage
data(boston)
Format
A data frame with 506 observations on the following 22 variables
x a vector x of size n
y a vector y of size n
TOWN a factor with levels given by town names
TOWNNO a numeric vector corresponding to town
TRACT a numeric vector of tract ID numbers
LON a numeric vector of tract point longitudes in decimal degrees
LAT a numeric vector of tract point latitudes in decimal degrees
MEDV a numeric vector of median values of owner-occupied housing in USD 1000
CMEDV a numeric vector corrected median values of owner-occupied housing in USD 1000
CRIM a numeric vector of per capita crime
ZN a numeric vector of proportions of residential land zoned for lots over 25000 sq ft per town(constant for all Boston tracts)
INDUS a numeric vector of proportions of non-retail business acres per town (constant for allBoston tracts)
CHAS a factor with levels 1 if tract borders Charles River 0 otherwise
NOX a numeric vector of nitric oxides concentration (parts per 10 million) per town
RM a numeric vector of average numbers of rooms per dwelling
AGE a numeric vector of proportions of owner-occupied units built prior to 1940
DIS a numeric vector of weighted distances to five Boston employment centres
RAD a numeric vector of an index of accessibility to radial highways per town (constant for allBoston tracts)
TAX a numeric vector full-value proprty-tax rate per USD 10000 per town (constant for all Bostontracts)
PTRATIO a numeric vector of pupil-teacher ratios per town (constant for all Boston tracts)
B a numeric vector of 1000 lowast (Bk minus 063)2 where Bk is the proportion of blacks
LSTAT a numeric vector of percentage values of lower status population
boxplotmap 13
Details
This data provides from spdep package
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Harrison David and Daniel L Rubinfeld ldquoHedonic Housing Prices and the Demand for CleanAirrdquo Journal of Environmental Economics and Management Volume 5 (1978) 81-102 Originaldata
Gilley OW and R Kelley Pace ldquoOn the Harrison and Rubinfeld Datardquo Journal of EnvironmentalEconomics and Management 31 (1996) 403-405 Provided corrections and examined censoring
Pace R Kelley and OW Gilley ldquoUsing the Spatial Configuration of the Data to Improve Estima-tionrdquo Journal of the Real Estate Finance and Economics 14 (1997) 333-340
Examples
data(boston)
boxplotmap Interactive boxplot and map
Description
The function lsquoboxplotmaprsquo draws a boxplot of the given variable var and a map with site of coor-dinates (long lat)
Usage
boxplotmap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
14 boxplotmap
listnomvar list of character of size p with names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar name of variable var
axis 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
There is an interactivity only in one direction the sites selected by interquartile on the boxplot arerepresented on the map in red
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
carte 15
Examples
donnees oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)boxplotmap(oldcol$X oldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CP==1)axis=TRUElablong=Xlablat=Y)
donnees bostondata(boston)boxplotmap(boston$xboston$yboston$CRIMlistvar=bostonlistnomvar=names(boston)criteria=(boston$CHAS==1))
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)boxplotmap(eire$V1eire$V2eire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Taux deacutevolution de la population de 1921 agrave1962)
carte Drawing a map
Description
The function lsquocartersquo draws a map with sites of coordinates (long lat) and represents sites whichhave been selected (obs) in red if symbol=0 or with star if symbol=1 This function is called bymost of the functions of GeoXp (this is not an interactive function)
Usage
carte(long lat obscriteria=NULLbuble=FALSEcbuble=NULLnointer=FALSE carte=NULLnocart=FALSE label=symbol=0col=0 lablong= lablat= method= W=NULL couleurs=classe obsqlegmap=NULLlegends=list(FALSEFALSE)labmod=axis=FALSE)
Arguments
long a vector x of size n
lat a vector y of size n
obs a boolean vector of size n with TRUE on selected sites
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
16 carte
buble a boolean with TRUE for drawing bubbles FALSE otherwise
cbuble vector of size n with size of each site depending on variable with which bubblesare constructed
nointer a boolean with TRUE for drawing sites selected by criteria FALSE otherwise
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
nocart a boolean with TRUE for drawing spatial contours FALSE otherwise
label vector of character of size n with name of each site
col 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points are inred if 1 selected points are stars
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
method Specification for some graphics such as lsquoNeighbourplot1rsquo lsquoNeighbourplot2rsquolsquoClusterrsquo lsquoAngleplotrsquo lsquoVariocloudrsquo
W neighbourhood matrix of size ntimes n necessary when method=lsquoNeighbourplotrsquo
couleurs Possibility to change colors (only for admin)
classe vector of n whith class necessary when method=lsquoClusterrsquo
obsq vector of size n with number of quadrant to which the site belongs necessarywhen method=lsquoQuadrantrsquo
legmap a list of (numericnumericnumericnumericnumericnumericcharacter) with thesizes and the corresponding values of the 3 bubbles represented in the legend andthe variable name of variable choosed
clustermap 17
legends a list of c(booleanbooleanc(numericnumeric)c(numericnumeric)) with TRUEfor drawing legends of bubbles (1st argument) or factors (2nd argument) and thecoordinates of the location of the upper left corner of the legend box
labmod Name of factors
axis a boolean with True for drawing axes on the map
Details
For factors possibility to represent sites with different colors for each level Others options permitto represent with a croice some sites with special lsquocriteriarsquo with lsquobubblersquo according to a variablegiven a spatial contours with lsquocartersquo names of sites with lsquolabelrsquo or a representation in flowerPossibility to draw a legend giving the sizes of bubbles and colors of levels
Value
No values only drawing of a map
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
clustermap Classification of dataset using kmeansr or hclustr and representationof clusters on a map
Description
The function lsquoclustermaprsquo performs a classification of the sites from the variables included indataset and computes a bar plot of the clusters calculated Classification methods comes fromhclustR (hierarchical cluster analysis) and kmeansR (k-means clustering) and number of class ischosen with clustnum
Usage
clustermap(longlatdatasetclustnummethod=kmeanstype=NULLcenters=NULLscale=FALSElistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabvar=Clusterlabel=symbol=0color=1labmod=axis=FALSElablong= lablat=)
18 clustermap
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix of variables of numeric values
clustnum Number of clusters
method two methos lsquokmeansrsquo by default or lsquohclustrsquo
type If method=lsquohclustrdquo type=ldquocompleterdquo by default (the possibilities are given inhelp(hclust) as lsquowardrsquo lsquosinglersquo etc) If method=lsquokmeansrsquo type=Hartigan-Wong by default (the possibilities are given in help(kmeans) as lsquoForgyrsquo etc)
centers If method=rsquokmeansrsquo user can give a matrix with initial cluster centers
scale If scale=TRUE the dataset is reducted
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
labvar name of variable var
label vector of size n with names of each site
color 0 or 1 (by default) choice of representation of selected points If 0 sites arerepresented in blue if 1 sites are represented with different colors for eachcluster
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labmod names of Clusters
clustermap 19
axis 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 two windows are interactive the sites selected by a bar chosen on the bar plot are representedon the map in red and the values of sites selected on the map by lsquopointsrsquo or lsquopolygonrsquo are representedin red on the bar plot The dendogram is also drawn for rsquohclustrsquo method In option possibility tochoose the classification method
Value
A vector of boolean of size n (TRUE if the site was in the last selection) and a vector of size nwhith the number of cluster for each site
Note
To use the functions hclustr and kmeansr we take many arguments by default If the user wouldlike to modify these arguments he should call these functions first and then use the functionbarmapr to visualize the calculated clusters
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Murtagh F (1985) ldquoMultidimensional Clustering Algorithmsrdquo
Hartigan J A and Wong M A (1979) A K-means clustering algorithm Applied Statistics 28100-108
See Also
barmap pcamap
Examples
donneacutees oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)obslt-clustermap(oldcol$X oldcol$Yoldcol[712]3listvar=oldcollistnomvar=names(oldcol)carte=contoursOLDcriteria=(oldcol$CP==1))
20 dbledensitymap
data avifaunelibrary(ade4)data(mafragh)dlt-distchi2(mafragh$flo)
obslt-clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4method=hclusttype=wardlistvar=mafragh$partitionlistnomvar=class)
claslt-obs$vectclasselt-by(dclasmean)glt-rbind(e[1]$1e[2]$2e[3]$3e[4]$4)
clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4centers=glistvar=mafragh$partitionlistnomvar=class)
dbledensitymap Double Kernel density estimates and map
Description
The function lsquodbledensitymaprsquo plots two kernel density estimates from var1 and var2 computedwith lsquobkdeRrsquo and a map with sites of coordinates (long lat) Each site is associated to a value ofvar1 and var2 and the two windows are interactive
Usage
dbledensitymap(long lat var1 var2kernel=triweight listvar = NULLlistnomvar = NULL carte = NULL criteria = NULL label = symbol = 0 color = 1 labvar = c(var1 var2) axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
dbledensitymap 21
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar list of character with names of variables var1 and var2
axis 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 user can choose an interval on the density curve by mouse clicking on the lower and upperboundaries of the interval or by giving directly these values The selected sites are then representedon the map in red A selection by lsquopointsrsquo or lsquopolygonrsquo on the map results in the drawing of thedensity of the corresponding sub-distribution on the density plot Finally the user can modify thebandwith parameter with a cursor in the tcltk window (parameter α) α is the smoothing parameterfor the kernel smooth it represents the mean percentage of sample points involved in the localaveraging (example α = 20 means that on average ntimes 02 points are in any interval of length 2hwhere h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
22 dblehistomap
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dbledensitymap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785))) listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-dbledensitymap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)dbledensitymap(eire$V1eire$V2eire$Aeire$townslabvar=c(Taux dindividus au groupe sanguin ASurface urbaine)carte=eirecontourskernel=normallistvar=eirelistnomvar=names(eire))
dblehistomap Double Interactive Histogram and map
Description
The function lsquodblehistomaprsquo draws two histograms of the given variables var1 and var2 and a mapwith sites of coordinates (long lat) Each site is associated to a value of var1 and var2 and thereis interactivity between the two windows created
dblehistomap 23
Usage
dblehistomap(long lat var1 var2 listvar = NULL listnomvar = NULLnbcol1 = 10 nbcol2 = 10 carte = NULL criteria = NULLsymbol = 0 color = 1 labvar = c( ) label = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
nbcol1 number of cells for histogram 1 (10 by default)
nbcol2 number of cells for histogram 2 (10 by default)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
24 densitymap
Details
The selection of sites by lsquopointsrsquo or lsquopolygonsrsquo on the map results in the drawing of the red his-tograms of the subdistributions corresponding to this subset of sites
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dblehistomap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785)))listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadblehistomap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
densitymap Kernel density estimates and map
Description
The function lsquodensitymaprsquo draws kernel density estimates of the variable var with rsquobkdeRrsquo anda map with sites of coordinate (long lat) Each site is associated to a value of var and there isinteractivity between the two windows
densitymap 25
Usage
densitymap(long lat varkernel=triweightlistvar=NULLlistnomvar=NULLcarte=NULL criteria=NULLlabel=symbol=0color=1 labvar=axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
labvar name of variable var
axis 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
26 densitymap
Details
The user can choose an interval on the density curve by mouse clicking on the graph on the extremi-ties of interval or by specifying directly values The sites selected by an interval are then representedon the map in red The selection of sites on the map by lsquopointsrsquo or lsquopolygonrsquo results in the draw-ing of the kernel densities of the subdistributions corresponding to this subset of sites Finally theuser can modify the bandwith parameter with a cursor in the tcltk window (parameter α) α is thesmoothing parameter for the kernel smooth it represents the mean percentage of sample pointsinvolved in the local averaging (example α = 20 means that on average ntimes 02 points are in anyinterval of length 2h where h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
library tcltk and KernSmooth data olcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)densitymap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadensitymap(colombuscontours$Xcolombuscontours$Ycolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)
distchi2 27
data(eirepolys)eirecontourslt-polylist2list(eirepolys)densitymap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
distchi2 It gives an euclidian distance matrix for factors using metric of χ2
Description
The function lsquodistchi2rsquo calculates an euclidian distance matrix for factors using metric of χ2
Usage
distchi2(mat)
Arguments
mat A matrix of factors given as numeric values
Details
The euclidian distance between two individuals i and k using the metric of χ2 is given by
d2χ2 =
n
p
sumj
p
mjsuml
δjlik
1nj
l
with n number of individuals p number of variables mj is the number of possibilities for variableY j nj
l is the number of individuals where l has been observed for Y j and δjlik = 1 if there is a
discordance between i and k for l and 0 otherwise It is not an interactive function
Value
It returns a dist object (see help(dist))
Author(s)
Laurent Thibault
References
Besse Philippe ldquoData mining 2 Modeacutelisation statistique et apprentissagerdquo Publication du LSPhttpwwwlspups-tlsefrBesse
See Also
clustermap
28 driftmap
driftmap Detection of an eventual trend
Description
The function lsquodriftmaprsquo creates a grid on the map and calculates the mean and median for each cellThe right plot (resp left plot) represents means and medians calculated by row (resp column)
Usage
driftmap(long lat var interpol = 1nuage = 0 carte = NULLlablong = lablat = labvar = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
interpol if 1 the mean and median calculated are linearly interpoled
nuage if 1 the individuals are also represented on the graphics
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
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
labvar name of variable lsquovarrsquo
Details
Possibility to change the number of cells in the grid with the tcltk window to interpolate the meansand medians calculated (by default) to work on a rotated map Notice that this is not an interactivefunction
Value
No values returned only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
eire 29
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmaprotation
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)driftmap(auckland$Eastingauckland$Northingauckland$Deaths197785interpol=0nuage=1lablong=Xlablat=Ylabvar=Deaths197785)
data afcondata(afcon)driftmap(afcon$xafcon$yafcon$totconinterpol=0nuage=1lablong=Xlablat=Ylabvar=Number of conflicts)
data meusedata(meuseall)data(meuseriv)driftmap(meuseall$xmeuseall$ymeuseall$coppernuage=1lablong=Xlablat=Ylabvar=Concentration de cuivre (en ppm))
eire Eire data sets
Description
The lsquoeirersquo data frame has 26 rows and 11 columns
Usage
data(eire)
Format
A data frame with 26 observations on the following 11 variables
V1 a vector x of size n
V2 a vector y of size n
A Percentage of sample with blood group A
towns Townsunit area
pale Beyond the Pale 0 within the Pale 1
size number of blood type samples
ROADACC arterial road network accessibility in 1961
30 eirepolys
OWNCONS percentage in value terms of gross agricultural output of each county consumed by itself
POPCHG 1961 population as percentage of 1926
RETSALE value of retail sales c000
INCOME total personal income c000
Details
This data provides from spdep package
Source
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
Examples
data(eire)
eirepolys Spatial polygonal contours of eire dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of eiredataset
Usage
data(eirepolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or rsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibility torepesent spatial polygonal contours as a backgroud map Thatrsquos why we create functions lsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of the polygons
Source
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
findneighbors 31
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
findneighbors Research of the m nearest neighbors for sites
Description
The function lsquofindneighborsrsquo gives for each site of coordinates (xc yc) the m nearest neighbors inthe set of sites
Usage
findneighbors(xc yc m)
Arguments
xc a numerical vector x of size n
yc a numerical vector y of size n
m number of nearest neighbors
Details
In case of ties the nearest neighbor is randomly chosen among the ties This function is called inmakeneighborswr
Value
A matrix of size ntimes n containing 1 on position (i j) if j is m-nearest neighbour to i
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakedistanceWmakeneighborsw
32 genpca
Examples
data(auckland)Wlt-findneighbors(auckland$Eastingauckland$Northing1)
genpca Generalized Principal Component Analysis (PCA)
Description
The function lsquogenpcarsquo computes a generalized Principal Component Analysis (PCA) It calculatesthe principal components the coordinates of the variables and in these principals components axesand the inertia of these principal components
Usage
genpca(data w=rep(1nrow(data)length=nrow(data)) m=diag(1ncol(data)ncol(data))center=TRUE reduc=TRUE)
Arguments
data matrix ntimes p
w vector of size n of weight (by default weight = t(1n 1n))
m matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centered PCA (by default center=TRUE)
reduc boolean if TRUE reduced PCA (by default reduce=TRUE)
Details
LetW = diag(w)
x = data = (xprime1 x
primen)prime
withxi = (x1
i xpi )
Let1n = (1 1)prime
with n rows and 1p = (1 1)prime
with p rows Normalization of weight
wi =wisumi wi
genpca 33
Vector of means x = (x1 xp)prime
withxj =
sumi
wixji
If center=Truexc = xminus 1nxprime
Standart deviation (σj)2 =
sumi
wi(xji )
2 minus (xj)2
Σ = diag((σ1)2 (σp)2)prime
If reduc=True xcr = xc times Σminus12
Variance-Covariance matrix
C = xprimecrWxcr
Cholesky decomposition M = LLprime where M=mLet
Cl = LCLprime
Let U and D as ClU = UD
with D = diag(λ1 λp)Let
V = LprimeU
Then Coordinates of individuals in the principals components basis
CC = xcrV
Coordinates of variables in principals components
V C = CV Dminus12
Inertia I = D1p
Value
Returns lsquoinertiarsquo vector of size p with percent of inertia of each component (corresponding to I)lsquocasecoordrsquo matrix ntimes p (corresponding to matrix CC) lsquovarcoordrsquo matrix ptimes p (corresponding tomatrix V C)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
34 gini
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermappcamap
gini Calculates a Gini Index
Description
The function lsquoginirsquo calculates the Gini Index associated to the variable lsquovarrsquo
Usage
gini(var)
Arguments
var a vector of numerical values of size n
Details
Let xk k = 1 K be the distinct values taken by V ar For each site Ginir returns two pairs offrequencies The pair (f g) where f represents
fk =1n
sumi
1(V ari = xk)
(n is the length of lsquovarrsquo) and g represents
gk =xk
xfk
The pair (FG) represents the corresponding cumulative frequenciesThe Gini Index is calculated as
IG =12x
Ksumi=1
Ksumj=1
|xi minus xj |
Value
(f F g G gini) where f F g and G are vectors of size K and gini a numeric value
Note
This function is used in ginimapR but it is not an interactive function
ginimap 35
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
ginimap
ginimap Lorentz curve and map
Description
The function lsquoginimaprsquo computes a Lorentz curve from rsquovarrsquo and calculates the Gini Index associ-ated to var
Usage
ginimap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
GeoXp-package 3
Besides elementary plots like boxplots histograms or simple scatterplos GeoXp also couples withmaps Moran scatterplots variogram cloud Lorentz Curves In order to make the most of themultidimensionality of the data GeoXp includes some dimension reduction techniques such asPCA
Details
Package GeoXpType PackageVersion 10Date 2006-10-20License GPL Vesion 2 or later
GeoXp donrsquot use classes yet The coordinates of sites are represented by two vectors long (forx minus axis) and lat (for y minus axis) of size n of numeric values Attribute value is designed by ar-gument var of size n and can be a vector of numeric values (function histomap densitymap)or a factor (function barmap) Some functions use both a vector of numeric values and a factor(function histobarmap polyboxplotmap) Few functions as pcamap and clustermap use a matrixof numeric variablesContrary to spdep package (Roger Bivand) a site cannot be represented by latticearea style How-ever user can represent a spatial polygonal contour as background map with option carte A spatialpolygonal contour is a matrix of numeric values with 2 columns (x and y coordinates of the ver-tices of the polygons) where polygons are seperated from each other by 3 rows of NaN We includein GeoXp 3 functions (polylist2list spdf2list and map2list) which convert some spatial objects(lsquoPolylistrsquo lsquoSpatialPolygonDataFramersquo and lsquoMaprsquo object) into matrix as decribed above to draw abackground mapAmong options which are common to each function users have the possibility to give a criteriavector of boolean of size n with TRUE on specific sites These sites are then represented by a croiceon the map by clicking on lsquonon intercative selectionrsquo buttonMoreover users have the possibility to make bubbles and add some graphs (histogram barplot orscattermap) giving both a matrix of variables listvar of size n times p and a list of character of sizep for variable names Users can choose a proportional symbol mapping in function plot we givevalue var05 to argument cex User can choose if a legend has to appear on the map He couldchoose then three values represented by bubbles of corresponding sizesFinally users can choose to represent sites on map with different colors (choosed by default and notmodifiable by users) in the case of a graph using a factor (argument color with 1 for different col-ors 0 otherwise) Users could choose if a legend with corresponding colors will appear on the mapUsers can also modify the representation of sites on map (choosed by default and not modifiable byusers) with argument symbol (with 1 for different symbols 0 otherwise)
Author(s)
Christine Thomas-Agnan Yves Aragon Anne Ruiz-Gazen Thibault Laurent Laurianne Robidou
Maintainer Christine Thomas-Agnan ltcthomascictfrgt
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
4 afcon
afcon Spatial patterns of conflict in Africa 1966-78
Description
The afcon data frame has 42 rows and 5 columns for 42 African countries exclusing then SouthWest Africa and Spanish Equatorial Africa and Spanish Sahara The dataset is used in Anselin(1995) and downloaded from before adaptation
Usage
data(afcon)
Format
A data frame with 42 observations on the following 5 variables
x an easting in decimal degrees (taken as centroiumld of shapefile polygon)
y a northing in decimal degrees (taken as centroiumld of shapefile polygon)
totcon index of total conflict 1966-78
name country name
id country id number as in paper
Details
This data provides from spdep package
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin L and John OrsquoLoughlin (1992) ldquoGeography of international conflict and cooperationspatial dependence and regional context in Africardquo In The New Geopolitics ed M Ward pp39-75
Anselin L (1995) ldquoLocal indicators of spatial associationrdquo In Geographical Analysis 27 Table1 p103
Examples
data(afcon)
angleplotmap 5
angleplotmap Detection of an eventual directional trend
Description
The function lsquoangleplotmaprsquo is used to detect an eventual directional trend associated to variablevar It represents the absolute difference between the value of var at two sites as a function of theangle between vector minusminusrarrsisj and the x-axis
Usage
angleplotmap(long lat var quantiles = NULLlistvar = NULL listnomvar = NULLcriteria = NULL carte = NULL label = symbol = 0 labvar = lablong = lablat = axis = FALSE)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
6 angleplotmap
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
axis a boolean with TRUE for drawing axes on the map
Details
For each couple of sites (si sj) the graphic represents on the y-axis the absolute difference betweenvari and varj
Dij = |vari minus varj |and on the x-axis the angle θij between the vector minusminusrarrsisj and the x-axis Possibility to represent asmoothing spline regression quantile gα For 0 lt α lt 1
Pr[Dij lt gα(θij)] = α
If that case only the pair of sites (si sj) verifying
Dij gt gmax(α)(θij)
are represented
Value
A matrix of boolean of size ntimes n TRUE if pair of sites was in the last selection
Author(s)
Thomas-Agnan Christine Aragon Yves Ruiz-Gazen Anne Laurent Thibault Robidou Laurianne
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
variocloudmapdriftmap
Examples
Data afcondata(afcon)obslt-angleplotmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon))symbol=1)
Data Meusedata(meuseall)data(meuseriv)obslt-angleplotmap(meuseall$xmeuseall$ymeuseall$copperlablong=Xlablat=Yquantiles=c(0105095)listvar=meusealllistnomvar=names(meuseall)labvar=Concentration en plomb (en ppm))points(meuseriv type = l asp = 1)
auckpolys 7
auckpolys Spatial polygonal contours of auckland dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of auckland dataset
Usage
data(auckpolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonDataFramersquo or rsquoMaprsquo object because a site can only berepresented by a pair of coordinates and not by a polygonnal contour However users have the pos-sibility to repesent spatial polygonal contours as a backgroud map Thatrsquos why we created functionslsquospdf2listrsquo lsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of thepolygons
Source
Marshall R M (1991) Mapping disease and mortality rates using Empirical Bayes Estimators Ap-plied Statistics 40 283-294
Bailey T Gatrell A (1995) Interactive Spatial Data Analysis Harlow Longman - INFOMAP dataset used with permission
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)
8 auckland
auckland Marshallrsquos infant mortality in Auckland dataset
Description
The Auckland data frame has 167 rows (census area units - CAU) and 4 columns
Usage
data(auckland)
Format
A data frame with 167 observations on the following 4 variables
Easting a numeric vector of x coordinates in an unknown spatial reference system
Northing a numeric vector of y coordinates in an unknown spatial reference system
Deaths197785 a numeric vector of counts of infant (under 5 years of age) deaths in Auckland1977-1985
Under51981 a numeric vector of population under 5 years of age at the 1981 Census
Details
This data provides from spdep package
Source
Bailey T Gatrell A (1995) Interactive Spatial Data Analysis Harlow Longman - INFOMAP dataset used with permission
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Marshall R M (1991) Mapping disease and mortality rates using Empirical Bayes Estimators Ap-plied Statistics 40 283-294
Examples
data(auckland)
baltimore 9
baltimore House sales prices Baltimore MD 1978
Description
House sales price and characteristics for a spatial hedonic regression Baltimore MD 1978
Usage
data(baltimore)
Format
A data frame with 211 observations on the following 17 variables
STATION StationPRICE PriceNROOM Number of roomsDWELL Presence of well (0 or 1)NBATH Number of bathsPATIO Presence of patio (0 or 1)FIREPL Presence of fire stationAC ACBMENT BMENTNSTOR NSTORGAR Number of garagesAGE AgeCITCOU CITCOULOTSZ LOTSZSQFT SQFTX a vector x of size n
Y a vector y of size n
Details
This data provides from spdep package
Source
Prepared by Luc Anselin Original data made available by Rodin Dubin Weatherhead School ofManagement Case Western Research University Cleveland OH
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Dubin Robin A (1992) Spatial autocorrelation and neighbourhood quality Regional Scienceand Urban Economics 22(3) 433-452
10 barmap
Examples
data(baltimore)
barmap Interactive Bar plot and map
Description
The function lsquobarmaprsquo draws a bar plot (vertical bar) of the given factor variable var and a mapwith sites of coordinates (long lat)
Usage
barmap(long lat var listvar = NULL listnomvar = NULLcriteria = NULL carte = NULL label = color = 1symbol = 0 labvar = labmod = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of factor of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with name of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
barmap 11
labvar name of variable var
labmod names of factors of var
axis 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 selection of a bar on the bar plot results in the corresponding sites coloured on the map with thecorresponding colour observed on the bar Reversely the selection of sites on the map by lsquopointsrsquoor lsquopolygonrsquo results in the drawing of the sub-barplot in red
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
Examples
data oldcoldata(oldcol)data(oldcolpolys)oldcolcontourslt-polylist2list(oldcolpolys)barmap(oldcol$X oldcol$Y oldcol$NSA listvar=oldcolcarte=oldcolcontourslistnomvar=names(oldcol)criteria=(oldcol$CP==1)axis=TRUElablong=Xlablat=Y)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)barmap(eire$V1eire$V2eire$palecarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
12 boston
boston Corrected Boston Housing Data
Description
The boston data frame has 506 rows and 20 columns It contains the Harrison and Rubinfeld(1978) data corrected for a few minor errors and augmented with the latitude and longitude of theobservations Gilley and Pace also point out that MEDEV is censored in that median values at orover USD 50000 are set to USD 50000
Usage
data(boston)
Format
A data frame with 506 observations on the following 22 variables
x a vector x of size n
y a vector y of size n
TOWN a factor with levels given by town names
TOWNNO a numeric vector corresponding to town
TRACT a numeric vector of tract ID numbers
LON a numeric vector of tract point longitudes in decimal degrees
LAT a numeric vector of tract point latitudes in decimal degrees
MEDV a numeric vector of median values of owner-occupied housing in USD 1000
CMEDV a numeric vector corrected median values of owner-occupied housing in USD 1000
CRIM a numeric vector of per capita crime
ZN a numeric vector of proportions of residential land zoned for lots over 25000 sq ft per town(constant for all Boston tracts)
INDUS a numeric vector of proportions of non-retail business acres per town (constant for allBoston tracts)
CHAS a factor with levels 1 if tract borders Charles River 0 otherwise
NOX a numeric vector of nitric oxides concentration (parts per 10 million) per town
RM a numeric vector of average numbers of rooms per dwelling
AGE a numeric vector of proportions of owner-occupied units built prior to 1940
DIS a numeric vector of weighted distances to five Boston employment centres
RAD a numeric vector of an index of accessibility to radial highways per town (constant for allBoston tracts)
TAX a numeric vector full-value proprty-tax rate per USD 10000 per town (constant for all Bostontracts)
PTRATIO a numeric vector of pupil-teacher ratios per town (constant for all Boston tracts)
B a numeric vector of 1000 lowast (Bk minus 063)2 where Bk is the proportion of blacks
LSTAT a numeric vector of percentage values of lower status population
boxplotmap 13
Details
This data provides from spdep package
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Harrison David and Daniel L Rubinfeld ldquoHedonic Housing Prices and the Demand for CleanAirrdquo Journal of Environmental Economics and Management Volume 5 (1978) 81-102 Originaldata
Gilley OW and R Kelley Pace ldquoOn the Harrison and Rubinfeld Datardquo Journal of EnvironmentalEconomics and Management 31 (1996) 403-405 Provided corrections and examined censoring
Pace R Kelley and OW Gilley ldquoUsing the Spatial Configuration of the Data to Improve Estima-tionrdquo Journal of the Real Estate Finance and Economics 14 (1997) 333-340
Examples
data(boston)
boxplotmap Interactive boxplot and map
Description
The function lsquoboxplotmaprsquo draws a boxplot of the given variable var and a map with site of coor-dinates (long lat)
Usage
boxplotmap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
14 boxplotmap
listnomvar list of character of size p with names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar name of variable var
axis 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
There is an interactivity only in one direction the sites selected by interquartile on the boxplot arerepresented on the map in red
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
carte 15
Examples
donnees oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)boxplotmap(oldcol$X oldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CP==1)axis=TRUElablong=Xlablat=Y)
donnees bostondata(boston)boxplotmap(boston$xboston$yboston$CRIMlistvar=bostonlistnomvar=names(boston)criteria=(boston$CHAS==1))
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)boxplotmap(eire$V1eire$V2eire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Taux deacutevolution de la population de 1921 agrave1962)
carte Drawing a map
Description
The function lsquocartersquo draws a map with sites of coordinates (long lat) and represents sites whichhave been selected (obs) in red if symbol=0 or with star if symbol=1 This function is called bymost of the functions of GeoXp (this is not an interactive function)
Usage
carte(long lat obscriteria=NULLbuble=FALSEcbuble=NULLnointer=FALSE carte=NULLnocart=FALSE label=symbol=0col=0 lablong= lablat= method= W=NULL couleurs=classe obsqlegmap=NULLlegends=list(FALSEFALSE)labmod=axis=FALSE)
Arguments
long a vector x of size n
lat a vector y of size n
obs a boolean vector of size n with TRUE on selected sites
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
16 carte
buble a boolean with TRUE for drawing bubbles FALSE otherwise
cbuble vector of size n with size of each site depending on variable with which bubblesare constructed
nointer a boolean with TRUE for drawing sites selected by criteria FALSE otherwise
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
nocart a boolean with TRUE for drawing spatial contours FALSE otherwise
label vector of character of size n with name of each site
col 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points are inred if 1 selected points are stars
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
method Specification for some graphics such as lsquoNeighbourplot1rsquo lsquoNeighbourplot2rsquolsquoClusterrsquo lsquoAngleplotrsquo lsquoVariocloudrsquo
W neighbourhood matrix of size ntimes n necessary when method=lsquoNeighbourplotrsquo
couleurs Possibility to change colors (only for admin)
classe vector of n whith class necessary when method=lsquoClusterrsquo
obsq vector of size n with number of quadrant to which the site belongs necessarywhen method=lsquoQuadrantrsquo
legmap a list of (numericnumericnumericnumericnumericnumericcharacter) with thesizes and the corresponding values of the 3 bubbles represented in the legend andthe variable name of variable choosed
clustermap 17
legends a list of c(booleanbooleanc(numericnumeric)c(numericnumeric)) with TRUEfor drawing legends of bubbles (1st argument) or factors (2nd argument) and thecoordinates of the location of the upper left corner of the legend box
labmod Name of factors
axis a boolean with True for drawing axes on the map
Details
For factors possibility to represent sites with different colors for each level Others options permitto represent with a croice some sites with special lsquocriteriarsquo with lsquobubblersquo according to a variablegiven a spatial contours with lsquocartersquo names of sites with lsquolabelrsquo or a representation in flowerPossibility to draw a legend giving the sizes of bubbles and colors of levels
Value
No values only drawing of a map
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
clustermap Classification of dataset using kmeansr or hclustr and representationof clusters on a map
Description
The function lsquoclustermaprsquo performs a classification of the sites from the variables included indataset and computes a bar plot of the clusters calculated Classification methods comes fromhclustR (hierarchical cluster analysis) and kmeansR (k-means clustering) and number of class ischosen with clustnum
Usage
clustermap(longlatdatasetclustnummethod=kmeanstype=NULLcenters=NULLscale=FALSElistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabvar=Clusterlabel=symbol=0color=1labmod=axis=FALSElablong= lablat=)
18 clustermap
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix of variables of numeric values
clustnum Number of clusters
method two methos lsquokmeansrsquo by default or lsquohclustrsquo
type If method=lsquohclustrdquo type=ldquocompleterdquo by default (the possibilities are given inhelp(hclust) as lsquowardrsquo lsquosinglersquo etc) If method=lsquokmeansrsquo type=Hartigan-Wong by default (the possibilities are given in help(kmeans) as lsquoForgyrsquo etc)
centers If method=rsquokmeansrsquo user can give a matrix with initial cluster centers
scale If scale=TRUE the dataset is reducted
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
labvar name of variable var
label vector of size n with names of each site
color 0 or 1 (by default) choice of representation of selected points If 0 sites arerepresented in blue if 1 sites are represented with different colors for eachcluster
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labmod names of Clusters
clustermap 19
axis 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 two windows are interactive the sites selected by a bar chosen on the bar plot are representedon the map in red and the values of sites selected on the map by lsquopointsrsquo or lsquopolygonrsquo are representedin red on the bar plot The dendogram is also drawn for rsquohclustrsquo method In option possibility tochoose the classification method
Value
A vector of boolean of size n (TRUE if the site was in the last selection) and a vector of size nwhith the number of cluster for each site
Note
To use the functions hclustr and kmeansr we take many arguments by default If the user wouldlike to modify these arguments he should call these functions first and then use the functionbarmapr to visualize the calculated clusters
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Murtagh F (1985) ldquoMultidimensional Clustering Algorithmsrdquo
Hartigan J A and Wong M A (1979) A K-means clustering algorithm Applied Statistics 28100-108
See Also
barmap pcamap
Examples
donneacutees oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)obslt-clustermap(oldcol$X oldcol$Yoldcol[712]3listvar=oldcollistnomvar=names(oldcol)carte=contoursOLDcriteria=(oldcol$CP==1))
20 dbledensitymap
data avifaunelibrary(ade4)data(mafragh)dlt-distchi2(mafragh$flo)
obslt-clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4method=hclusttype=wardlistvar=mafragh$partitionlistnomvar=class)
claslt-obs$vectclasselt-by(dclasmean)glt-rbind(e[1]$1e[2]$2e[3]$3e[4]$4)
clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4centers=glistvar=mafragh$partitionlistnomvar=class)
dbledensitymap Double Kernel density estimates and map
Description
The function lsquodbledensitymaprsquo plots two kernel density estimates from var1 and var2 computedwith lsquobkdeRrsquo and a map with sites of coordinates (long lat) Each site is associated to a value ofvar1 and var2 and the two windows are interactive
Usage
dbledensitymap(long lat var1 var2kernel=triweight listvar = NULLlistnomvar = NULL carte = NULL criteria = NULL label = symbol = 0 color = 1 labvar = c(var1 var2) axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
dbledensitymap 21
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar list of character with names of variables var1 and var2
axis 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 user can choose an interval on the density curve by mouse clicking on the lower and upperboundaries of the interval or by giving directly these values The selected sites are then representedon the map in red A selection by lsquopointsrsquo or lsquopolygonrsquo on the map results in the drawing of thedensity of the corresponding sub-distribution on the density plot Finally the user can modify thebandwith parameter with a cursor in the tcltk window (parameter α) α is the smoothing parameterfor the kernel smooth it represents the mean percentage of sample points involved in the localaveraging (example α = 20 means that on average ntimes 02 points are in any interval of length 2hwhere h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
22 dblehistomap
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dbledensitymap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785))) listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-dbledensitymap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)dbledensitymap(eire$V1eire$V2eire$Aeire$townslabvar=c(Taux dindividus au groupe sanguin ASurface urbaine)carte=eirecontourskernel=normallistvar=eirelistnomvar=names(eire))
dblehistomap Double Interactive Histogram and map
Description
The function lsquodblehistomaprsquo draws two histograms of the given variables var1 and var2 and a mapwith sites of coordinates (long lat) Each site is associated to a value of var1 and var2 and thereis interactivity between the two windows created
dblehistomap 23
Usage
dblehistomap(long lat var1 var2 listvar = NULL listnomvar = NULLnbcol1 = 10 nbcol2 = 10 carte = NULL criteria = NULLsymbol = 0 color = 1 labvar = c( ) label = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
nbcol1 number of cells for histogram 1 (10 by default)
nbcol2 number of cells for histogram 2 (10 by default)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
24 densitymap
Details
The selection of sites by lsquopointsrsquo or lsquopolygonsrsquo on the map results in the drawing of the red his-tograms of the subdistributions corresponding to this subset of sites
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dblehistomap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785)))listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadblehistomap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
densitymap Kernel density estimates and map
Description
The function lsquodensitymaprsquo draws kernel density estimates of the variable var with rsquobkdeRrsquo anda map with sites of coordinate (long lat) Each site is associated to a value of var and there isinteractivity between the two windows
densitymap 25
Usage
densitymap(long lat varkernel=triweightlistvar=NULLlistnomvar=NULLcarte=NULL criteria=NULLlabel=symbol=0color=1 labvar=axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
labvar name of variable var
axis 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
26 densitymap
Details
The user can choose an interval on the density curve by mouse clicking on the graph on the extremi-ties of interval or by specifying directly values The sites selected by an interval are then representedon the map in red The selection of sites on the map by lsquopointsrsquo or lsquopolygonrsquo results in the draw-ing of the kernel densities of the subdistributions corresponding to this subset of sites Finally theuser can modify the bandwith parameter with a cursor in the tcltk window (parameter α) α is thesmoothing parameter for the kernel smooth it represents the mean percentage of sample pointsinvolved in the local averaging (example α = 20 means that on average ntimes 02 points are in anyinterval of length 2h where h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
library tcltk and KernSmooth data olcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)densitymap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadensitymap(colombuscontours$Xcolombuscontours$Ycolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)
distchi2 27
data(eirepolys)eirecontourslt-polylist2list(eirepolys)densitymap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
distchi2 It gives an euclidian distance matrix for factors using metric of χ2
Description
The function lsquodistchi2rsquo calculates an euclidian distance matrix for factors using metric of χ2
Usage
distchi2(mat)
Arguments
mat A matrix of factors given as numeric values
Details
The euclidian distance between two individuals i and k using the metric of χ2 is given by
d2χ2 =
n
p
sumj
p
mjsuml
δjlik
1nj
l
with n number of individuals p number of variables mj is the number of possibilities for variableY j nj
l is the number of individuals where l has been observed for Y j and δjlik = 1 if there is a
discordance between i and k for l and 0 otherwise It is not an interactive function
Value
It returns a dist object (see help(dist))
Author(s)
Laurent Thibault
References
Besse Philippe ldquoData mining 2 Modeacutelisation statistique et apprentissagerdquo Publication du LSPhttpwwwlspups-tlsefrBesse
See Also
clustermap
28 driftmap
driftmap Detection of an eventual trend
Description
The function lsquodriftmaprsquo creates a grid on the map and calculates the mean and median for each cellThe right plot (resp left plot) represents means and medians calculated by row (resp column)
Usage
driftmap(long lat var interpol = 1nuage = 0 carte = NULLlablong = lablat = labvar = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
interpol if 1 the mean and median calculated are linearly interpoled
nuage if 1 the individuals are also represented on the graphics
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
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
labvar name of variable lsquovarrsquo
Details
Possibility to change the number of cells in the grid with the tcltk window to interpolate the meansand medians calculated (by default) to work on a rotated map Notice that this is not an interactivefunction
Value
No values returned only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
eire 29
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmaprotation
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)driftmap(auckland$Eastingauckland$Northingauckland$Deaths197785interpol=0nuage=1lablong=Xlablat=Ylabvar=Deaths197785)
data afcondata(afcon)driftmap(afcon$xafcon$yafcon$totconinterpol=0nuage=1lablong=Xlablat=Ylabvar=Number of conflicts)
data meusedata(meuseall)data(meuseriv)driftmap(meuseall$xmeuseall$ymeuseall$coppernuage=1lablong=Xlablat=Ylabvar=Concentration de cuivre (en ppm))
eire Eire data sets
Description
The lsquoeirersquo data frame has 26 rows and 11 columns
Usage
data(eire)
Format
A data frame with 26 observations on the following 11 variables
V1 a vector x of size n
V2 a vector y of size n
A Percentage of sample with blood group A
towns Townsunit area
pale Beyond the Pale 0 within the Pale 1
size number of blood type samples
ROADACC arterial road network accessibility in 1961
30 eirepolys
OWNCONS percentage in value terms of gross agricultural output of each county consumed by itself
POPCHG 1961 population as percentage of 1926
RETSALE value of retail sales c000
INCOME total personal income c000
Details
This data provides from spdep package
Source
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
Examples
data(eire)
eirepolys Spatial polygonal contours of eire dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of eiredataset
Usage
data(eirepolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or rsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibility torepesent spatial polygonal contours as a backgroud map Thatrsquos why we create functions lsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of the polygons
Source
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
findneighbors 31
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
findneighbors Research of the m nearest neighbors for sites
Description
The function lsquofindneighborsrsquo gives for each site of coordinates (xc yc) the m nearest neighbors inthe set of sites
Usage
findneighbors(xc yc m)
Arguments
xc a numerical vector x of size n
yc a numerical vector y of size n
m number of nearest neighbors
Details
In case of ties the nearest neighbor is randomly chosen among the ties This function is called inmakeneighborswr
Value
A matrix of size ntimes n containing 1 on position (i j) if j is m-nearest neighbour to i
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakedistanceWmakeneighborsw
32 genpca
Examples
data(auckland)Wlt-findneighbors(auckland$Eastingauckland$Northing1)
genpca Generalized Principal Component Analysis (PCA)
Description
The function lsquogenpcarsquo computes a generalized Principal Component Analysis (PCA) It calculatesthe principal components the coordinates of the variables and in these principals components axesand the inertia of these principal components
Usage
genpca(data w=rep(1nrow(data)length=nrow(data)) m=diag(1ncol(data)ncol(data))center=TRUE reduc=TRUE)
Arguments
data matrix ntimes p
w vector of size n of weight (by default weight = t(1n 1n))
m matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centered PCA (by default center=TRUE)
reduc boolean if TRUE reduced PCA (by default reduce=TRUE)
Details
LetW = diag(w)
x = data = (xprime1 x
primen)prime
withxi = (x1
i xpi )
Let1n = (1 1)prime
with n rows and 1p = (1 1)prime
with p rows Normalization of weight
wi =wisumi wi
genpca 33
Vector of means x = (x1 xp)prime
withxj =
sumi
wixji
If center=Truexc = xminus 1nxprime
Standart deviation (σj)2 =
sumi
wi(xji )
2 minus (xj)2
Σ = diag((σ1)2 (σp)2)prime
If reduc=True xcr = xc times Σminus12
Variance-Covariance matrix
C = xprimecrWxcr
Cholesky decomposition M = LLprime where M=mLet
Cl = LCLprime
Let U and D as ClU = UD
with D = diag(λ1 λp)Let
V = LprimeU
Then Coordinates of individuals in the principals components basis
CC = xcrV
Coordinates of variables in principals components
V C = CV Dminus12
Inertia I = D1p
Value
Returns lsquoinertiarsquo vector of size p with percent of inertia of each component (corresponding to I)lsquocasecoordrsquo matrix ntimes p (corresponding to matrix CC) lsquovarcoordrsquo matrix ptimes p (corresponding tomatrix V C)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
34 gini
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermappcamap
gini Calculates a Gini Index
Description
The function lsquoginirsquo calculates the Gini Index associated to the variable lsquovarrsquo
Usage
gini(var)
Arguments
var a vector of numerical values of size n
Details
Let xk k = 1 K be the distinct values taken by V ar For each site Ginir returns two pairs offrequencies The pair (f g) where f represents
fk =1n
sumi
1(V ari = xk)
(n is the length of lsquovarrsquo) and g represents
gk =xk
xfk
The pair (FG) represents the corresponding cumulative frequenciesThe Gini Index is calculated as
IG =12x
Ksumi=1
Ksumj=1
|xi minus xj |
Value
(f F g G gini) where f F g and G are vectors of size K and gini a numeric value
Note
This function is used in ginimapR but it is not an interactive function
ginimap 35
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
ginimap
ginimap Lorentz curve and map
Description
The function lsquoginimaprsquo computes a Lorentz curve from rsquovarrsquo and calculates the Gini Index associ-ated to var
Usage
ginimap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
4 afcon
afcon Spatial patterns of conflict in Africa 1966-78
Description
The afcon data frame has 42 rows and 5 columns for 42 African countries exclusing then SouthWest Africa and Spanish Equatorial Africa and Spanish Sahara The dataset is used in Anselin(1995) and downloaded from before adaptation
Usage
data(afcon)
Format
A data frame with 42 observations on the following 5 variables
x an easting in decimal degrees (taken as centroiumld of shapefile polygon)
y a northing in decimal degrees (taken as centroiumld of shapefile polygon)
totcon index of total conflict 1966-78
name country name
id country id number as in paper
Details
This data provides from spdep package
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin L and John OrsquoLoughlin (1992) ldquoGeography of international conflict and cooperationspatial dependence and regional context in Africardquo In The New Geopolitics ed M Ward pp39-75
Anselin L (1995) ldquoLocal indicators of spatial associationrdquo In Geographical Analysis 27 Table1 p103
Examples
data(afcon)
angleplotmap 5
angleplotmap Detection of an eventual directional trend
Description
The function lsquoangleplotmaprsquo is used to detect an eventual directional trend associated to variablevar It represents the absolute difference between the value of var at two sites as a function of theangle between vector minusminusrarrsisj and the x-axis
Usage
angleplotmap(long lat var quantiles = NULLlistvar = NULL listnomvar = NULLcriteria = NULL carte = NULL label = symbol = 0 labvar = lablong = lablat = axis = FALSE)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
6 angleplotmap
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
axis a boolean with TRUE for drawing axes on the map
Details
For each couple of sites (si sj) the graphic represents on the y-axis the absolute difference betweenvari and varj
Dij = |vari minus varj |and on the x-axis the angle θij between the vector minusminusrarrsisj and the x-axis Possibility to represent asmoothing spline regression quantile gα For 0 lt α lt 1
Pr[Dij lt gα(θij)] = α
If that case only the pair of sites (si sj) verifying
Dij gt gmax(α)(θij)
are represented
Value
A matrix of boolean of size ntimes n TRUE if pair of sites was in the last selection
Author(s)
Thomas-Agnan Christine Aragon Yves Ruiz-Gazen Anne Laurent Thibault Robidou Laurianne
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
variocloudmapdriftmap
Examples
Data afcondata(afcon)obslt-angleplotmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon))symbol=1)
Data Meusedata(meuseall)data(meuseriv)obslt-angleplotmap(meuseall$xmeuseall$ymeuseall$copperlablong=Xlablat=Yquantiles=c(0105095)listvar=meusealllistnomvar=names(meuseall)labvar=Concentration en plomb (en ppm))points(meuseriv type = l asp = 1)
auckpolys 7
auckpolys Spatial polygonal contours of auckland dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of auckland dataset
Usage
data(auckpolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonDataFramersquo or rsquoMaprsquo object because a site can only berepresented by a pair of coordinates and not by a polygonnal contour However users have the pos-sibility to repesent spatial polygonal contours as a backgroud map Thatrsquos why we created functionslsquospdf2listrsquo lsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of thepolygons
Source
Marshall R M (1991) Mapping disease and mortality rates using Empirical Bayes Estimators Ap-plied Statistics 40 283-294
Bailey T Gatrell A (1995) Interactive Spatial Data Analysis Harlow Longman - INFOMAP dataset used with permission
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)
8 auckland
auckland Marshallrsquos infant mortality in Auckland dataset
Description
The Auckland data frame has 167 rows (census area units - CAU) and 4 columns
Usage
data(auckland)
Format
A data frame with 167 observations on the following 4 variables
Easting a numeric vector of x coordinates in an unknown spatial reference system
Northing a numeric vector of y coordinates in an unknown spatial reference system
Deaths197785 a numeric vector of counts of infant (under 5 years of age) deaths in Auckland1977-1985
Under51981 a numeric vector of population under 5 years of age at the 1981 Census
Details
This data provides from spdep package
Source
Bailey T Gatrell A (1995) Interactive Spatial Data Analysis Harlow Longman - INFOMAP dataset used with permission
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Marshall R M (1991) Mapping disease and mortality rates using Empirical Bayes Estimators Ap-plied Statistics 40 283-294
Examples
data(auckland)
baltimore 9
baltimore House sales prices Baltimore MD 1978
Description
House sales price and characteristics for a spatial hedonic regression Baltimore MD 1978
Usage
data(baltimore)
Format
A data frame with 211 observations on the following 17 variables
STATION StationPRICE PriceNROOM Number of roomsDWELL Presence of well (0 or 1)NBATH Number of bathsPATIO Presence of patio (0 or 1)FIREPL Presence of fire stationAC ACBMENT BMENTNSTOR NSTORGAR Number of garagesAGE AgeCITCOU CITCOULOTSZ LOTSZSQFT SQFTX a vector x of size n
Y a vector y of size n
Details
This data provides from spdep package
Source
Prepared by Luc Anselin Original data made available by Rodin Dubin Weatherhead School ofManagement Case Western Research University Cleveland OH
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Dubin Robin A (1992) Spatial autocorrelation and neighbourhood quality Regional Scienceand Urban Economics 22(3) 433-452
10 barmap
Examples
data(baltimore)
barmap Interactive Bar plot and map
Description
The function lsquobarmaprsquo draws a bar plot (vertical bar) of the given factor variable var and a mapwith sites of coordinates (long lat)
Usage
barmap(long lat var listvar = NULL listnomvar = NULLcriteria = NULL carte = NULL label = color = 1symbol = 0 labvar = labmod = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of factor of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with name of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
barmap 11
labvar name of variable var
labmod names of factors of var
axis 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 selection of a bar on the bar plot results in the corresponding sites coloured on the map with thecorresponding colour observed on the bar Reversely the selection of sites on the map by lsquopointsrsquoor lsquopolygonrsquo results in the drawing of the sub-barplot in red
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
Examples
data oldcoldata(oldcol)data(oldcolpolys)oldcolcontourslt-polylist2list(oldcolpolys)barmap(oldcol$X oldcol$Y oldcol$NSA listvar=oldcolcarte=oldcolcontourslistnomvar=names(oldcol)criteria=(oldcol$CP==1)axis=TRUElablong=Xlablat=Y)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)barmap(eire$V1eire$V2eire$palecarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
12 boston
boston Corrected Boston Housing Data
Description
The boston data frame has 506 rows and 20 columns It contains the Harrison and Rubinfeld(1978) data corrected for a few minor errors and augmented with the latitude and longitude of theobservations Gilley and Pace also point out that MEDEV is censored in that median values at orover USD 50000 are set to USD 50000
Usage
data(boston)
Format
A data frame with 506 observations on the following 22 variables
x a vector x of size n
y a vector y of size n
TOWN a factor with levels given by town names
TOWNNO a numeric vector corresponding to town
TRACT a numeric vector of tract ID numbers
LON a numeric vector of tract point longitudes in decimal degrees
LAT a numeric vector of tract point latitudes in decimal degrees
MEDV a numeric vector of median values of owner-occupied housing in USD 1000
CMEDV a numeric vector corrected median values of owner-occupied housing in USD 1000
CRIM a numeric vector of per capita crime
ZN a numeric vector of proportions of residential land zoned for lots over 25000 sq ft per town(constant for all Boston tracts)
INDUS a numeric vector of proportions of non-retail business acres per town (constant for allBoston tracts)
CHAS a factor with levels 1 if tract borders Charles River 0 otherwise
NOX a numeric vector of nitric oxides concentration (parts per 10 million) per town
RM a numeric vector of average numbers of rooms per dwelling
AGE a numeric vector of proportions of owner-occupied units built prior to 1940
DIS a numeric vector of weighted distances to five Boston employment centres
RAD a numeric vector of an index of accessibility to radial highways per town (constant for allBoston tracts)
TAX a numeric vector full-value proprty-tax rate per USD 10000 per town (constant for all Bostontracts)
PTRATIO a numeric vector of pupil-teacher ratios per town (constant for all Boston tracts)
B a numeric vector of 1000 lowast (Bk minus 063)2 where Bk is the proportion of blacks
LSTAT a numeric vector of percentage values of lower status population
boxplotmap 13
Details
This data provides from spdep package
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Harrison David and Daniel L Rubinfeld ldquoHedonic Housing Prices and the Demand for CleanAirrdquo Journal of Environmental Economics and Management Volume 5 (1978) 81-102 Originaldata
Gilley OW and R Kelley Pace ldquoOn the Harrison and Rubinfeld Datardquo Journal of EnvironmentalEconomics and Management 31 (1996) 403-405 Provided corrections and examined censoring
Pace R Kelley and OW Gilley ldquoUsing the Spatial Configuration of the Data to Improve Estima-tionrdquo Journal of the Real Estate Finance and Economics 14 (1997) 333-340
Examples
data(boston)
boxplotmap Interactive boxplot and map
Description
The function lsquoboxplotmaprsquo draws a boxplot of the given variable var and a map with site of coor-dinates (long lat)
Usage
boxplotmap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
14 boxplotmap
listnomvar list of character of size p with names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar name of variable var
axis 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
There is an interactivity only in one direction the sites selected by interquartile on the boxplot arerepresented on the map in red
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
carte 15
Examples
donnees oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)boxplotmap(oldcol$X oldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CP==1)axis=TRUElablong=Xlablat=Y)
donnees bostondata(boston)boxplotmap(boston$xboston$yboston$CRIMlistvar=bostonlistnomvar=names(boston)criteria=(boston$CHAS==1))
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)boxplotmap(eire$V1eire$V2eire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Taux deacutevolution de la population de 1921 agrave1962)
carte Drawing a map
Description
The function lsquocartersquo draws a map with sites of coordinates (long lat) and represents sites whichhave been selected (obs) in red if symbol=0 or with star if symbol=1 This function is called bymost of the functions of GeoXp (this is not an interactive function)
Usage
carte(long lat obscriteria=NULLbuble=FALSEcbuble=NULLnointer=FALSE carte=NULLnocart=FALSE label=symbol=0col=0 lablong= lablat= method= W=NULL couleurs=classe obsqlegmap=NULLlegends=list(FALSEFALSE)labmod=axis=FALSE)
Arguments
long a vector x of size n
lat a vector y of size n
obs a boolean vector of size n with TRUE on selected sites
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
16 carte
buble a boolean with TRUE for drawing bubbles FALSE otherwise
cbuble vector of size n with size of each site depending on variable with which bubblesare constructed
nointer a boolean with TRUE for drawing sites selected by criteria FALSE otherwise
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
nocart a boolean with TRUE for drawing spatial contours FALSE otherwise
label vector of character of size n with name of each site
col 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points are inred if 1 selected points are stars
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
method Specification for some graphics such as lsquoNeighbourplot1rsquo lsquoNeighbourplot2rsquolsquoClusterrsquo lsquoAngleplotrsquo lsquoVariocloudrsquo
W neighbourhood matrix of size ntimes n necessary when method=lsquoNeighbourplotrsquo
couleurs Possibility to change colors (only for admin)
classe vector of n whith class necessary when method=lsquoClusterrsquo
obsq vector of size n with number of quadrant to which the site belongs necessarywhen method=lsquoQuadrantrsquo
legmap a list of (numericnumericnumericnumericnumericnumericcharacter) with thesizes and the corresponding values of the 3 bubbles represented in the legend andthe variable name of variable choosed
clustermap 17
legends a list of c(booleanbooleanc(numericnumeric)c(numericnumeric)) with TRUEfor drawing legends of bubbles (1st argument) or factors (2nd argument) and thecoordinates of the location of the upper left corner of the legend box
labmod Name of factors
axis a boolean with True for drawing axes on the map
Details
For factors possibility to represent sites with different colors for each level Others options permitto represent with a croice some sites with special lsquocriteriarsquo with lsquobubblersquo according to a variablegiven a spatial contours with lsquocartersquo names of sites with lsquolabelrsquo or a representation in flowerPossibility to draw a legend giving the sizes of bubbles and colors of levels
Value
No values only drawing of a map
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
clustermap Classification of dataset using kmeansr or hclustr and representationof clusters on a map
Description
The function lsquoclustermaprsquo performs a classification of the sites from the variables included indataset and computes a bar plot of the clusters calculated Classification methods comes fromhclustR (hierarchical cluster analysis) and kmeansR (k-means clustering) and number of class ischosen with clustnum
Usage
clustermap(longlatdatasetclustnummethod=kmeanstype=NULLcenters=NULLscale=FALSElistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabvar=Clusterlabel=symbol=0color=1labmod=axis=FALSElablong= lablat=)
18 clustermap
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix of variables of numeric values
clustnum Number of clusters
method two methos lsquokmeansrsquo by default or lsquohclustrsquo
type If method=lsquohclustrdquo type=ldquocompleterdquo by default (the possibilities are given inhelp(hclust) as lsquowardrsquo lsquosinglersquo etc) If method=lsquokmeansrsquo type=Hartigan-Wong by default (the possibilities are given in help(kmeans) as lsquoForgyrsquo etc)
centers If method=rsquokmeansrsquo user can give a matrix with initial cluster centers
scale If scale=TRUE the dataset is reducted
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
labvar name of variable var
label vector of size n with names of each site
color 0 or 1 (by default) choice of representation of selected points If 0 sites arerepresented in blue if 1 sites are represented with different colors for eachcluster
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labmod names of Clusters
clustermap 19
axis 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 two windows are interactive the sites selected by a bar chosen on the bar plot are representedon the map in red and the values of sites selected on the map by lsquopointsrsquo or lsquopolygonrsquo are representedin red on the bar plot The dendogram is also drawn for rsquohclustrsquo method In option possibility tochoose the classification method
Value
A vector of boolean of size n (TRUE if the site was in the last selection) and a vector of size nwhith the number of cluster for each site
Note
To use the functions hclustr and kmeansr we take many arguments by default If the user wouldlike to modify these arguments he should call these functions first and then use the functionbarmapr to visualize the calculated clusters
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Murtagh F (1985) ldquoMultidimensional Clustering Algorithmsrdquo
Hartigan J A and Wong M A (1979) A K-means clustering algorithm Applied Statistics 28100-108
See Also
barmap pcamap
Examples
donneacutees oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)obslt-clustermap(oldcol$X oldcol$Yoldcol[712]3listvar=oldcollistnomvar=names(oldcol)carte=contoursOLDcriteria=(oldcol$CP==1))
20 dbledensitymap
data avifaunelibrary(ade4)data(mafragh)dlt-distchi2(mafragh$flo)
obslt-clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4method=hclusttype=wardlistvar=mafragh$partitionlistnomvar=class)
claslt-obs$vectclasselt-by(dclasmean)glt-rbind(e[1]$1e[2]$2e[3]$3e[4]$4)
clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4centers=glistvar=mafragh$partitionlistnomvar=class)
dbledensitymap Double Kernel density estimates and map
Description
The function lsquodbledensitymaprsquo plots two kernel density estimates from var1 and var2 computedwith lsquobkdeRrsquo and a map with sites of coordinates (long lat) Each site is associated to a value ofvar1 and var2 and the two windows are interactive
Usage
dbledensitymap(long lat var1 var2kernel=triweight listvar = NULLlistnomvar = NULL carte = NULL criteria = NULL label = symbol = 0 color = 1 labvar = c(var1 var2) axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
dbledensitymap 21
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar list of character with names of variables var1 and var2
axis 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 user can choose an interval on the density curve by mouse clicking on the lower and upperboundaries of the interval or by giving directly these values The selected sites are then representedon the map in red A selection by lsquopointsrsquo or lsquopolygonrsquo on the map results in the drawing of thedensity of the corresponding sub-distribution on the density plot Finally the user can modify thebandwith parameter with a cursor in the tcltk window (parameter α) α is the smoothing parameterfor the kernel smooth it represents the mean percentage of sample points involved in the localaveraging (example α = 20 means that on average ntimes 02 points are in any interval of length 2hwhere h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
22 dblehistomap
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dbledensitymap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785))) listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-dbledensitymap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)dbledensitymap(eire$V1eire$V2eire$Aeire$townslabvar=c(Taux dindividus au groupe sanguin ASurface urbaine)carte=eirecontourskernel=normallistvar=eirelistnomvar=names(eire))
dblehistomap Double Interactive Histogram and map
Description
The function lsquodblehistomaprsquo draws two histograms of the given variables var1 and var2 and a mapwith sites of coordinates (long lat) Each site is associated to a value of var1 and var2 and thereis interactivity between the two windows created
dblehistomap 23
Usage
dblehistomap(long lat var1 var2 listvar = NULL listnomvar = NULLnbcol1 = 10 nbcol2 = 10 carte = NULL criteria = NULLsymbol = 0 color = 1 labvar = c( ) label = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
nbcol1 number of cells for histogram 1 (10 by default)
nbcol2 number of cells for histogram 2 (10 by default)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
24 densitymap
Details
The selection of sites by lsquopointsrsquo or lsquopolygonsrsquo on the map results in the drawing of the red his-tograms of the subdistributions corresponding to this subset of sites
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dblehistomap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785)))listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadblehistomap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
densitymap Kernel density estimates and map
Description
The function lsquodensitymaprsquo draws kernel density estimates of the variable var with rsquobkdeRrsquo anda map with sites of coordinate (long lat) Each site is associated to a value of var and there isinteractivity between the two windows
densitymap 25
Usage
densitymap(long lat varkernel=triweightlistvar=NULLlistnomvar=NULLcarte=NULL criteria=NULLlabel=symbol=0color=1 labvar=axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
labvar name of variable var
axis 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
26 densitymap
Details
The user can choose an interval on the density curve by mouse clicking on the graph on the extremi-ties of interval or by specifying directly values The sites selected by an interval are then representedon the map in red The selection of sites on the map by lsquopointsrsquo or lsquopolygonrsquo results in the draw-ing of the kernel densities of the subdistributions corresponding to this subset of sites Finally theuser can modify the bandwith parameter with a cursor in the tcltk window (parameter α) α is thesmoothing parameter for the kernel smooth it represents the mean percentage of sample pointsinvolved in the local averaging (example α = 20 means that on average ntimes 02 points are in anyinterval of length 2h where h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
library tcltk and KernSmooth data olcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)densitymap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadensitymap(colombuscontours$Xcolombuscontours$Ycolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)
distchi2 27
data(eirepolys)eirecontourslt-polylist2list(eirepolys)densitymap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
distchi2 It gives an euclidian distance matrix for factors using metric of χ2
Description
The function lsquodistchi2rsquo calculates an euclidian distance matrix for factors using metric of χ2
Usage
distchi2(mat)
Arguments
mat A matrix of factors given as numeric values
Details
The euclidian distance between two individuals i and k using the metric of χ2 is given by
d2χ2 =
n
p
sumj
p
mjsuml
δjlik
1nj
l
with n number of individuals p number of variables mj is the number of possibilities for variableY j nj
l is the number of individuals where l has been observed for Y j and δjlik = 1 if there is a
discordance between i and k for l and 0 otherwise It is not an interactive function
Value
It returns a dist object (see help(dist))
Author(s)
Laurent Thibault
References
Besse Philippe ldquoData mining 2 Modeacutelisation statistique et apprentissagerdquo Publication du LSPhttpwwwlspups-tlsefrBesse
See Also
clustermap
28 driftmap
driftmap Detection of an eventual trend
Description
The function lsquodriftmaprsquo creates a grid on the map and calculates the mean and median for each cellThe right plot (resp left plot) represents means and medians calculated by row (resp column)
Usage
driftmap(long lat var interpol = 1nuage = 0 carte = NULLlablong = lablat = labvar = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
interpol if 1 the mean and median calculated are linearly interpoled
nuage if 1 the individuals are also represented on the graphics
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
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
labvar name of variable lsquovarrsquo
Details
Possibility to change the number of cells in the grid with the tcltk window to interpolate the meansand medians calculated (by default) to work on a rotated map Notice that this is not an interactivefunction
Value
No values returned only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
eire 29
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmaprotation
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)driftmap(auckland$Eastingauckland$Northingauckland$Deaths197785interpol=0nuage=1lablong=Xlablat=Ylabvar=Deaths197785)
data afcondata(afcon)driftmap(afcon$xafcon$yafcon$totconinterpol=0nuage=1lablong=Xlablat=Ylabvar=Number of conflicts)
data meusedata(meuseall)data(meuseriv)driftmap(meuseall$xmeuseall$ymeuseall$coppernuage=1lablong=Xlablat=Ylabvar=Concentration de cuivre (en ppm))
eire Eire data sets
Description
The lsquoeirersquo data frame has 26 rows and 11 columns
Usage
data(eire)
Format
A data frame with 26 observations on the following 11 variables
V1 a vector x of size n
V2 a vector y of size n
A Percentage of sample with blood group A
towns Townsunit area
pale Beyond the Pale 0 within the Pale 1
size number of blood type samples
ROADACC arterial road network accessibility in 1961
30 eirepolys
OWNCONS percentage in value terms of gross agricultural output of each county consumed by itself
POPCHG 1961 population as percentage of 1926
RETSALE value of retail sales c000
INCOME total personal income c000
Details
This data provides from spdep package
Source
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
Examples
data(eire)
eirepolys Spatial polygonal contours of eire dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of eiredataset
Usage
data(eirepolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or rsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibility torepesent spatial polygonal contours as a backgroud map Thatrsquos why we create functions lsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of the polygons
Source
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
findneighbors 31
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
findneighbors Research of the m nearest neighbors for sites
Description
The function lsquofindneighborsrsquo gives for each site of coordinates (xc yc) the m nearest neighbors inthe set of sites
Usage
findneighbors(xc yc m)
Arguments
xc a numerical vector x of size n
yc a numerical vector y of size n
m number of nearest neighbors
Details
In case of ties the nearest neighbor is randomly chosen among the ties This function is called inmakeneighborswr
Value
A matrix of size ntimes n containing 1 on position (i j) if j is m-nearest neighbour to i
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakedistanceWmakeneighborsw
32 genpca
Examples
data(auckland)Wlt-findneighbors(auckland$Eastingauckland$Northing1)
genpca Generalized Principal Component Analysis (PCA)
Description
The function lsquogenpcarsquo computes a generalized Principal Component Analysis (PCA) It calculatesthe principal components the coordinates of the variables and in these principals components axesand the inertia of these principal components
Usage
genpca(data w=rep(1nrow(data)length=nrow(data)) m=diag(1ncol(data)ncol(data))center=TRUE reduc=TRUE)
Arguments
data matrix ntimes p
w vector of size n of weight (by default weight = t(1n 1n))
m matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centered PCA (by default center=TRUE)
reduc boolean if TRUE reduced PCA (by default reduce=TRUE)
Details
LetW = diag(w)
x = data = (xprime1 x
primen)prime
withxi = (x1
i xpi )
Let1n = (1 1)prime
with n rows and 1p = (1 1)prime
with p rows Normalization of weight
wi =wisumi wi
genpca 33
Vector of means x = (x1 xp)prime
withxj =
sumi
wixji
If center=Truexc = xminus 1nxprime
Standart deviation (σj)2 =
sumi
wi(xji )
2 minus (xj)2
Σ = diag((σ1)2 (σp)2)prime
If reduc=True xcr = xc times Σminus12
Variance-Covariance matrix
C = xprimecrWxcr
Cholesky decomposition M = LLprime where M=mLet
Cl = LCLprime
Let U and D as ClU = UD
with D = diag(λ1 λp)Let
V = LprimeU
Then Coordinates of individuals in the principals components basis
CC = xcrV
Coordinates of variables in principals components
V C = CV Dminus12
Inertia I = D1p
Value
Returns lsquoinertiarsquo vector of size p with percent of inertia of each component (corresponding to I)lsquocasecoordrsquo matrix ntimes p (corresponding to matrix CC) lsquovarcoordrsquo matrix ptimes p (corresponding tomatrix V C)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
34 gini
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermappcamap
gini Calculates a Gini Index
Description
The function lsquoginirsquo calculates the Gini Index associated to the variable lsquovarrsquo
Usage
gini(var)
Arguments
var a vector of numerical values of size n
Details
Let xk k = 1 K be the distinct values taken by V ar For each site Ginir returns two pairs offrequencies The pair (f g) where f represents
fk =1n
sumi
1(V ari = xk)
(n is the length of lsquovarrsquo) and g represents
gk =xk
xfk
The pair (FG) represents the corresponding cumulative frequenciesThe Gini Index is calculated as
IG =12x
Ksumi=1
Ksumj=1
|xi minus xj |
Value
(f F g G gini) where f F g and G are vectors of size K and gini a numeric value
Note
This function is used in ginimapR but it is not an interactive function
ginimap 35
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
ginimap
ginimap Lorentz curve and map
Description
The function lsquoginimaprsquo computes a Lorentz curve from rsquovarrsquo and calculates the Gini Index associ-ated to var
Usage
ginimap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
angleplotmap 5
angleplotmap Detection of an eventual directional trend
Description
The function lsquoangleplotmaprsquo is used to detect an eventual directional trend associated to variablevar It represents the absolute difference between the value of var at two sites as a function of theangle between vector minusminusrarrsisj and the x-axis
Usage
angleplotmap(long lat var quantiles = NULLlistvar = NULL listnomvar = NULLcriteria = NULL carte = NULL label = symbol = 0 labvar = lablong = lablat = axis = FALSE)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
6 angleplotmap
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
axis a boolean with TRUE for drawing axes on the map
Details
For each couple of sites (si sj) the graphic represents on the y-axis the absolute difference betweenvari and varj
Dij = |vari minus varj |and on the x-axis the angle θij between the vector minusminusrarrsisj and the x-axis Possibility to represent asmoothing spline regression quantile gα For 0 lt α lt 1
Pr[Dij lt gα(θij)] = α
If that case only the pair of sites (si sj) verifying
Dij gt gmax(α)(θij)
are represented
Value
A matrix of boolean of size ntimes n TRUE if pair of sites was in the last selection
Author(s)
Thomas-Agnan Christine Aragon Yves Ruiz-Gazen Anne Laurent Thibault Robidou Laurianne
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
variocloudmapdriftmap
Examples
Data afcondata(afcon)obslt-angleplotmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon))symbol=1)
Data Meusedata(meuseall)data(meuseriv)obslt-angleplotmap(meuseall$xmeuseall$ymeuseall$copperlablong=Xlablat=Yquantiles=c(0105095)listvar=meusealllistnomvar=names(meuseall)labvar=Concentration en plomb (en ppm))points(meuseriv type = l asp = 1)
auckpolys 7
auckpolys Spatial polygonal contours of auckland dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of auckland dataset
Usage
data(auckpolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonDataFramersquo or rsquoMaprsquo object because a site can only berepresented by a pair of coordinates and not by a polygonnal contour However users have the pos-sibility to repesent spatial polygonal contours as a backgroud map Thatrsquos why we created functionslsquospdf2listrsquo lsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of thepolygons
Source
Marshall R M (1991) Mapping disease and mortality rates using Empirical Bayes Estimators Ap-plied Statistics 40 283-294
Bailey T Gatrell A (1995) Interactive Spatial Data Analysis Harlow Longman - INFOMAP dataset used with permission
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)
8 auckland
auckland Marshallrsquos infant mortality in Auckland dataset
Description
The Auckland data frame has 167 rows (census area units - CAU) and 4 columns
Usage
data(auckland)
Format
A data frame with 167 observations on the following 4 variables
Easting a numeric vector of x coordinates in an unknown spatial reference system
Northing a numeric vector of y coordinates in an unknown spatial reference system
Deaths197785 a numeric vector of counts of infant (under 5 years of age) deaths in Auckland1977-1985
Under51981 a numeric vector of population under 5 years of age at the 1981 Census
Details
This data provides from spdep package
Source
Bailey T Gatrell A (1995) Interactive Spatial Data Analysis Harlow Longman - INFOMAP dataset used with permission
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Marshall R M (1991) Mapping disease and mortality rates using Empirical Bayes Estimators Ap-plied Statistics 40 283-294
Examples
data(auckland)
baltimore 9
baltimore House sales prices Baltimore MD 1978
Description
House sales price and characteristics for a spatial hedonic regression Baltimore MD 1978
Usage
data(baltimore)
Format
A data frame with 211 observations on the following 17 variables
STATION StationPRICE PriceNROOM Number of roomsDWELL Presence of well (0 or 1)NBATH Number of bathsPATIO Presence of patio (0 or 1)FIREPL Presence of fire stationAC ACBMENT BMENTNSTOR NSTORGAR Number of garagesAGE AgeCITCOU CITCOULOTSZ LOTSZSQFT SQFTX a vector x of size n
Y a vector y of size n
Details
This data provides from spdep package
Source
Prepared by Luc Anselin Original data made available by Rodin Dubin Weatherhead School ofManagement Case Western Research University Cleveland OH
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Dubin Robin A (1992) Spatial autocorrelation and neighbourhood quality Regional Scienceand Urban Economics 22(3) 433-452
10 barmap
Examples
data(baltimore)
barmap Interactive Bar plot and map
Description
The function lsquobarmaprsquo draws a bar plot (vertical bar) of the given factor variable var and a mapwith sites of coordinates (long lat)
Usage
barmap(long lat var listvar = NULL listnomvar = NULLcriteria = NULL carte = NULL label = color = 1symbol = 0 labvar = labmod = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of factor of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with name of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
barmap 11
labvar name of variable var
labmod names of factors of var
axis 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 selection of a bar on the bar plot results in the corresponding sites coloured on the map with thecorresponding colour observed on the bar Reversely the selection of sites on the map by lsquopointsrsquoor lsquopolygonrsquo results in the drawing of the sub-barplot in red
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
Examples
data oldcoldata(oldcol)data(oldcolpolys)oldcolcontourslt-polylist2list(oldcolpolys)barmap(oldcol$X oldcol$Y oldcol$NSA listvar=oldcolcarte=oldcolcontourslistnomvar=names(oldcol)criteria=(oldcol$CP==1)axis=TRUElablong=Xlablat=Y)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)barmap(eire$V1eire$V2eire$palecarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
12 boston
boston Corrected Boston Housing Data
Description
The boston data frame has 506 rows and 20 columns It contains the Harrison and Rubinfeld(1978) data corrected for a few minor errors and augmented with the latitude and longitude of theobservations Gilley and Pace also point out that MEDEV is censored in that median values at orover USD 50000 are set to USD 50000
Usage
data(boston)
Format
A data frame with 506 observations on the following 22 variables
x a vector x of size n
y a vector y of size n
TOWN a factor with levels given by town names
TOWNNO a numeric vector corresponding to town
TRACT a numeric vector of tract ID numbers
LON a numeric vector of tract point longitudes in decimal degrees
LAT a numeric vector of tract point latitudes in decimal degrees
MEDV a numeric vector of median values of owner-occupied housing in USD 1000
CMEDV a numeric vector corrected median values of owner-occupied housing in USD 1000
CRIM a numeric vector of per capita crime
ZN a numeric vector of proportions of residential land zoned for lots over 25000 sq ft per town(constant for all Boston tracts)
INDUS a numeric vector of proportions of non-retail business acres per town (constant for allBoston tracts)
CHAS a factor with levels 1 if tract borders Charles River 0 otherwise
NOX a numeric vector of nitric oxides concentration (parts per 10 million) per town
RM a numeric vector of average numbers of rooms per dwelling
AGE a numeric vector of proportions of owner-occupied units built prior to 1940
DIS a numeric vector of weighted distances to five Boston employment centres
RAD a numeric vector of an index of accessibility to radial highways per town (constant for allBoston tracts)
TAX a numeric vector full-value proprty-tax rate per USD 10000 per town (constant for all Bostontracts)
PTRATIO a numeric vector of pupil-teacher ratios per town (constant for all Boston tracts)
B a numeric vector of 1000 lowast (Bk minus 063)2 where Bk is the proportion of blacks
LSTAT a numeric vector of percentage values of lower status population
boxplotmap 13
Details
This data provides from spdep package
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Harrison David and Daniel L Rubinfeld ldquoHedonic Housing Prices and the Demand for CleanAirrdquo Journal of Environmental Economics and Management Volume 5 (1978) 81-102 Originaldata
Gilley OW and R Kelley Pace ldquoOn the Harrison and Rubinfeld Datardquo Journal of EnvironmentalEconomics and Management 31 (1996) 403-405 Provided corrections and examined censoring
Pace R Kelley and OW Gilley ldquoUsing the Spatial Configuration of the Data to Improve Estima-tionrdquo Journal of the Real Estate Finance and Economics 14 (1997) 333-340
Examples
data(boston)
boxplotmap Interactive boxplot and map
Description
The function lsquoboxplotmaprsquo draws a boxplot of the given variable var and a map with site of coor-dinates (long lat)
Usage
boxplotmap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
14 boxplotmap
listnomvar list of character of size p with names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar name of variable var
axis 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
There is an interactivity only in one direction the sites selected by interquartile on the boxplot arerepresented on the map in red
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
carte 15
Examples
donnees oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)boxplotmap(oldcol$X oldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CP==1)axis=TRUElablong=Xlablat=Y)
donnees bostondata(boston)boxplotmap(boston$xboston$yboston$CRIMlistvar=bostonlistnomvar=names(boston)criteria=(boston$CHAS==1))
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)boxplotmap(eire$V1eire$V2eire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Taux deacutevolution de la population de 1921 agrave1962)
carte Drawing a map
Description
The function lsquocartersquo draws a map with sites of coordinates (long lat) and represents sites whichhave been selected (obs) in red if symbol=0 or with star if symbol=1 This function is called bymost of the functions of GeoXp (this is not an interactive function)
Usage
carte(long lat obscriteria=NULLbuble=FALSEcbuble=NULLnointer=FALSE carte=NULLnocart=FALSE label=symbol=0col=0 lablong= lablat= method= W=NULL couleurs=classe obsqlegmap=NULLlegends=list(FALSEFALSE)labmod=axis=FALSE)
Arguments
long a vector x of size n
lat a vector y of size n
obs a boolean vector of size n with TRUE on selected sites
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
16 carte
buble a boolean with TRUE for drawing bubbles FALSE otherwise
cbuble vector of size n with size of each site depending on variable with which bubblesare constructed
nointer a boolean with TRUE for drawing sites selected by criteria FALSE otherwise
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
nocart a boolean with TRUE for drawing spatial contours FALSE otherwise
label vector of character of size n with name of each site
col 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points are inred if 1 selected points are stars
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
method Specification for some graphics such as lsquoNeighbourplot1rsquo lsquoNeighbourplot2rsquolsquoClusterrsquo lsquoAngleplotrsquo lsquoVariocloudrsquo
W neighbourhood matrix of size ntimes n necessary when method=lsquoNeighbourplotrsquo
couleurs Possibility to change colors (only for admin)
classe vector of n whith class necessary when method=lsquoClusterrsquo
obsq vector of size n with number of quadrant to which the site belongs necessarywhen method=lsquoQuadrantrsquo
legmap a list of (numericnumericnumericnumericnumericnumericcharacter) with thesizes and the corresponding values of the 3 bubbles represented in the legend andthe variable name of variable choosed
clustermap 17
legends a list of c(booleanbooleanc(numericnumeric)c(numericnumeric)) with TRUEfor drawing legends of bubbles (1st argument) or factors (2nd argument) and thecoordinates of the location of the upper left corner of the legend box
labmod Name of factors
axis a boolean with True for drawing axes on the map
Details
For factors possibility to represent sites with different colors for each level Others options permitto represent with a croice some sites with special lsquocriteriarsquo with lsquobubblersquo according to a variablegiven a spatial contours with lsquocartersquo names of sites with lsquolabelrsquo or a representation in flowerPossibility to draw a legend giving the sizes of bubbles and colors of levels
Value
No values only drawing of a map
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
clustermap Classification of dataset using kmeansr or hclustr and representationof clusters on a map
Description
The function lsquoclustermaprsquo performs a classification of the sites from the variables included indataset and computes a bar plot of the clusters calculated Classification methods comes fromhclustR (hierarchical cluster analysis) and kmeansR (k-means clustering) and number of class ischosen with clustnum
Usage
clustermap(longlatdatasetclustnummethod=kmeanstype=NULLcenters=NULLscale=FALSElistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabvar=Clusterlabel=symbol=0color=1labmod=axis=FALSElablong= lablat=)
18 clustermap
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix of variables of numeric values
clustnum Number of clusters
method two methos lsquokmeansrsquo by default or lsquohclustrsquo
type If method=lsquohclustrdquo type=ldquocompleterdquo by default (the possibilities are given inhelp(hclust) as lsquowardrsquo lsquosinglersquo etc) If method=lsquokmeansrsquo type=Hartigan-Wong by default (the possibilities are given in help(kmeans) as lsquoForgyrsquo etc)
centers If method=rsquokmeansrsquo user can give a matrix with initial cluster centers
scale If scale=TRUE the dataset is reducted
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
labvar name of variable var
label vector of size n with names of each site
color 0 or 1 (by default) choice of representation of selected points If 0 sites arerepresented in blue if 1 sites are represented with different colors for eachcluster
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labmod names of Clusters
clustermap 19
axis 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 two windows are interactive the sites selected by a bar chosen on the bar plot are representedon the map in red and the values of sites selected on the map by lsquopointsrsquo or lsquopolygonrsquo are representedin red on the bar plot The dendogram is also drawn for rsquohclustrsquo method In option possibility tochoose the classification method
Value
A vector of boolean of size n (TRUE if the site was in the last selection) and a vector of size nwhith the number of cluster for each site
Note
To use the functions hclustr and kmeansr we take many arguments by default If the user wouldlike to modify these arguments he should call these functions first and then use the functionbarmapr to visualize the calculated clusters
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Murtagh F (1985) ldquoMultidimensional Clustering Algorithmsrdquo
Hartigan J A and Wong M A (1979) A K-means clustering algorithm Applied Statistics 28100-108
See Also
barmap pcamap
Examples
donneacutees oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)obslt-clustermap(oldcol$X oldcol$Yoldcol[712]3listvar=oldcollistnomvar=names(oldcol)carte=contoursOLDcriteria=(oldcol$CP==1))
20 dbledensitymap
data avifaunelibrary(ade4)data(mafragh)dlt-distchi2(mafragh$flo)
obslt-clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4method=hclusttype=wardlistvar=mafragh$partitionlistnomvar=class)
claslt-obs$vectclasselt-by(dclasmean)glt-rbind(e[1]$1e[2]$2e[3]$3e[4]$4)
clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4centers=glistvar=mafragh$partitionlistnomvar=class)
dbledensitymap Double Kernel density estimates and map
Description
The function lsquodbledensitymaprsquo plots two kernel density estimates from var1 and var2 computedwith lsquobkdeRrsquo and a map with sites of coordinates (long lat) Each site is associated to a value ofvar1 and var2 and the two windows are interactive
Usage
dbledensitymap(long lat var1 var2kernel=triweight listvar = NULLlistnomvar = NULL carte = NULL criteria = NULL label = symbol = 0 color = 1 labvar = c(var1 var2) axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
dbledensitymap 21
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar list of character with names of variables var1 and var2
axis 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 user can choose an interval on the density curve by mouse clicking on the lower and upperboundaries of the interval or by giving directly these values The selected sites are then representedon the map in red A selection by lsquopointsrsquo or lsquopolygonrsquo on the map results in the drawing of thedensity of the corresponding sub-distribution on the density plot Finally the user can modify thebandwith parameter with a cursor in the tcltk window (parameter α) α is the smoothing parameterfor the kernel smooth it represents the mean percentage of sample points involved in the localaveraging (example α = 20 means that on average ntimes 02 points are in any interval of length 2hwhere h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
22 dblehistomap
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dbledensitymap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785))) listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-dbledensitymap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)dbledensitymap(eire$V1eire$V2eire$Aeire$townslabvar=c(Taux dindividus au groupe sanguin ASurface urbaine)carte=eirecontourskernel=normallistvar=eirelistnomvar=names(eire))
dblehistomap Double Interactive Histogram and map
Description
The function lsquodblehistomaprsquo draws two histograms of the given variables var1 and var2 and a mapwith sites of coordinates (long lat) Each site is associated to a value of var1 and var2 and thereis interactivity between the two windows created
dblehistomap 23
Usage
dblehistomap(long lat var1 var2 listvar = NULL listnomvar = NULLnbcol1 = 10 nbcol2 = 10 carte = NULL criteria = NULLsymbol = 0 color = 1 labvar = c( ) label = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
nbcol1 number of cells for histogram 1 (10 by default)
nbcol2 number of cells for histogram 2 (10 by default)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
24 densitymap
Details
The selection of sites by lsquopointsrsquo or lsquopolygonsrsquo on the map results in the drawing of the red his-tograms of the subdistributions corresponding to this subset of sites
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dblehistomap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785)))listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadblehistomap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
densitymap Kernel density estimates and map
Description
The function lsquodensitymaprsquo draws kernel density estimates of the variable var with rsquobkdeRrsquo anda map with sites of coordinate (long lat) Each site is associated to a value of var and there isinteractivity between the two windows
densitymap 25
Usage
densitymap(long lat varkernel=triweightlistvar=NULLlistnomvar=NULLcarte=NULL criteria=NULLlabel=symbol=0color=1 labvar=axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
labvar name of variable var
axis 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
26 densitymap
Details
The user can choose an interval on the density curve by mouse clicking on the graph on the extremi-ties of interval or by specifying directly values The sites selected by an interval are then representedon the map in red The selection of sites on the map by lsquopointsrsquo or lsquopolygonrsquo results in the draw-ing of the kernel densities of the subdistributions corresponding to this subset of sites Finally theuser can modify the bandwith parameter with a cursor in the tcltk window (parameter α) α is thesmoothing parameter for the kernel smooth it represents the mean percentage of sample pointsinvolved in the local averaging (example α = 20 means that on average ntimes 02 points are in anyinterval of length 2h where h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
library tcltk and KernSmooth data olcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)densitymap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadensitymap(colombuscontours$Xcolombuscontours$Ycolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)
distchi2 27
data(eirepolys)eirecontourslt-polylist2list(eirepolys)densitymap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
distchi2 It gives an euclidian distance matrix for factors using metric of χ2
Description
The function lsquodistchi2rsquo calculates an euclidian distance matrix for factors using metric of χ2
Usage
distchi2(mat)
Arguments
mat A matrix of factors given as numeric values
Details
The euclidian distance between two individuals i and k using the metric of χ2 is given by
d2χ2 =
n
p
sumj
p
mjsuml
δjlik
1nj
l
with n number of individuals p number of variables mj is the number of possibilities for variableY j nj
l is the number of individuals where l has been observed for Y j and δjlik = 1 if there is a
discordance between i and k for l and 0 otherwise It is not an interactive function
Value
It returns a dist object (see help(dist))
Author(s)
Laurent Thibault
References
Besse Philippe ldquoData mining 2 Modeacutelisation statistique et apprentissagerdquo Publication du LSPhttpwwwlspups-tlsefrBesse
See Also
clustermap
28 driftmap
driftmap Detection of an eventual trend
Description
The function lsquodriftmaprsquo creates a grid on the map and calculates the mean and median for each cellThe right plot (resp left plot) represents means and medians calculated by row (resp column)
Usage
driftmap(long lat var interpol = 1nuage = 0 carte = NULLlablong = lablat = labvar = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
interpol if 1 the mean and median calculated are linearly interpoled
nuage if 1 the individuals are also represented on the graphics
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
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
labvar name of variable lsquovarrsquo
Details
Possibility to change the number of cells in the grid with the tcltk window to interpolate the meansand medians calculated (by default) to work on a rotated map Notice that this is not an interactivefunction
Value
No values returned only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
eire 29
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmaprotation
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)driftmap(auckland$Eastingauckland$Northingauckland$Deaths197785interpol=0nuage=1lablong=Xlablat=Ylabvar=Deaths197785)
data afcondata(afcon)driftmap(afcon$xafcon$yafcon$totconinterpol=0nuage=1lablong=Xlablat=Ylabvar=Number of conflicts)
data meusedata(meuseall)data(meuseriv)driftmap(meuseall$xmeuseall$ymeuseall$coppernuage=1lablong=Xlablat=Ylabvar=Concentration de cuivre (en ppm))
eire Eire data sets
Description
The lsquoeirersquo data frame has 26 rows and 11 columns
Usage
data(eire)
Format
A data frame with 26 observations on the following 11 variables
V1 a vector x of size n
V2 a vector y of size n
A Percentage of sample with blood group A
towns Townsunit area
pale Beyond the Pale 0 within the Pale 1
size number of blood type samples
ROADACC arterial road network accessibility in 1961
30 eirepolys
OWNCONS percentage in value terms of gross agricultural output of each county consumed by itself
POPCHG 1961 population as percentage of 1926
RETSALE value of retail sales c000
INCOME total personal income c000
Details
This data provides from spdep package
Source
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
Examples
data(eire)
eirepolys Spatial polygonal contours of eire dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of eiredataset
Usage
data(eirepolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or rsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibility torepesent spatial polygonal contours as a backgroud map Thatrsquos why we create functions lsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of the polygons
Source
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
findneighbors 31
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
findneighbors Research of the m nearest neighbors for sites
Description
The function lsquofindneighborsrsquo gives for each site of coordinates (xc yc) the m nearest neighbors inthe set of sites
Usage
findneighbors(xc yc m)
Arguments
xc a numerical vector x of size n
yc a numerical vector y of size n
m number of nearest neighbors
Details
In case of ties the nearest neighbor is randomly chosen among the ties This function is called inmakeneighborswr
Value
A matrix of size ntimes n containing 1 on position (i j) if j is m-nearest neighbour to i
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakedistanceWmakeneighborsw
32 genpca
Examples
data(auckland)Wlt-findneighbors(auckland$Eastingauckland$Northing1)
genpca Generalized Principal Component Analysis (PCA)
Description
The function lsquogenpcarsquo computes a generalized Principal Component Analysis (PCA) It calculatesthe principal components the coordinates of the variables and in these principals components axesand the inertia of these principal components
Usage
genpca(data w=rep(1nrow(data)length=nrow(data)) m=diag(1ncol(data)ncol(data))center=TRUE reduc=TRUE)
Arguments
data matrix ntimes p
w vector of size n of weight (by default weight = t(1n 1n))
m matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centered PCA (by default center=TRUE)
reduc boolean if TRUE reduced PCA (by default reduce=TRUE)
Details
LetW = diag(w)
x = data = (xprime1 x
primen)prime
withxi = (x1
i xpi )
Let1n = (1 1)prime
with n rows and 1p = (1 1)prime
with p rows Normalization of weight
wi =wisumi wi
genpca 33
Vector of means x = (x1 xp)prime
withxj =
sumi
wixji
If center=Truexc = xminus 1nxprime
Standart deviation (σj)2 =
sumi
wi(xji )
2 minus (xj)2
Σ = diag((σ1)2 (σp)2)prime
If reduc=True xcr = xc times Σminus12
Variance-Covariance matrix
C = xprimecrWxcr
Cholesky decomposition M = LLprime where M=mLet
Cl = LCLprime
Let U and D as ClU = UD
with D = diag(λ1 λp)Let
V = LprimeU
Then Coordinates of individuals in the principals components basis
CC = xcrV
Coordinates of variables in principals components
V C = CV Dminus12
Inertia I = D1p
Value
Returns lsquoinertiarsquo vector of size p with percent of inertia of each component (corresponding to I)lsquocasecoordrsquo matrix ntimes p (corresponding to matrix CC) lsquovarcoordrsquo matrix ptimes p (corresponding tomatrix V C)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
34 gini
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermappcamap
gini Calculates a Gini Index
Description
The function lsquoginirsquo calculates the Gini Index associated to the variable lsquovarrsquo
Usage
gini(var)
Arguments
var a vector of numerical values of size n
Details
Let xk k = 1 K be the distinct values taken by V ar For each site Ginir returns two pairs offrequencies The pair (f g) where f represents
fk =1n
sumi
1(V ari = xk)
(n is the length of lsquovarrsquo) and g represents
gk =xk
xfk
The pair (FG) represents the corresponding cumulative frequenciesThe Gini Index is calculated as
IG =12x
Ksumi=1
Ksumj=1
|xi minus xj |
Value
(f F g G gini) where f F g and G are vectors of size K and gini a numeric value
Note
This function is used in ginimapR but it is not an interactive function
ginimap 35
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
ginimap
ginimap Lorentz curve and map
Description
The function lsquoginimaprsquo computes a Lorentz curve from rsquovarrsquo and calculates the Gini Index associ-ated to var
Usage
ginimap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
6 angleplotmap
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
axis a boolean with TRUE for drawing axes on the map
Details
For each couple of sites (si sj) the graphic represents on the y-axis the absolute difference betweenvari and varj
Dij = |vari minus varj |and on the x-axis the angle θij between the vector minusminusrarrsisj and the x-axis Possibility to represent asmoothing spline regression quantile gα For 0 lt α lt 1
Pr[Dij lt gα(θij)] = α
If that case only the pair of sites (si sj) verifying
Dij gt gmax(α)(θij)
are represented
Value
A matrix of boolean of size ntimes n TRUE if pair of sites was in the last selection
Author(s)
Thomas-Agnan Christine Aragon Yves Ruiz-Gazen Anne Laurent Thibault Robidou Laurianne
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
variocloudmapdriftmap
Examples
Data afcondata(afcon)obslt-angleplotmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon))symbol=1)
Data Meusedata(meuseall)data(meuseriv)obslt-angleplotmap(meuseall$xmeuseall$ymeuseall$copperlablong=Xlablat=Yquantiles=c(0105095)listvar=meusealllistnomvar=names(meuseall)labvar=Concentration en plomb (en ppm))points(meuseriv type = l asp = 1)
auckpolys 7
auckpolys Spatial polygonal contours of auckland dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of auckland dataset
Usage
data(auckpolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonDataFramersquo or rsquoMaprsquo object because a site can only berepresented by a pair of coordinates and not by a polygonnal contour However users have the pos-sibility to repesent spatial polygonal contours as a backgroud map Thatrsquos why we created functionslsquospdf2listrsquo lsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of thepolygons
Source
Marshall R M (1991) Mapping disease and mortality rates using Empirical Bayes Estimators Ap-plied Statistics 40 283-294
Bailey T Gatrell A (1995) Interactive Spatial Data Analysis Harlow Longman - INFOMAP dataset used with permission
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)
8 auckland
auckland Marshallrsquos infant mortality in Auckland dataset
Description
The Auckland data frame has 167 rows (census area units - CAU) and 4 columns
Usage
data(auckland)
Format
A data frame with 167 observations on the following 4 variables
Easting a numeric vector of x coordinates in an unknown spatial reference system
Northing a numeric vector of y coordinates in an unknown spatial reference system
Deaths197785 a numeric vector of counts of infant (under 5 years of age) deaths in Auckland1977-1985
Under51981 a numeric vector of population under 5 years of age at the 1981 Census
Details
This data provides from spdep package
Source
Bailey T Gatrell A (1995) Interactive Spatial Data Analysis Harlow Longman - INFOMAP dataset used with permission
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Marshall R M (1991) Mapping disease and mortality rates using Empirical Bayes Estimators Ap-plied Statistics 40 283-294
Examples
data(auckland)
baltimore 9
baltimore House sales prices Baltimore MD 1978
Description
House sales price and characteristics for a spatial hedonic regression Baltimore MD 1978
Usage
data(baltimore)
Format
A data frame with 211 observations on the following 17 variables
STATION StationPRICE PriceNROOM Number of roomsDWELL Presence of well (0 or 1)NBATH Number of bathsPATIO Presence of patio (0 or 1)FIREPL Presence of fire stationAC ACBMENT BMENTNSTOR NSTORGAR Number of garagesAGE AgeCITCOU CITCOULOTSZ LOTSZSQFT SQFTX a vector x of size n
Y a vector y of size n
Details
This data provides from spdep package
Source
Prepared by Luc Anselin Original data made available by Rodin Dubin Weatherhead School ofManagement Case Western Research University Cleveland OH
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Dubin Robin A (1992) Spatial autocorrelation and neighbourhood quality Regional Scienceand Urban Economics 22(3) 433-452
10 barmap
Examples
data(baltimore)
barmap Interactive Bar plot and map
Description
The function lsquobarmaprsquo draws a bar plot (vertical bar) of the given factor variable var and a mapwith sites of coordinates (long lat)
Usage
barmap(long lat var listvar = NULL listnomvar = NULLcriteria = NULL carte = NULL label = color = 1symbol = 0 labvar = labmod = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of factor of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with name of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
barmap 11
labvar name of variable var
labmod names of factors of var
axis 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 selection of a bar on the bar plot results in the corresponding sites coloured on the map with thecorresponding colour observed on the bar Reversely the selection of sites on the map by lsquopointsrsquoor lsquopolygonrsquo results in the drawing of the sub-barplot in red
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
Examples
data oldcoldata(oldcol)data(oldcolpolys)oldcolcontourslt-polylist2list(oldcolpolys)barmap(oldcol$X oldcol$Y oldcol$NSA listvar=oldcolcarte=oldcolcontourslistnomvar=names(oldcol)criteria=(oldcol$CP==1)axis=TRUElablong=Xlablat=Y)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)barmap(eire$V1eire$V2eire$palecarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
12 boston
boston Corrected Boston Housing Data
Description
The boston data frame has 506 rows and 20 columns It contains the Harrison and Rubinfeld(1978) data corrected for a few minor errors and augmented with the latitude and longitude of theobservations Gilley and Pace also point out that MEDEV is censored in that median values at orover USD 50000 are set to USD 50000
Usage
data(boston)
Format
A data frame with 506 observations on the following 22 variables
x a vector x of size n
y a vector y of size n
TOWN a factor with levels given by town names
TOWNNO a numeric vector corresponding to town
TRACT a numeric vector of tract ID numbers
LON a numeric vector of tract point longitudes in decimal degrees
LAT a numeric vector of tract point latitudes in decimal degrees
MEDV a numeric vector of median values of owner-occupied housing in USD 1000
CMEDV a numeric vector corrected median values of owner-occupied housing in USD 1000
CRIM a numeric vector of per capita crime
ZN a numeric vector of proportions of residential land zoned for lots over 25000 sq ft per town(constant for all Boston tracts)
INDUS a numeric vector of proportions of non-retail business acres per town (constant for allBoston tracts)
CHAS a factor with levels 1 if tract borders Charles River 0 otherwise
NOX a numeric vector of nitric oxides concentration (parts per 10 million) per town
RM a numeric vector of average numbers of rooms per dwelling
AGE a numeric vector of proportions of owner-occupied units built prior to 1940
DIS a numeric vector of weighted distances to five Boston employment centres
RAD a numeric vector of an index of accessibility to radial highways per town (constant for allBoston tracts)
TAX a numeric vector full-value proprty-tax rate per USD 10000 per town (constant for all Bostontracts)
PTRATIO a numeric vector of pupil-teacher ratios per town (constant for all Boston tracts)
B a numeric vector of 1000 lowast (Bk minus 063)2 where Bk is the proportion of blacks
LSTAT a numeric vector of percentage values of lower status population
boxplotmap 13
Details
This data provides from spdep package
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Harrison David and Daniel L Rubinfeld ldquoHedonic Housing Prices and the Demand for CleanAirrdquo Journal of Environmental Economics and Management Volume 5 (1978) 81-102 Originaldata
Gilley OW and R Kelley Pace ldquoOn the Harrison and Rubinfeld Datardquo Journal of EnvironmentalEconomics and Management 31 (1996) 403-405 Provided corrections and examined censoring
Pace R Kelley and OW Gilley ldquoUsing the Spatial Configuration of the Data to Improve Estima-tionrdquo Journal of the Real Estate Finance and Economics 14 (1997) 333-340
Examples
data(boston)
boxplotmap Interactive boxplot and map
Description
The function lsquoboxplotmaprsquo draws a boxplot of the given variable var and a map with site of coor-dinates (long lat)
Usage
boxplotmap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
14 boxplotmap
listnomvar list of character of size p with names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar name of variable var
axis 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
There is an interactivity only in one direction the sites selected by interquartile on the boxplot arerepresented on the map in red
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
carte 15
Examples
donnees oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)boxplotmap(oldcol$X oldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CP==1)axis=TRUElablong=Xlablat=Y)
donnees bostondata(boston)boxplotmap(boston$xboston$yboston$CRIMlistvar=bostonlistnomvar=names(boston)criteria=(boston$CHAS==1))
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)boxplotmap(eire$V1eire$V2eire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Taux deacutevolution de la population de 1921 agrave1962)
carte Drawing a map
Description
The function lsquocartersquo draws a map with sites of coordinates (long lat) and represents sites whichhave been selected (obs) in red if symbol=0 or with star if symbol=1 This function is called bymost of the functions of GeoXp (this is not an interactive function)
Usage
carte(long lat obscriteria=NULLbuble=FALSEcbuble=NULLnointer=FALSE carte=NULLnocart=FALSE label=symbol=0col=0 lablong= lablat= method= W=NULL couleurs=classe obsqlegmap=NULLlegends=list(FALSEFALSE)labmod=axis=FALSE)
Arguments
long a vector x of size n
lat a vector y of size n
obs a boolean vector of size n with TRUE on selected sites
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
16 carte
buble a boolean with TRUE for drawing bubbles FALSE otherwise
cbuble vector of size n with size of each site depending on variable with which bubblesare constructed
nointer a boolean with TRUE for drawing sites selected by criteria FALSE otherwise
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
nocart a boolean with TRUE for drawing spatial contours FALSE otherwise
label vector of character of size n with name of each site
col 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points are inred if 1 selected points are stars
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
method Specification for some graphics such as lsquoNeighbourplot1rsquo lsquoNeighbourplot2rsquolsquoClusterrsquo lsquoAngleplotrsquo lsquoVariocloudrsquo
W neighbourhood matrix of size ntimes n necessary when method=lsquoNeighbourplotrsquo
couleurs Possibility to change colors (only for admin)
classe vector of n whith class necessary when method=lsquoClusterrsquo
obsq vector of size n with number of quadrant to which the site belongs necessarywhen method=lsquoQuadrantrsquo
legmap a list of (numericnumericnumericnumericnumericnumericcharacter) with thesizes and the corresponding values of the 3 bubbles represented in the legend andthe variable name of variable choosed
clustermap 17
legends a list of c(booleanbooleanc(numericnumeric)c(numericnumeric)) with TRUEfor drawing legends of bubbles (1st argument) or factors (2nd argument) and thecoordinates of the location of the upper left corner of the legend box
labmod Name of factors
axis a boolean with True for drawing axes on the map
Details
For factors possibility to represent sites with different colors for each level Others options permitto represent with a croice some sites with special lsquocriteriarsquo with lsquobubblersquo according to a variablegiven a spatial contours with lsquocartersquo names of sites with lsquolabelrsquo or a representation in flowerPossibility to draw a legend giving the sizes of bubbles and colors of levels
Value
No values only drawing of a map
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
clustermap Classification of dataset using kmeansr or hclustr and representationof clusters on a map
Description
The function lsquoclustermaprsquo performs a classification of the sites from the variables included indataset and computes a bar plot of the clusters calculated Classification methods comes fromhclustR (hierarchical cluster analysis) and kmeansR (k-means clustering) and number of class ischosen with clustnum
Usage
clustermap(longlatdatasetclustnummethod=kmeanstype=NULLcenters=NULLscale=FALSElistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabvar=Clusterlabel=symbol=0color=1labmod=axis=FALSElablong= lablat=)
18 clustermap
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix of variables of numeric values
clustnum Number of clusters
method two methos lsquokmeansrsquo by default or lsquohclustrsquo
type If method=lsquohclustrdquo type=ldquocompleterdquo by default (the possibilities are given inhelp(hclust) as lsquowardrsquo lsquosinglersquo etc) If method=lsquokmeansrsquo type=Hartigan-Wong by default (the possibilities are given in help(kmeans) as lsquoForgyrsquo etc)
centers If method=rsquokmeansrsquo user can give a matrix with initial cluster centers
scale If scale=TRUE the dataset is reducted
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
labvar name of variable var
label vector of size n with names of each site
color 0 or 1 (by default) choice of representation of selected points If 0 sites arerepresented in blue if 1 sites are represented with different colors for eachcluster
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labmod names of Clusters
clustermap 19
axis 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 two windows are interactive the sites selected by a bar chosen on the bar plot are representedon the map in red and the values of sites selected on the map by lsquopointsrsquo or lsquopolygonrsquo are representedin red on the bar plot The dendogram is also drawn for rsquohclustrsquo method In option possibility tochoose the classification method
Value
A vector of boolean of size n (TRUE if the site was in the last selection) and a vector of size nwhith the number of cluster for each site
Note
To use the functions hclustr and kmeansr we take many arguments by default If the user wouldlike to modify these arguments he should call these functions first and then use the functionbarmapr to visualize the calculated clusters
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Murtagh F (1985) ldquoMultidimensional Clustering Algorithmsrdquo
Hartigan J A and Wong M A (1979) A K-means clustering algorithm Applied Statistics 28100-108
See Also
barmap pcamap
Examples
donneacutees oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)obslt-clustermap(oldcol$X oldcol$Yoldcol[712]3listvar=oldcollistnomvar=names(oldcol)carte=contoursOLDcriteria=(oldcol$CP==1))
20 dbledensitymap
data avifaunelibrary(ade4)data(mafragh)dlt-distchi2(mafragh$flo)
obslt-clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4method=hclusttype=wardlistvar=mafragh$partitionlistnomvar=class)
claslt-obs$vectclasselt-by(dclasmean)glt-rbind(e[1]$1e[2]$2e[3]$3e[4]$4)
clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4centers=glistvar=mafragh$partitionlistnomvar=class)
dbledensitymap Double Kernel density estimates and map
Description
The function lsquodbledensitymaprsquo plots two kernel density estimates from var1 and var2 computedwith lsquobkdeRrsquo and a map with sites of coordinates (long lat) Each site is associated to a value ofvar1 and var2 and the two windows are interactive
Usage
dbledensitymap(long lat var1 var2kernel=triweight listvar = NULLlistnomvar = NULL carte = NULL criteria = NULL label = symbol = 0 color = 1 labvar = c(var1 var2) axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
dbledensitymap 21
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar list of character with names of variables var1 and var2
axis 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 user can choose an interval on the density curve by mouse clicking on the lower and upperboundaries of the interval or by giving directly these values The selected sites are then representedon the map in red A selection by lsquopointsrsquo or lsquopolygonrsquo on the map results in the drawing of thedensity of the corresponding sub-distribution on the density plot Finally the user can modify thebandwith parameter with a cursor in the tcltk window (parameter α) α is the smoothing parameterfor the kernel smooth it represents the mean percentage of sample points involved in the localaveraging (example α = 20 means that on average ntimes 02 points are in any interval of length 2hwhere h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
22 dblehistomap
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dbledensitymap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785))) listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-dbledensitymap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)dbledensitymap(eire$V1eire$V2eire$Aeire$townslabvar=c(Taux dindividus au groupe sanguin ASurface urbaine)carte=eirecontourskernel=normallistvar=eirelistnomvar=names(eire))
dblehistomap Double Interactive Histogram and map
Description
The function lsquodblehistomaprsquo draws two histograms of the given variables var1 and var2 and a mapwith sites of coordinates (long lat) Each site is associated to a value of var1 and var2 and thereis interactivity between the two windows created
dblehistomap 23
Usage
dblehistomap(long lat var1 var2 listvar = NULL listnomvar = NULLnbcol1 = 10 nbcol2 = 10 carte = NULL criteria = NULLsymbol = 0 color = 1 labvar = c( ) label = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
nbcol1 number of cells for histogram 1 (10 by default)
nbcol2 number of cells for histogram 2 (10 by default)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
24 densitymap
Details
The selection of sites by lsquopointsrsquo or lsquopolygonsrsquo on the map results in the drawing of the red his-tograms of the subdistributions corresponding to this subset of sites
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dblehistomap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785)))listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadblehistomap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
densitymap Kernel density estimates and map
Description
The function lsquodensitymaprsquo draws kernel density estimates of the variable var with rsquobkdeRrsquo anda map with sites of coordinate (long lat) Each site is associated to a value of var and there isinteractivity between the two windows
densitymap 25
Usage
densitymap(long lat varkernel=triweightlistvar=NULLlistnomvar=NULLcarte=NULL criteria=NULLlabel=symbol=0color=1 labvar=axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
labvar name of variable var
axis 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
26 densitymap
Details
The user can choose an interval on the density curve by mouse clicking on the graph on the extremi-ties of interval or by specifying directly values The sites selected by an interval are then representedon the map in red The selection of sites on the map by lsquopointsrsquo or lsquopolygonrsquo results in the draw-ing of the kernel densities of the subdistributions corresponding to this subset of sites Finally theuser can modify the bandwith parameter with a cursor in the tcltk window (parameter α) α is thesmoothing parameter for the kernel smooth it represents the mean percentage of sample pointsinvolved in the local averaging (example α = 20 means that on average ntimes 02 points are in anyinterval of length 2h where h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
library tcltk and KernSmooth data olcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)densitymap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadensitymap(colombuscontours$Xcolombuscontours$Ycolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)
distchi2 27
data(eirepolys)eirecontourslt-polylist2list(eirepolys)densitymap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
distchi2 It gives an euclidian distance matrix for factors using metric of χ2
Description
The function lsquodistchi2rsquo calculates an euclidian distance matrix for factors using metric of χ2
Usage
distchi2(mat)
Arguments
mat A matrix of factors given as numeric values
Details
The euclidian distance between two individuals i and k using the metric of χ2 is given by
d2χ2 =
n
p
sumj
p
mjsuml
δjlik
1nj
l
with n number of individuals p number of variables mj is the number of possibilities for variableY j nj
l is the number of individuals where l has been observed for Y j and δjlik = 1 if there is a
discordance between i and k for l and 0 otherwise It is not an interactive function
Value
It returns a dist object (see help(dist))
Author(s)
Laurent Thibault
References
Besse Philippe ldquoData mining 2 Modeacutelisation statistique et apprentissagerdquo Publication du LSPhttpwwwlspups-tlsefrBesse
See Also
clustermap
28 driftmap
driftmap Detection of an eventual trend
Description
The function lsquodriftmaprsquo creates a grid on the map and calculates the mean and median for each cellThe right plot (resp left plot) represents means and medians calculated by row (resp column)
Usage
driftmap(long lat var interpol = 1nuage = 0 carte = NULLlablong = lablat = labvar = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
interpol if 1 the mean and median calculated are linearly interpoled
nuage if 1 the individuals are also represented on the graphics
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
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
labvar name of variable lsquovarrsquo
Details
Possibility to change the number of cells in the grid with the tcltk window to interpolate the meansand medians calculated (by default) to work on a rotated map Notice that this is not an interactivefunction
Value
No values returned only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
eire 29
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmaprotation
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)driftmap(auckland$Eastingauckland$Northingauckland$Deaths197785interpol=0nuage=1lablong=Xlablat=Ylabvar=Deaths197785)
data afcondata(afcon)driftmap(afcon$xafcon$yafcon$totconinterpol=0nuage=1lablong=Xlablat=Ylabvar=Number of conflicts)
data meusedata(meuseall)data(meuseriv)driftmap(meuseall$xmeuseall$ymeuseall$coppernuage=1lablong=Xlablat=Ylabvar=Concentration de cuivre (en ppm))
eire Eire data sets
Description
The lsquoeirersquo data frame has 26 rows and 11 columns
Usage
data(eire)
Format
A data frame with 26 observations on the following 11 variables
V1 a vector x of size n
V2 a vector y of size n
A Percentage of sample with blood group A
towns Townsunit area
pale Beyond the Pale 0 within the Pale 1
size number of blood type samples
ROADACC arterial road network accessibility in 1961
30 eirepolys
OWNCONS percentage in value terms of gross agricultural output of each county consumed by itself
POPCHG 1961 population as percentage of 1926
RETSALE value of retail sales c000
INCOME total personal income c000
Details
This data provides from spdep package
Source
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
Examples
data(eire)
eirepolys Spatial polygonal contours of eire dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of eiredataset
Usage
data(eirepolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or rsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibility torepesent spatial polygonal contours as a backgroud map Thatrsquos why we create functions lsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of the polygons
Source
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
findneighbors 31
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
findneighbors Research of the m nearest neighbors for sites
Description
The function lsquofindneighborsrsquo gives for each site of coordinates (xc yc) the m nearest neighbors inthe set of sites
Usage
findneighbors(xc yc m)
Arguments
xc a numerical vector x of size n
yc a numerical vector y of size n
m number of nearest neighbors
Details
In case of ties the nearest neighbor is randomly chosen among the ties This function is called inmakeneighborswr
Value
A matrix of size ntimes n containing 1 on position (i j) if j is m-nearest neighbour to i
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakedistanceWmakeneighborsw
32 genpca
Examples
data(auckland)Wlt-findneighbors(auckland$Eastingauckland$Northing1)
genpca Generalized Principal Component Analysis (PCA)
Description
The function lsquogenpcarsquo computes a generalized Principal Component Analysis (PCA) It calculatesthe principal components the coordinates of the variables and in these principals components axesand the inertia of these principal components
Usage
genpca(data w=rep(1nrow(data)length=nrow(data)) m=diag(1ncol(data)ncol(data))center=TRUE reduc=TRUE)
Arguments
data matrix ntimes p
w vector of size n of weight (by default weight = t(1n 1n))
m matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centered PCA (by default center=TRUE)
reduc boolean if TRUE reduced PCA (by default reduce=TRUE)
Details
LetW = diag(w)
x = data = (xprime1 x
primen)prime
withxi = (x1
i xpi )
Let1n = (1 1)prime
with n rows and 1p = (1 1)prime
with p rows Normalization of weight
wi =wisumi wi
genpca 33
Vector of means x = (x1 xp)prime
withxj =
sumi
wixji
If center=Truexc = xminus 1nxprime
Standart deviation (σj)2 =
sumi
wi(xji )
2 minus (xj)2
Σ = diag((σ1)2 (σp)2)prime
If reduc=True xcr = xc times Σminus12
Variance-Covariance matrix
C = xprimecrWxcr
Cholesky decomposition M = LLprime where M=mLet
Cl = LCLprime
Let U and D as ClU = UD
with D = diag(λ1 λp)Let
V = LprimeU
Then Coordinates of individuals in the principals components basis
CC = xcrV
Coordinates of variables in principals components
V C = CV Dminus12
Inertia I = D1p
Value
Returns lsquoinertiarsquo vector of size p with percent of inertia of each component (corresponding to I)lsquocasecoordrsquo matrix ntimes p (corresponding to matrix CC) lsquovarcoordrsquo matrix ptimes p (corresponding tomatrix V C)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
34 gini
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermappcamap
gini Calculates a Gini Index
Description
The function lsquoginirsquo calculates the Gini Index associated to the variable lsquovarrsquo
Usage
gini(var)
Arguments
var a vector of numerical values of size n
Details
Let xk k = 1 K be the distinct values taken by V ar For each site Ginir returns two pairs offrequencies The pair (f g) where f represents
fk =1n
sumi
1(V ari = xk)
(n is the length of lsquovarrsquo) and g represents
gk =xk
xfk
The pair (FG) represents the corresponding cumulative frequenciesThe Gini Index is calculated as
IG =12x
Ksumi=1
Ksumj=1
|xi minus xj |
Value
(f F g G gini) where f F g and G are vectors of size K and gini a numeric value
Note
This function is used in ginimapR but it is not an interactive function
ginimap 35
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
ginimap
ginimap Lorentz curve and map
Description
The function lsquoginimaprsquo computes a Lorentz curve from rsquovarrsquo and calculates the Gini Index associ-ated to var
Usage
ginimap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
auckpolys 7
auckpolys Spatial polygonal contours of auckland dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of auckland dataset
Usage
data(auckpolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonDataFramersquo or rsquoMaprsquo object because a site can only berepresented by a pair of coordinates and not by a polygonnal contour However users have the pos-sibility to repesent spatial polygonal contours as a backgroud map Thatrsquos why we created functionslsquospdf2listrsquo lsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of thepolygons
Source
Marshall R M (1991) Mapping disease and mortality rates using Empirical Bayes Estimators Ap-plied Statistics 40 283-294
Bailey T Gatrell A (1995) Interactive Spatial Data Analysis Harlow Longman - INFOMAP dataset used with permission
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)
8 auckland
auckland Marshallrsquos infant mortality in Auckland dataset
Description
The Auckland data frame has 167 rows (census area units - CAU) and 4 columns
Usage
data(auckland)
Format
A data frame with 167 observations on the following 4 variables
Easting a numeric vector of x coordinates in an unknown spatial reference system
Northing a numeric vector of y coordinates in an unknown spatial reference system
Deaths197785 a numeric vector of counts of infant (under 5 years of age) deaths in Auckland1977-1985
Under51981 a numeric vector of population under 5 years of age at the 1981 Census
Details
This data provides from spdep package
Source
Bailey T Gatrell A (1995) Interactive Spatial Data Analysis Harlow Longman - INFOMAP dataset used with permission
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Marshall R M (1991) Mapping disease and mortality rates using Empirical Bayes Estimators Ap-plied Statistics 40 283-294
Examples
data(auckland)
baltimore 9
baltimore House sales prices Baltimore MD 1978
Description
House sales price and characteristics for a spatial hedonic regression Baltimore MD 1978
Usage
data(baltimore)
Format
A data frame with 211 observations on the following 17 variables
STATION StationPRICE PriceNROOM Number of roomsDWELL Presence of well (0 or 1)NBATH Number of bathsPATIO Presence of patio (0 or 1)FIREPL Presence of fire stationAC ACBMENT BMENTNSTOR NSTORGAR Number of garagesAGE AgeCITCOU CITCOULOTSZ LOTSZSQFT SQFTX a vector x of size n
Y a vector y of size n
Details
This data provides from spdep package
Source
Prepared by Luc Anselin Original data made available by Rodin Dubin Weatherhead School ofManagement Case Western Research University Cleveland OH
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Dubin Robin A (1992) Spatial autocorrelation and neighbourhood quality Regional Scienceand Urban Economics 22(3) 433-452
10 barmap
Examples
data(baltimore)
barmap Interactive Bar plot and map
Description
The function lsquobarmaprsquo draws a bar plot (vertical bar) of the given factor variable var and a mapwith sites of coordinates (long lat)
Usage
barmap(long lat var listvar = NULL listnomvar = NULLcriteria = NULL carte = NULL label = color = 1symbol = 0 labvar = labmod = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of factor of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with name of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
barmap 11
labvar name of variable var
labmod names of factors of var
axis 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 selection of a bar on the bar plot results in the corresponding sites coloured on the map with thecorresponding colour observed on the bar Reversely the selection of sites on the map by lsquopointsrsquoor lsquopolygonrsquo results in the drawing of the sub-barplot in red
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
Examples
data oldcoldata(oldcol)data(oldcolpolys)oldcolcontourslt-polylist2list(oldcolpolys)barmap(oldcol$X oldcol$Y oldcol$NSA listvar=oldcolcarte=oldcolcontourslistnomvar=names(oldcol)criteria=(oldcol$CP==1)axis=TRUElablong=Xlablat=Y)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)barmap(eire$V1eire$V2eire$palecarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
12 boston
boston Corrected Boston Housing Data
Description
The boston data frame has 506 rows and 20 columns It contains the Harrison and Rubinfeld(1978) data corrected for a few minor errors and augmented with the latitude and longitude of theobservations Gilley and Pace also point out that MEDEV is censored in that median values at orover USD 50000 are set to USD 50000
Usage
data(boston)
Format
A data frame with 506 observations on the following 22 variables
x a vector x of size n
y a vector y of size n
TOWN a factor with levels given by town names
TOWNNO a numeric vector corresponding to town
TRACT a numeric vector of tract ID numbers
LON a numeric vector of tract point longitudes in decimal degrees
LAT a numeric vector of tract point latitudes in decimal degrees
MEDV a numeric vector of median values of owner-occupied housing in USD 1000
CMEDV a numeric vector corrected median values of owner-occupied housing in USD 1000
CRIM a numeric vector of per capita crime
ZN a numeric vector of proportions of residential land zoned for lots over 25000 sq ft per town(constant for all Boston tracts)
INDUS a numeric vector of proportions of non-retail business acres per town (constant for allBoston tracts)
CHAS a factor with levels 1 if tract borders Charles River 0 otherwise
NOX a numeric vector of nitric oxides concentration (parts per 10 million) per town
RM a numeric vector of average numbers of rooms per dwelling
AGE a numeric vector of proportions of owner-occupied units built prior to 1940
DIS a numeric vector of weighted distances to five Boston employment centres
RAD a numeric vector of an index of accessibility to radial highways per town (constant for allBoston tracts)
TAX a numeric vector full-value proprty-tax rate per USD 10000 per town (constant for all Bostontracts)
PTRATIO a numeric vector of pupil-teacher ratios per town (constant for all Boston tracts)
B a numeric vector of 1000 lowast (Bk minus 063)2 where Bk is the proportion of blacks
LSTAT a numeric vector of percentage values of lower status population
boxplotmap 13
Details
This data provides from spdep package
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Harrison David and Daniel L Rubinfeld ldquoHedonic Housing Prices and the Demand for CleanAirrdquo Journal of Environmental Economics and Management Volume 5 (1978) 81-102 Originaldata
Gilley OW and R Kelley Pace ldquoOn the Harrison and Rubinfeld Datardquo Journal of EnvironmentalEconomics and Management 31 (1996) 403-405 Provided corrections and examined censoring
Pace R Kelley and OW Gilley ldquoUsing the Spatial Configuration of the Data to Improve Estima-tionrdquo Journal of the Real Estate Finance and Economics 14 (1997) 333-340
Examples
data(boston)
boxplotmap Interactive boxplot and map
Description
The function lsquoboxplotmaprsquo draws a boxplot of the given variable var and a map with site of coor-dinates (long lat)
Usage
boxplotmap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
14 boxplotmap
listnomvar list of character of size p with names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar name of variable var
axis 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
There is an interactivity only in one direction the sites selected by interquartile on the boxplot arerepresented on the map in red
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
carte 15
Examples
donnees oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)boxplotmap(oldcol$X oldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CP==1)axis=TRUElablong=Xlablat=Y)
donnees bostondata(boston)boxplotmap(boston$xboston$yboston$CRIMlistvar=bostonlistnomvar=names(boston)criteria=(boston$CHAS==1))
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)boxplotmap(eire$V1eire$V2eire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Taux deacutevolution de la population de 1921 agrave1962)
carte Drawing a map
Description
The function lsquocartersquo draws a map with sites of coordinates (long lat) and represents sites whichhave been selected (obs) in red if symbol=0 or with star if symbol=1 This function is called bymost of the functions of GeoXp (this is not an interactive function)
Usage
carte(long lat obscriteria=NULLbuble=FALSEcbuble=NULLnointer=FALSE carte=NULLnocart=FALSE label=symbol=0col=0 lablong= lablat= method= W=NULL couleurs=classe obsqlegmap=NULLlegends=list(FALSEFALSE)labmod=axis=FALSE)
Arguments
long a vector x of size n
lat a vector y of size n
obs a boolean vector of size n with TRUE on selected sites
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
16 carte
buble a boolean with TRUE for drawing bubbles FALSE otherwise
cbuble vector of size n with size of each site depending on variable with which bubblesare constructed
nointer a boolean with TRUE for drawing sites selected by criteria FALSE otherwise
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
nocart a boolean with TRUE for drawing spatial contours FALSE otherwise
label vector of character of size n with name of each site
col 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points are inred if 1 selected points are stars
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
method Specification for some graphics such as lsquoNeighbourplot1rsquo lsquoNeighbourplot2rsquolsquoClusterrsquo lsquoAngleplotrsquo lsquoVariocloudrsquo
W neighbourhood matrix of size ntimes n necessary when method=lsquoNeighbourplotrsquo
couleurs Possibility to change colors (only for admin)
classe vector of n whith class necessary when method=lsquoClusterrsquo
obsq vector of size n with number of quadrant to which the site belongs necessarywhen method=lsquoQuadrantrsquo
legmap a list of (numericnumericnumericnumericnumericnumericcharacter) with thesizes and the corresponding values of the 3 bubbles represented in the legend andthe variable name of variable choosed
clustermap 17
legends a list of c(booleanbooleanc(numericnumeric)c(numericnumeric)) with TRUEfor drawing legends of bubbles (1st argument) or factors (2nd argument) and thecoordinates of the location of the upper left corner of the legend box
labmod Name of factors
axis a boolean with True for drawing axes on the map
Details
For factors possibility to represent sites with different colors for each level Others options permitto represent with a croice some sites with special lsquocriteriarsquo with lsquobubblersquo according to a variablegiven a spatial contours with lsquocartersquo names of sites with lsquolabelrsquo or a representation in flowerPossibility to draw a legend giving the sizes of bubbles and colors of levels
Value
No values only drawing of a map
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
clustermap Classification of dataset using kmeansr or hclustr and representationof clusters on a map
Description
The function lsquoclustermaprsquo performs a classification of the sites from the variables included indataset and computes a bar plot of the clusters calculated Classification methods comes fromhclustR (hierarchical cluster analysis) and kmeansR (k-means clustering) and number of class ischosen with clustnum
Usage
clustermap(longlatdatasetclustnummethod=kmeanstype=NULLcenters=NULLscale=FALSElistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabvar=Clusterlabel=symbol=0color=1labmod=axis=FALSElablong= lablat=)
18 clustermap
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix of variables of numeric values
clustnum Number of clusters
method two methos lsquokmeansrsquo by default or lsquohclustrsquo
type If method=lsquohclustrdquo type=ldquocompleterdquo by default (the possibilities are given inhelp(hclust) as lsquowardrsquo lsquosinglersquo etc) If method=lsquokmeansrsquo type=Hartigan-Wong by default (the possibilities are given in help(kmeans) as lsquoForgyrsquo etc)
centers If method=rsquokmeansrsquo user can give a matrix with initial cluster centers
scale If scale=TRUE the dataset is reducted
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
labvar name of variable var
label vector of size n with names of each site
color 0 or 1 (by default) choice of representation of selected points If 0 sites arerepresented in blue if 1 sites are represented with different colors for eachcluster
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labmod names of Clusters
clustermap 19
axis 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 two windows are interactive the sites selected by a bar chosen on the bar plot are representedon the map in red and the values of sites selected on the map by lsquopointsrsquo or lsquopolygonrsquo are representedin red on the bar plot The dendogram is also drawn for rsquohclustrsquo method In option possibility tochoose the classification method
Value
A vector of boolean of size n (TRUE if the site was in the last selection) and a vector of size nwhith the number of cluster for each site
Note
To use the functions hclustr and kmeansr we take many arguments by default If the user wouldlike to modify these arguments he should call these functions first and then use the functionbarmapr to visualize the calculated clusters
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Murtagh F (1985) ldquoMultidimensional Clustering Algorithmsrdquo
Hartigan J A and Wong M A (1979) A K-means clustering algorithm Applied Statistics 28100-108
See Also
barmap pcamap
Examples
donneacutees oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)obslt-clustermap(oldcol$X oldcol$Yoldcol[712]3listvar=oldcollistnomvar=names(oldcol)carte=contoursOLDcriteria=(oldcol$CP==1))
20 dbledensitymap
data avifaunelibrary(ade4)data(mafragh)dlt-distchi2(mafragh$flo)
obslt-clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4method=hclusttype=wardlistvar=mafragh$partitionlistnomvar=class)
claslt-obs$vectclasselt-by(dclasmean)glt-rbind(e[1]$1e[2]$2e[3]$3e[4]$4)
clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4centers=glistvar=mafragh$partitionlistnomvar=class)
dbledensitymap Double Kernel density estimates and map
Description
The function lsquodbledensitymaprsquo plots two kernel density estimates from var1 and var2 computedwith lsquobkdeRrsquo and a map with sites of coordinates (long lat) Each site is associated to a value ofvar1 and var2 and the two windows are interactive
Usage
dbledensitymap(long lat var1 var2kernel=triweight listvar = NULLlistnomvar = NULL carte = NULL criteria = NULL label = symbol = 0 color = 1 labvar = c(var1 var2) axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
dbledensitymap 21
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar list of character with names of variables var1 and var2
axis 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 user can choose an interval on the density curve by mouse clicking on the lower and upperboundaries of the interval or by giving directly these values The selected sites are then representedon the map in red A selection by lsquopointsrsquo or lsquopolygonrsquo on the map results in the drawing of thedensity of the corresponding sub-distribution on the density plot Finally the user can modify thebandwith parameter with a cursor in the tcltk window (parameter α) α is the smoothing parameterfor the kernel smooth it represents the mean percentage of sample points involved in the localaveraging (example α = 20 means that on average ntimes 02 points are in any interval of length 2hwhere h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
22 dblehistomap
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dbledensitymap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785))) listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-dbledensitymap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)dbledensitymap(eire$V1eire$V2eire$Aeire$townslabvar=c(Taux dindividus au groupe sanguin ASurface urbaine)carte=eirecontourskernel=normallistvar=eirelistnomvar=names(eire))
dblehistomap Double Interactive Histogram and map
Description
The function lsquodblehistomaprsquo draws two histograms of the given variables var1 and var2 and a mapwith sites of coordinates (long lat) Each site is associated to a value of var1 and var2 and thereis interactivity between the two windows created
dblehistomap 23
Usage
dblehistomap(long lat var1 var2 listvar = NULL listnomvar = NULLnbcol1 = 10 nbcol2 = 10 carte = NULL criteria = NULLsymbol = 0 color = 1 labvar = c( ) label = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
nbcol1 number of cells for histogram 1 (10 by default)
nbcol2 number of cells for histogram 2 (10 by default)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
24 densitymap
Details
The selection of sites by lsquopointsrsquo or lsquopolygonsrsquo on the map results in the drawing of the red his-tograms of the subdistributions corresponding to this subset of sites
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dblehistomap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785)))listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadblehistomap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
densitymap Kernel density estimates and map
Description
The function lsquodensitymaprsquo draws kernel density estimates of the variable var with rsquobkdeRrsquo anda map with sites of coordinate (long lat) Each site is associated to a value of var and there isinteractivity between the two windows
densitymap 25
Usage
densitymap(long lat varkernel=triweightlistvar=NULLlistnomvar=NULLcarte=NULL criteria=NULLlabel=symbol=0color=1 labvar=axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
labvar name of variable var
axis 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
26 densitymap
Details
The user can choose an interval on the density curve by mouse clicking on the graph on the extremi-ties of interval or by specifying directly values The sites selected by an interval are then representedon the map in red The selection of sites on the map by lsquopointsrsquo or lsquopolygonrsquo results in the draw-ing of the kernel densities of the subdistributions corresponding to this subset of sites Finally theuser can modify the bandwith parameter with a cursor in the tcltk window (parameter α) α is thesmoothing parameter for the kernel smooth it represents the mean percentage of sample pointsinvolved in the local averaging (example α = 20 means that on average ntimes 02 points are in anyinterval of length 2h where h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
library tcltk and KernSmooth data olcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)densitymap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadensitymap(colombuscontours$Xcolombuscontours$Ycolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)
distchi2 27
data(eirepolys)eirecontourslt-polylist2list(eirepolys)densitymap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
distchi2 It gives an euclidian distance matrix for factors using metric of χ2
Description
The function lsquodistchi2rsquo calculates an euclidian distance matrix for factors using metric of χ2
Usage
distchi2(mat)
Arguments
mat A matrix of factors given as numeric values
Details
The euclidian distance between two individuals i and k using the metric of χ2 is given by
d2χ2 =
n
p
sumj
p
mjsuml
δjlik
1nj
l
with n number of individuals p number of variables mj is the number of possibilities for variableY j nj
l is the number of individuals where l has been observed for Y j and δjlik = 1 if there is a
discordance between i and k for l and 0 otherwise It is not an interactive function
Value
It returns a dist object (see help(dist))
Author(s)
Laurent Thibault
References
Besse Philippe ldquoData mining 2 Modeacutelisation statistique et apprentissagerdquo Publication du LSPhttpwwwlspups-tlsefrBesse
See Also
clustermap
28 driftmap
driftmap Detection of an eventual trend
Description
The function lsquodriftmaprsquo creates a grid on the map and calculates the mean and median for each cellThe right plot (resp left plot) represents means and medians calculated by row (resp column)
Usage
driftmap(long lat var interpol = 1nuage = 0 carte = NULLlablong = lablat = labvar = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
interpol if 1 the mean and median calculated are linearly interpoled
nuage if 1 the individuals are also represented on the graphics
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
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
labvar name of variable lsquovarrsquo
Details
Possibility to change the number of cells in the grid with the tcltk window to interpolate the meansand medians calculated (by default) to work on a rotated map Notice that this is not an interactivefunction
Value
No values returned only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
eire 29
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmaprotation
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)driftmap(auckland$Eastingauckland$Northingauckland$Deaths197785interpol=0nuage=1lablong=Xlablat=Ylabvar=Deaths197785)
data afcondata(afcon)driftmap(afcon$xafcon$yafcon$totconinterpol=0nuage=1lablong=Xlablat=Ylabvar=Number of conflicts)
data meusedata(meuseall)data(meuseriv)driftmap(meuseall$xmeuseall$ymeuseall$coppernuage=1lablong=Xlablat=Ylabvar=Concentration de cuivre (en ppm))
eire Eire data sets
Description
The lsquoeirersquo data frame has 26 rows and 11 columns
Usage
data(eire)
Format
A data frame with 26 observations on the following 11 variables
V1 a vector x of size n
V2 a vector y of size n
A Percentage of sample with blood group A
towns Townsunit area
pale Beyond the Pale 0 within the Pale 1
size number of blood type samples
ROADACC arterial road network accessibility in 1961
30 eirepolys
OWNCONS percentage in value terms of gross agricultural output of each county consumed by itself
POPCHG 1961 population as percentage of 1926
RETSALE value of retail sales c000
INCOME total personal income c000
Details
This data provides from spdep package
Source
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
Examples
data(eire)
eirepolys Spatial polygonal contours of eire dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of eiredataset
Usage
data(eirepolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or rsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibility torepesent spatial polygonal contours as a backgroud map Thatrsquos why we create functions lsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of the polygons
Source
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
findneighbors 31
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
findneighbors Research of the m nearest neighbors for sites
Description
The function lsquofindneighborsrsquo gives for each site of coordinates (xc yc) the m nearest neighbors inthe set of sites
Usage
findneighbors(xc yc m)
Arguments
xc a numerical vector x of size n
yc a numerical vector y of size n
m number of nearest neighbors
Details
In case of ties the nearest neighbor is randomly chosen among the ties This function is called inmakeneighborswr
Value
A matrix of size ntimes n containing 1 on position (i j) if j is m-nearest neighbour to i
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakedistanceWmakeneighborsw
32 genpca
Examples
data(auckland)Wlt-findneighbors(auckland$Eastingauckland$Northing1)
genpca Generalized Principal Component Analysis (PCA)
Description
The function lsquogenpcarsquo computes a generalized Principal Component Analysis (PCA) It calculatesthe principal components the coordinates of the variables and in these principals components axesand the inertia of these principal components
Usage
genpca(data w=rep(1nrow(data)length=nrow(data)) m=diag(1ncol(data)ncol(data))center=TRUE reduc=TRUE)
Arguments
data matrix ntimes p
w vector of size n of weight (by default weight = t(1n 1n))
m matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centered PCA (by default center=TRUE)
reduc boolean if TRUE reduced PCA (by default reduce=TRUE)
Details
LetW = diag(w)
x = data = (xprime1 x
primen)prime
withxi = (x1
i xpi )
Let1n = (1 1)prime
with n rows and 1p = (1 1)prime
with p rows Normalization of weight
wi =wisumi wi
genpca 33
Vector of means x = (x1 xp)prime
withxj =
sumi
wixji
If center=Truexc = xminus 1nxprime
Standart deviation (σj)2 =
sumi
wi(xji )
2 minus (xj)2
Σ = diag((σ1)2 (σp)2)prime
If reduc=True xcr = xc times Σminus12
Variance-Covariance matrix
C = xprimecrWxcr
Cholesky decomposition M = LLprime where M=mLet
Cl = LCLprime
Let U and D as ClU = UD
with D = diag(λ1 λp)Let
V = LprimeU
Then Coordinates of individuals in the principals components basis
CC = xcrV
Coordinates of variables in principals components
V C = CV Dminus12
Inertia I = D1p
Value
Returns lsquoinertiarsquo vector of size p with percent of inertia of each component (corresponding to I)lsquocasecoordrsquo matrix ntimes p (corresponding to matrix CC) lsquovarcoordrsquo matrix ptimes p (corresponding tomatrix V C)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
34 gini
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermappcamap
gini Calculates a Gini Index
Description
The function lsquoginirsquo calculates the Gini Index associated to the variable lsquovarrsquo
Usage
gini(var)
Arguments
var a vector of numerical values of size n
Details
Let xk k = 1 K be the distinct values taken by V ar For each site Ginir returns two pairs offrequencies The pair (f g) where f represents
fk =1n
sumi
1(V ari = xk)
(n is the length of lsquovarrsquo) and g represents
gk =xk
xfk
The pair (FG) represents the corresponding cumulative frequenciesThe Gini Index is calculated as
IG =12x
Ksumi=1
Ksumj=1
|xi minus xj |
Value
(f F g G gini) where f F g and G are vectors of size K and gini a numeric value
Note
This function is used in ginimapR but it is not an interactive function
ginimap 35
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
ginimap
ginimap Lorentz curve and map
Description
The function lsquoginimaprsquo computes a Lorentz curve from rsquovarrsquo and calculates the Gini Index associ-ated to var
Usage
ginimap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
8 auckland
auckland Marshallrsquos infant mortality in Auckland dataset
Description
The Auckland data frame has 167 rows (census area units - CAU) and 4 columns
Usage
data(auckland)
Format
A data frame with 167 observations on the following 4 variables
Easting a numeric vector of x coordinates in an unknown spatial reference system
Northing a numeric vector of y coordinates in an unknown spatial reference system
Deaths197785 a numeric vector of counts of infant (under 5 years of age) deaths in Auckland1977-1985
Under51981 a numeric vector of population under 5 years of age at the 1981 Census
Details
This data provides from spdep package
Source
Bailey T Gatrell A (1995) Interactive Spatial Data Analysis Harlow Longman - INFOMAP dataset used with permission
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Marshall R M (1991) Mapping disease and mortality rates using Empirical Bayes Estimators Ap-plied Statistics 40 283-294
Examples
data(auckland)
baltimore 9
baltimore House sales prices Baltimore MD 1978
Description
House sales price and characteristics for a spatial hedonic regression Baltimore MD 1978
Usage
data(baltimore)
Format
A data frame with 211 observations on the following 17 variables
STATION StationPRICE PriceNROOM Number of roomsDWELL Presence of well (0 or 1)NBATH Number of bathsPATIO Presence of patio (0 or 1)FIREPL Presence of fire stationAC ACBMENT BMENTNSTOR NSTORGAR Number of garagesAGE AgeCITCOU CITCOULOTSZ LOTSZSQFT SQFTX a vector x of size n
Y a vector y of size n
Details
This data provides from spdep package
Source
Prepared by Luc Anselin Original data made available by Rodin Dubin Weatherhead School ofManagement Case Western Research University Cleveland OH
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Dubin Robin A (1992) Spatial autocorrelation and neighbourhood quality Regional Scienceand Urban Economics 22(3) 433-452
10 barmap
Examples
data(baltimore)
barmap Interactive Bar plot and map
Description
The function lsquobarmaprsquo draws a bar plot (vertical bar) of the given factor variable var and a mapwith sites of coordinates (long lat)
Usage
barmap(long lat var listvar = NULL listnomvar = NULLcriteria = NULL carte = NULL label = color = 1symbol = 0 labvar = labmod = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of factor of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with name of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
barmap 11
labvar name of variable var
labmod names of factors of var
axis 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 selection of a bar on the bar plot results in the corresponding sites coloured on the map with thecorresponding colour observed on the bar Reversely the selection of sites on the map by lsquopointsrsquoor lsquopolygonrsquo results in the drawing of the sub-barplot in red
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
Examples
data oldcoldata(oldcol)data(oldcolpolys)oldcolcontourslt-polylist2list(oldcolpolys)barmap(oldcol$X oldcol$Y oldcol$NSA listvar=oldcolcarte=oldcolcontourslistnomvar=names(oldcol)criteria=(oldcol$CP==1)axis=TRUElablong=Xlablat=Y)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)barmap(eire$V1eire$V2eire$palecarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
12 boston
boston Corrected Boston Housing Data
Description
The boston data frame has 506 rows and 20 columns It contains the Harrison and Rubinfeld(1978) data corrected for a few minor errors and augmented with the latitude and longitude of theobservations Gilley and Pace also point out that MEDEV is censored in that median values at orover USD 50000 are set to USD 50000
Usage
data(boston)
Format
A data frame with 506 observations on the following 22 variables
x a vector x of size n
y a vector y of size n
TOWN a factor with levels given by town names
TOWNNO a numeric vector corresponding to town
TRACT a numeric vector of tract ID numbers
LON a numeric vector of tract point longitudes in decimal degrees
LAT a numeric vector of tract point latitudes in decimal degrees
MEDV a numeric vector of median values of owner-occupied housing in USD 1000
CMEDV a numeric vector corrected median values of owner-occupied housing in USD 1000
CRIM a numeric vector of per capita crime
ZN a numeric vector of proportions of residential land zoned for lots over 25000 sq ft per town(constant for all Boston tracts)
INDUS a numeric vector of proportions of non-retail business acres per town (constant for allBoston tracts)
CHAS a factor with levels 1 if tract borders Charles River 0 otherwise
NOX a numeric vector of nitric oxides concentration (parts per 10 million) per town
RM a numeric vector of average numbers of rooms per dwelling
AGE a numeric vector of proportions of owner-occupied units built prior to 1940
DIS a numeric vector of weighted distances to five Boston employment centres
RAD a numeric vector of an index of accessibility to radial highways per town (constant for allBoston tracts)
TAX a numeric vector full-value proprty-tax rate per USD 10000 per town (constant for all Bostontracts)
PTRATIO a numeric vector of pupil-teacher ratios per town (constant for all Boston tracts)
B a numeric vector of 1000 lowast (Bk minus 063)2 where Bk is the proportion of blacks
LSTAT a numeric vector of percentage values of lower status population
boxplotmap 13
Details
This data provides from spdep package
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Harrison David and Daniel L Rubinfeld ldquoHedonic Housing Prices and the Demand for CleanAirrdquo Journal of Environmental Economics and Management Volume 5 (1978) 81-102 Originaldata
Gilley OW and R Kelley Pace ldquoOn the Harrison and Rubinfeld Datardquo Journal of EnvironmentalEconomics and Management 31 (1996) 403-405 Provided corrections and examined censoring
Pace R Kelley and OW Gilley ldquoUsing the Spatial Configuration of the Data to Improve Estima-tionrdquo Journal of the Real Estate Finance and Economics 14 (1997) 333-340
Examples
data(boston)
boxplotmap Interactive boxplot and map
Description
The function lsquoboxplotmaprsquo draws a boxplot of the given variable var and a map with site of coor-dinates (long lat)
Usage
boxplotmap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
14 boxplotmap
listnomvar list of character of size p with names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar name of variable var
axis 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
There is an interactivity only in one direction the sites selected by interquartile on the boxplot arerepresented on the map in red
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
carte 15
Examples
donnees oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)boxplotmap(oldcol$X oldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CP==1)axis=TRUElablong=Xlablat=Y)
donnees bostondata(boston)boxplotmap(boston$xboston$yboston$CRIMlistvar=bostonlistnomvar=names(boston)criteria=(boston$CHAS==1))
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)boxplotmap(eire$V1eire$V2eire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Taux deacutevolution de la population de 1921 agrave1962)
carte Drawing a map
Description
The function lsquocartersquo draws a map with sites of coordinates (long lat) and represents sites whichhave been selected (obs) in red if symbol=0 or with star if symbol=1 This function is called bymost of the functions of GeoXp (this is not an interactive function)
Usage
carte(long lat obscriteria=NULLbuble=FALSEcbuble=NULLnointer=FALSE carte=NULLnocart=FALSE label=symbol=0col=0 lablong= lablat= method= W=NULL couleurs=classe obsqlegmap=NULLlegends=list(FALSEFALSE)labmod=axis=FALSE)
Arguments
long a vector x of size n
lat a vector y of size n
obs a boolean vector of size n with TRUE on selected sites
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
16 carte
buble a boolean with TRUE for drawing bubbles FALSE otherwise
cbuble vector of size n with size of each site depending on variable with which bubblesare constructed
nointer a boolean with TRUE for drawing sites selected by criteria FALSE otherwise
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
nocart a boolean with TRUE for drawing spatial contours FALSE otherwise
label vector of character of size n with name of each site
col 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points are inred if 1 selected points are stars
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
method Specification for some graphics such as lsquoNeighbourplot1rsquo lsquoNeighbourplot2rsquolsquoClusterrsquo lsquoAngleplotrsquo lsquoVariocloudrsquo
W neighbourhood matrix of size ntimes n necessary when method=lsquoNeighbourplotrsquo
couleurs Possibility to change colors (only for admin)
classe vector of n whith class necessary when method=lsquoClusterrsquo
obsq vector of size n with number of quadrant to which the site belongs necessarywhen method=lsquoQuadrantrsquo
legmap a list of (numericnumericnumericnumericnumericnumericcharacter) with thesizes and the corresponding values of the 3 bubbles represented in the legend andthe variable name of variable choosed
clustermap 17
legends a list of c(booleanbooleanc(numericnumeric)c(numericnumeric)) with TRUEfor drawing legends of bubbles (1st argument) or factors (2nd argument) and thecoordinates of the location of the upper left corner of the legend box
labmod Name of factors
axis a boolean with True for drawing axes on the map
Details
For factors possibility to represent sites with different colors for each level Others options permitto represent with a croice some sites with special lsquocriteriarsquo with lsquobubblersquo according to a variablegiven a spatial contours with lsquocartersquo names of sites with lsquolabelrsquo or a representation in flowerPossibility to draw a legend giving the sizes of bubbles and colors of levels
Value
No values only drawing of a map
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
clustermap Classification of dataset using kmeansr or hclustr and representationof clusters on a map
Description
The function lsquoclustermaprsquo performs a classification of the sites from the variables included indataset and computes a bar plot of the clusters calculated Classification methods comes fromhclustR (hierarchical cluster analysis) and kmeansR (k-means clustering) and number of class ischosen with clustnum
Usage
clustermap(longlatdatasetclustnummethod=kmeanstype=NULLcenters=NULLscale=FALSElistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabvar=Clusterlabel=symbol=0color=1labmod=axis=FALSElablong= lablat=)
18 clustermap
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix of variables of numeric values
clustnum Number of clusters
method two methos lsquokmeansrsquo by default or lsquohclustrsquo
type If method=lsquohclustrdquo type=ldquocompleterdquo by default (the possibilities are given inhelp(hclust) as lsquowardrsquo lsquosinglersquo etc) If method=lsquokmeansrsquo type=Hartigan-Wong by default (the possibilities are given in help(kmeans) as lsquoForgyrsquo etc)
centers If method=rsquokmeansrsquo user can give a matrix with initial cluster centers
scale If scale=TRUE the dataset is reducted
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
labvar name of variable var
label vector of size n with names of each site
color 0 or 1 (by default) choice of representation of selected points If 0 sites arerepresented in blue if 1 sites are represented with different colors for eachcluster
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labmod names of Clusters
clustermap 19
axis 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 two windows are interactive the sites selected by a bar chosen on the bar plot are representedon the map in red and the values of sites selected on the map by lsquopointsrsquo or lsquopolygonrsquo are representedin red on the bar plot The dendogram is also drawn for rsquohclustrsquo method In option possibility tochoose the classification method
Value
A vector of boolean of size n (TRUE if the site was in the last selection) and a vector of size nwhith the number of cluster for each site
Note
To use the functions hclustr and kmeansr we take many arguments by default If the user wouldlike to modify these arguments he should call these functions first and then use the functionbarmapr to visualize the calculated clusters
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Murtagh F (1985) ldquoMultidimensional Clustering Algorithmsrdquo
Hartigan J A and Wong M A (1979) A K-means clustering algorithm Applied Statistics 28100-108
See Also
barmap pcamap
Examples
donneacutees oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)obslt-clustermap(oldcol$X oldcol$Yoldcol[712]3listvar=oldcollistnomvar=names(oldcol)carte=contoursOLDcriteria=(oldcol$CP==1))
20 dbledensitymap
data avifaunelibrary(ade4)data(mafragh)dlt-distchi2(mafragh$flo)
obslt-clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4method=hclusttype=wardlistvar=mafragh$partitionlistnomvar=class)
claslt-obs$vectclasselt-by(dclasmean)glt-rbind(e[1]$1e[2]$2e[3]$3e[4]$4)
clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4centers=glistvar=mafragh$partitionlistnomvar=class)
dbledensitymap Double Kernel density estimates and map
Description
The function lsquodbledensitymaprsquo plots two kernel density estimates from var1 and var2 computedwith lsquobkdeRrsquo and a map with sites of coordinates (long lat) Each site is associated to a value ofvar1 and var2 and the two windows are interactive
Usage
dbledensitymap(long lat var1 var2kernel=triweight listvar = NULLlistnomvar = NULL carte = NULL criteria = NULL label = symbol = 0 color = 1 labvar = c(var1 var2) axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
dbledensitymap 21
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar list of character with names of variables var1 and var2
axis 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 user can choose an interval on the density curve by mouse clicking on the lower and upperboundaries of the interval or by giving directly these values The selected sites are then representedon the map in red A selection by lsquopointsrsquo or lsquopolygonrsquo on the map results in the drawing of thedensity of the corresponding sub-distribution on the density plot Finally the user can modify thebandwith parameter with a cursor in the tcltk window (parameter α) α is the smoothing parameterfor the kernel smooth it represents the mean percentage of sample points involved in the localaveraging (example α = 20 means that on average ntimes 02 points are in any interval of length 2hwhere h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
22 dblehistomap
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dbledensitymap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785))) listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-dbledensitymap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)dbledensitymap(eire$V1eire$V2eire$Aeire$townslabvar=c(Taux dindividus au groupe sanguin ASurface urbaine)carte=eirecontourskernel=normallistvar=eirelistnomvar=names(eire))
dblehistomap Double Interactive Histogram and map
Description
The function lsquodblehistomaprsquo draws two histograms of the given variables var1 and var2 and a mapwith sites of coordinates (long lat) Each site is associated to a value of var1 and var2 and thereis interactivity between the two windows created
dblehistomap 23
Usage
dblehistomap(long lat var1 var2 listvar = NULL listnomvar = NULLnbcol1 = 10 nbcol2 = 10 carte = NULL criteria = NULLsymbol = 0 color = 1 labvar = c( ) label = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
nbcol1 number of cells for histogram 1 (10 by default)
nbcol2 number of cells for histogram 2 (10 by default)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
24 densitymap
Details
The selection of sites by lsquopointsrsquo or lsquopolygonsrsquo on the map results in the drawing of the red his-tograms of the subdistributions corresponding to this subset of sites
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dblehistomap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785)))listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadblehistomap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
densitymap Kernel density estimates and map
Description
The function lsquodensitymaprsquo draws kernel density estimates of the variable var with rsquobkdeRrsquo anda map with sites of coordinate (long lat) Each site is associated to a value of var and there isinteractivity between the two windows
densitymap 25
Usage
densitymap(long lat varkernel=triweightlistvar=NULLlistnomvar=NULLcarte=NULL criteria=NULLlabel=symbol=0color=1 labvar=axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
labvar name of variable var
axis 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
26 densitymap
Details
The user can choose an interval on the density curve by mouse clicking on the graph on the extremi-ties of interval or by specifying directly values The sites selected by an interval are then representedon the map in red The selection of sites on the map by lsquopointsrsquo or lsquopolygonrsquo results in the draw-ing of the kernel densities of the subdistributions corresponding to this subset of sites Finally theuser can modify the bandwith parameter with a cursor in the tcltk window (parameter α) α is thesmoothing parameter for the kernel smooth it represents the mean percentage of sample pointsinvolved in the local averaging (example α = 20 means that on average ntimes 02 points are in anyinterval of length 2h where h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
library tcltk and KernSmooth data olcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)densitymap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadensitymap(colombuscontours$Xcolombuscontours$Ycolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)
distchi2 27
data(eirepolys)eirecontourslt-polylist2list(eirepolys)densitymap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
distchi2 It gives an euclidian distance matrix for factors using metric of χ2
Description
The function lsquodistchi2rsquo calculates an euclidian distance matrix for factors using metric of χ2
Usage
distchi2(mat)
Arguments
mat A matrix of factors given as numeric values
Details
The euclidian distance between two individuals i and k using the metric of χ2 is given by
d2χ2 =
n
p
sumj
p
mjsuml
δjlik
1nj
l
with n number of individuals p number of variables mj is the number of possibilities for variableY j nj
l is the number of individuals where l has been observed for Y j and δjlik = 1 if there is a
discordance between i and k for l and 0 otherwise It is not an interactive function
Value
It returns a dist object (see help(dist))
Author(s)
Laurent Thibault
References
Besse Philippe ldquoData mining 2 Modeacutelisation statistique et apprentissagerdquo Publication du LSPhttpwwwlspups-tlsefrBesse
See Also
clustermap
28 driftmap
driftmap Detection of an eventual trend
Description
The function lsquodriftmaprsquo creates a grid on the map and calculates the mean and median for each cellThe right plot (resp left plot) represents means and medians calculated by row (resp column)
Usage
driftmap(long lat var interpol = 1nuage = 0 carte = NULLlablong = lablat = labvar = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
interpol if 1 the mean and median calculated are linearly interpoled
nuage if 1 the individuals are also represented on the graphics
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
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
labvar name of variable lsquovarrsquo
Details
Possibility to change the number of cells in the grid with the tcltk window to interpolate the meansand medians calculated (by default) to work on a rotated map Notice that this is not an interactivefunction
Value
No values returned only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
eire 29
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmaprotation
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)driftmap(auckland$Eastingauckland$Northingauckland$Deaths197785interpol=0nuage=1lablong=Xlablat=Ylabvar=Deaths197785)
data afcondata(afcon)driftmap(afcon$xafcon$yafcon$totconinterpol=0nuage=1lablong=Xlablat=Ylabvar=Number of conflicts)
data meusedata(meuseall)data(meuseriv)driftmap(meuseall$xmeuseall$ymeuseall$coppernuage=1lablong=Xlablat=Ylabvar=Concentration de cuivre (en ppm))
eire Eire data sets
Description
The lsquoeirersquo data frame has 26 rows and 11 columns
Usage
data(eire)
Format
A data frame with 26 observations on the following 11 variables
V1 a vector x of size n
V2 a vector y of size n
A Percentage of sample with blood group A
towns Townsunit area
pale Beyond the Pale 0 within the Pale 1
size number of blood type samples
ROADACC arterial road network accessibility in 1961
30 eirepolys
OWNCONS percentage in value terms of gross agricultural output of each county consumed by itself
POPCHG 1961 population as percentage of 1926
RETSALE value of retail sales c000
INCOME total personal income c000
Details
This data provides from spdep package
Source
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
Examples
data(eire)
eirepolys Spatial polygonal contours of eire dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of eiredataset
Usage
data(eirepolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or rsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibility torepesent spatial polygonal contours as a backgroud map Thatrsquos why we create functions lsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of the polygons
Source
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
findneighbors 31
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
findneighbors Research of the m nearest neighbors for sites
Description
The function lsquofindneighborsrsquo gives for each site of coordinates (xc yc) the m nearest neighbors inthe set of sites
Usage
findneighbors(xc yc m)
Arguments
xc a numerical vector x of size n
yc a numerical vector y of size n
m number of nearest neighbors
Details
In case of ties the nearest neighbor is randomly chosen among the ties This function is called inmakeneighborswr
Value
A matrix of size ntimes n containing 1 on position (i j) if j is m-nearest neighbour to i
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakedistanceWmakeneighborsw
32 genpca
Examples
data(auckland)Wlt-findneighbors(auckland$Eastingauckland$Northing1)
genpca Generalized Principal Component Analysis (PCA)
Description
The function lsquogenpcarsquo computes a generalized Principal Component Analysis (PCA) It calculatesthe principal components the coordinates of the variables and in these principals components axesand the inertia of these principal components
Usage
genpca(data w=rep(1nrow(data)length=nrow(data)) m=diag(1ncol(data)ncol(data))center=TRUE reduc=TRUE)
Arguments
data matrix ntimes p
w vector of size n of weight (by default weight = t(1n 1n))
m matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centered PCA (by default center=TRUE)
reduc boolean if TRUE reduced PCA (by default reduce=TRUE)
Details
LetW = diag(w)
x = data = (xprime1 x
primen)prime
withxi = (x1
i xpi )
Let1n = (1 1)prime
with n rows and 1p = (1 1)prime
with p rows Normalization of weight
wi =wisumi wi
genpca 33
Vector of means x = (x1 xp)prime
withxj =
sumi
wixji
If center=Truexc = xminus 1nxprime
Standart deviation (σj)2 =
sumi
wi(xji )
2 minus (xj)2
Σ = diag((σ1)2 (σp)2)prime
If reduc=True xcr = xc times Σminus12
Variance-Covariance matrix
C = xprimecrWxcr
Cholesky decomposition M = LLprime where M=mLet
Cl = LCLprime
Let U and D as ClU = UD
with D = diag(λ1 λp)Let
V = LprimeU
Then Coordinates of individuals in the principals components basis
CC = xcrV
Coordinates of variables in principals components
V C = CV Dminus12
Inertia I = D1p
Value
Returns lsquoinertiarsquo vector of size p with percent of inertia of each component (corresponding to I)lsquocasecoordrsquo matrix ntimes p (corresponding to matrix CC) lsquovarcoordrsquo matrix ptimes p (corresponding tomatrix V C)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
34 gini
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermappcamap
gini Calculates a Gini Index
Description
The function lsquoginirsquo calculates the Gini Index associated to the variable lsquovarrsquo
Usage
gini(var)
Arguments
var a vector of numerical values of size n
Details
Let xk k = 1 K be the distinct values taken by V ar For each site Ginir returns two pairs offrequencies The pair (f g) where f represents
fk =1n
sumi
1(V ari = xk)
(n is the length of lsquovarrsquo) and g represents
gk =xk
xfk
The pair (FG) represents the corresponding cumulative frequenciesThe Gini Index is calculated as
IG =12x
Ksumi=1
Ksumj=1
|xi minus xj |
Value
(f F g G gini) where f F g and G are vectors of size K and gini a numeric value
Note
This function is used in ginimapR but it is not an interactive function
ginimap 35
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
ginimap
ginimap Lorentz curve and map
Description
The function lsquoginimaprsquo computes a Lorentz curve from rsquovarrsquo and calculates the Gini Index associ-ated to var
Usage
ginimap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
baltimore 9
baltimore House sales prices Baltimore MD 1978
Description
House sales price and characteristics for a spatial hedonic regression Baltimore MD 1978
Usage
data(baltimore)
Format
A data frame with 211 observations on the following 17 variables
STATION StationPRICE PriceNROOM Number of roomsDWELL Presence of well (0 or 1)NBATH Number of bathsPATIO Presence of patio (0 or 1)FIREPL Presence of fire stationAC ACBMENT BMENTNSTOR NSTORGAR Number of garagesAGE AgeCITCOU CITCOULOTSZ LOTSZSQFT SQFTX a vector x of size n
Y a vector y of size n
Details
This data provides from spdep package
Source
Prepared by Luc Anselin Original data made available by Rodin Dubin Weatherhead School ofManagement Case Western Research University Cleveland OH
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Dubin Robin A (1992) Spatial autocorrelation and neighbourhood quality Regional Scienceand Urban Economics 22(3) 433-452
10 barmap
Examples
data(baltimore)
barmap Interactive Bar plot and map
Description
The function lsquobarmaprsquo draws a bar plot (vertical bar) of the given factor variable var and a mapwith sites of coordinates (long lat)
Usage
barmap(long lat var listvar = NULL listnomvar = NULLcriteria = NULL carte = NULL label = color = 1symbol = 0 labvar = labmod = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of factor of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with name of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
barmap 11
labvar name of variable var
labmod names of factors of var
axis 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 selection of a bar on the bar plot results in the corresponding sites coloured on the map with thecorresponding colour observed on the bar Reversely the selection of sites on the map by lsquopointsrsquoor lsquopolygonrsquo results in the drawing of the sub-barplot in red
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
Examples
data oldcoldata(oldcol)data(oldcolpolys)oldcolcontourslt-polylist2list(oldcolpolys)barmap(oldcol$X oldcol$Y oldcol$NSA listvar=oldcolcarte=oldcolcontourslistnomvar=names(oldcol)criteria=(oldcol$CP==1)axis=TRUElablong=Xlablat=Y)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)barmap(eire$V1eire$V2eire$palecarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
12 boston
boston Corrected Boston Housing Data
Description
The boston data frame has 506 rows and 20 columns It contains the Harrison and Rubinfeld(1978) data corrected for a few minor errors and augmented with the latitude and longitude of theobservations Gilley and Pace also point out that MEDEV is censored in that median values at orover USD 50000 are set to USD 50000
Usage
data(boston)
Format
A data frame with 506 observations on the following 22 variables
x a vector x of size n
y a vector y of size n
TOWN a factor with levels given by town names
TOWNNO a numeric vector corresponding to town
TRACT a numeric vector of tract ID numbers
LON a numeric vector of tract point longitudes in decimal degrees
LAT a numeric vector of tract point latitudes in decimal degrees
MEDV a numeric vector of median values of owner-occupied housing in USD 1000
CMEDV a numeric vector corrected median values of owner-occupied housing in USD 1000
CRIM a numeric vector of per capita crime
ZN a numeric vector of proportions of residential land zoned for lots over 25000 sq ft per town(constant for all Boston tracts)
INDUS a numeric vector of proportions of non-retail business acres per town (constant for allBoston tracts)
CHAS a factor with levels 1 if tract borders Charles River 0 otherwise
NOX a numeric vector of nitric oxides concentration (parts per 10 million) per town
RM a numeric vector of average numbers of rooms per dwelling
AGE a numeric vector of proportions of owner-occupied units built prior to 1940
DIS a numeric vector of weighted distances to five Boston employment centres
RAD a numeric vector of an index of accessibility to radial highways per town (constant for allBoston tracts)
TAX a numeric vector full-value proprty-tax rate per USD 10000 per town (constant for all Bostontracts)
PTRATIO a numeric vector of pupil-teacher ratios per town (constant for all Boston tracts)
B a numeric vector of 1000 lowast (Bk minus 063)2 where Bk is the proportion of blacks
LSTAT a numeric vector of percentage values of lower status population
boxplotmap 13
Details
This data provides from spdep package
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Harrison David and Daniel L Rubinfeld ldquoHedonic Housing Prices and the Demand for CleanAirrdquo Journal of Environmental Economics and Management Volume 5 (1978) 81-102 Originaldata
Gilley OW and R Kelley Pace ldquoOn the Harrison and Rubinfeld Datardquo Journal of EnvironmentalEconomics and Management 31 (1996) 403-405 Provided corrections and examined censoring
Pace R Kelley and OW Gilley ldquoUsing the Spatial Configuration of the Data to Improve Estima-tionrdquo Journal of the Real Estate Finance and Economics 14 (1997) 333-340
Examples
data(boston)
boxplotmap Interactive boxplot and map
Description
The function lsquoboxplotmaprsquo draws a boxplot of the given variable var and a map with site of coor-dinates (long lat)
Usage
boxplotmap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
14 boxplotmap
listnomvar list of character of size p with names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar name of variable var
axis 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
There is an interactivity only in one direction the sites selected by interquartile on the boxplot arerepresented on the map in red
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
carte 15
Examples
donnees oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)boxplotmap(oldcol$X oldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CP==1)axis=TRUElablong=Xlablat=Y)
donnees bostondata(boston)boxplotmap(boston$xboston$yboston$CRIMlistvar=bostonlistnomvar=names(boston)criteria=(boston$CHAS==1))
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)boxplotmap(eire$V1eire$V2eire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Taux deacutevolution de la population de 1921 agrave1962)
carte Drawing a map
Description
The function lsquocartersquo draws a map with sites of coordinates (long lat) and represents sites whichhave been selected (obs) in red if symbol=0 or with star if symbol=1 This function is called bymost of the functions of GeoXp (this is not an interactive function)
Usage
carte(long lat obscriteria=NULLbuble=FALSEcbuble=NULLnointer=FALSE carte=NULLnocart=FALSE label=symbol=0col=0 lablong= lablat= method= W=NULL couleurs=classe obsqlegmap=NULLlegends=list(FALSEFALSE)labmod=axis=FALSE)
Arguments
long a vector x of size n
lat a vector y of size n
obs a boolean vector of size n with TRUE on selected sites
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
16 carte
buble a boolean with TRUE for drawing bubbles FALSE otherwise
cbuble vector of size n with size of each site depending on variable with which bubblesare constructed
nointer a boolean with TRUE for drawing sites selected by criteria FALSE otherwise
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
nocart a boolean with TRUE for drawing spatial contours FALSE otherwise
label vector of character of size n with name of each site
col 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points are inred if 1 selected points are stars
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
method Specification for some graphics such as lsquoNeighbourplot1rsquo lsquoNeighbourplot2rsquolsquoClusterrsquo lsquoAngleplotrsquo lsquoVariocloudrsquo
W neighbourhood matrix of size ntimes n necessary when method=lsquoNeighbourplotrsquo
couleurs Possibility to change colors (only for admin)
classe vector of n whith class necessary when method=lsquoClusterrsquo
obsq vector of size n with number of quadrant to which the site belongs necessarywhen method=lsquoQuadrantrsquo
legmap a list of (numericnumericnumericnumericnumericnumericcharacter) with thesizes and the corresponding values of the 3 bubbles represented in the legend andthe variable name of variable choosed
clustermap 17
legends a list of c(booleanbooleanc(numericnumeric)c(numericnumeric)) with TRUEfor drawing legends of bubbles (1st argument) or factors (2nd argument) and thecoordinates of the location of the upper left corner of the legend box
labmod Name of factors
axis a boolean with True for drawing axes on the map
Details
For factors possibility to represent sites with different colors for each level Others options permitto represent with a croice some sites with special lsquocriteriarsquo with lsquobubblersquo according to a variablegiven a spatial contours with lsquocartersquo names of sites with lsquolabelrsquo or a representation in flowerPossibility to draw a legend giving the sizes of bubbles and colors of levels
Value
No values only drawing of a map
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
clustermap Classification of dataset using kmeansr or hclustr and representationof clusters on a map
Description
The function lsquoclustermaprsquo performs a classification of the sites from the variables included indataset and computes a bar plot of the clusters calculated Classification methods comes fromhclustR (hierarchical cluster analysis) and kmeansR (k-means clustering) and number of class ischosen with clustnum
Usage
clustermap(longlatdatasetclustnummethod=kmeanstype=NULLcenters=NULLscale=FALSElistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabvar=Clusterlabel=symbol=0color=1labmod=axis=FALSElablong= lablat=)
18 clustermap
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix of variables of numeric values
clustnum Number of clusters
method two methos lsquokmeansrsquo by default or lsquohclustrsquo
type If method=lsquohclustrdquo type=ldquocompleterdquo by default (the possibilities are given inhelp(hclust) as lsquowardrsquo lsquosinglersquo etc) If method=lsquokmeansrsquo type=Hartigan-Wong by default (the possibilities are given in help(kmeans) as lsquoForgyrsquo etc)
centers If method=rsquokmeansrsquo user can give a matrix with initial cluster centers
scale If scale=TRUE the dataset is reducted
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
labvar name of variable var
label vector of size n with names of each site
color 0 or 1 (by default) choice of representation of selected points If 0 sites arerepresented in blue if 1 sites are represented with different colors for eachcluster
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labmod names of Clusters
clustermap 19
axis 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 two windows are interactive the sites selected by a bar chosen on the bar plot are representedon the map in red and the values of sites selected on the map by lsquopointsrsquo or lsquopolygonrsquo are representedin red on the bar plot The dendogram is also drawn for rsquohclustrsquo method In option possibility tochoose the classification method
Value
A vector of boolean of size n (TRUE if the site was in the last selection) and a vector of size nwhith the number of cluster for each site
Note
To use the functions hclustr and kmeansr we take many arguments by default If the user wouldlike to modify these arguments he should call these functions first and then use the functionbarmapr to visualize the calculated clusters
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Murtagh F (1985) ldquoMultidimensional Clustering Algorithmsrdquo
Hartigan J A and Wong M A (1979) A K-means clustering algorithm Applied Statistics 28100-108
See Also
barmap pcamap
Examples
donneacutees oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)obslt-clustermap(oldcol$X oldcol$Yoldcol[712]3listvar=oldcollistnomvar=names(oldcol)carte=contoursOLDcriteria=(oldcol$CP==1))
20 dbledensitymap
data avifaunelibrary(ade4)data(mafragh)dlt-distchi2(mafragh$flo)
obslt-clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4method=hclusttype=wardlistvar=mafragh$partitionlistnomvar=class)
claslt-obs$vectclasselt-by(dclasmean)glt-rbind(e[1]$1e[2]$2e[3]$3e[4]$4)
clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4centers=glistvar=mafragh$partitionlistnomvar=class)
dbledensitymap Double Kernel density estimates and map
Description
The function lsquodbledensitymaprsquo plots two kernel density estimates from var1 and var2 computedwith lsquobkdeRrsquo and a map with sites of coordinates (long lat) Each site is associated to a value ofvar1 and var2 and the two windows are interactive
Usage
dbledensitymap(long lat var1 var2kernel=triweight listvar = NULLlistnomvar = NULL carte = NULL criteria = NULL label = symbol = 0 color = 1 labvar = c(var1 var2) axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
dbledensitymap 21
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar list of character with names of variables var1 and var2
axis 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 user can choose an interval on the density curve by mouse clicking on the lower and upperboundaries of the interval or by giving directly these values The selected sites are then representedon the map in red A selection by lsquopointsrsquo or lsquopolygonrsquo on the map results in the drawing of thedensity of the corresponding sub-distribution on the density plot Finally the user can modify thebandwith parameter with a cursor in the tcltk window (parameter α) α is the smoothing parameterfor the kernel smooth it represents the mean percentage of sample points involved in the localaveraging (example α = 20 means that on average ntimes 02 points are in any interval of length 2hwhere h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
22 dblehistomap
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dbledensitymap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785))) listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-dbledensitymap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)dbledensitymap(eire$V1eire$V2eire$Aeire$townslabvar=c(Taux dindividus au groupe sanguin ASurface urbaine)carte=eirecontourskernel=normallistvar=eirelistnomvar=names(eire))
dblehistomap Double Interactive Histogram and map
Description
The function lsquodblehistomaprsquo draws two histograms of the given variables var1 and var2 and a mapwith sites of coordinates (long lat) Each site is associated to a value of var1 and var2 and thereis interactivity between the two windows created
dblehistomap 23
Usage
dblehistomap(long lat var1 var2 listvar = NULL listnomvar = NULLnbcol1 = 10 nbcol2 = 10 carte = NULL criteria = NULLsymbol = 0 color = 1 labvar = c( ) label = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
nbcol1 number of cells for histogram 1 (10 by default)
nbcol2 number of cells for histogram 2 (10 by default)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
24 densitymap
Details
The selection of sites by lsquopointsrsquo or lsquopolygonsrsquo on the map results in the drawing of the red his-tograms of the subdistributions corresponding to this subset of sites
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dblehistomap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785)))listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadblehistomap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
densitymap Kernel density estimates and map
Description
The function lsquodensitymaprsquo draws kernel density estimates of the variable var with rsquobkdeRrsquo anda map with sites of coordinate (long lat) Each site is associated to a value of var and there isinteractivity between the two windows
densitymap 25
Usage
densitymap(long lat varkernel=triweightlistvar=NULLlistnomvar=NULLcarte=NULL criteria=NULLlabel=symbol=0color=1 labvar=axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
labvar name of variable var
axis 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
26 densitymap
Details
The user can choose an interval on the density curve by mouse clicking on the graph on the extremi-ties of interval or by specifying directly values The sites selected by an interval are then representedon the map in red The selection of sites on the map by lsquopointsrsquo or lsquopolygonrsquo results in the draw-ing of the kernel densities of the subdistributions corresponding to this subset of sites Finally theuser can modify the bandwith parameter with a cursor in the tcltk window (parameter α) α is thesmoothing parameter for the kernel smooth it represents the mean percentage of sample pointsinvolved in the local averaging (example α = 20 means that on average ntimes 02 points are in anyinterval of length 2h where h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
library tcltk and KernSmooth data olcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)densitymap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadensitymap(colombuscontours$Xcolombuscontours$Ycolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)
distchi2 27
data(eirepolys)eirecontourslt-polylist2list(eirepolys)densitymap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
distchi2 It gives an euclidian distance matrix for factors using metric of χ2
Description
The function lsquodistchi2rsquo calculates an euclidian distance matrix for factors using metric of χ2
Usage
distchi2(mat)
Arguments
mat A matrix of factors given as numeric values
Details
The euclidian distance between two individuals i and k using the metric of χ2 is given by
d2χ2 =
n
p
sumj
p
mjsuml
δjlik
1nj
l
with n number of individuals p number of variables mj is the number of possibilities for variableY j nj
l is the number of individuals where l has been observed for Y j and δjlik = 1 if there is a
discordance between i and k for l and 0 otherwise It is not an interactive function
Value
It returns a dist object (see help(dist))
Author(s)
Laurent Thibault
References
Besse Philippe ldquoData mining 2 Modeacutelisation statistique et apprentissagerdquo Publication du LSPhttpwwwlspups-tlsefrBesse
See Also
clustermap
28 driftmap
driftmap Detection of an eventual trend
Description
The function lsquodriftmaprsquo creates a grid on the map and calculates the mean and median for each cellThe right plot (resp left plot) represents means and medians calculated by row (resp column)
Usage
driftmap(long lat var interpol = 1nuage = 0 carte = NULLlablong = lablat = labvar = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
interpol if 1 the mean and median calculated are linearly interpoled
nuage if 1 the individuals are also represented on the graphics
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
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
labvar name of variable lsquovarrsquo
Details
Possibility to change the number of cells in the grid with the tcltk window to interpolate the meansand medians calculated (by default) to work on a rotated map Notice that this is not an interactivefunction
Value
No values returned only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
eire 29
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmaprotation
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)driftmap(auckland$Eastingauckland$Northingauckland$Deaths197785interpol=0nuage=1lablong=Xlablat=Ylabvar=Deaths197785)
data afcondata(afcon)driftmap(afcon$xafcon$yafcon$totconinterpol=0nuage=1lablong=Xlablat=Ylabvar=Number of conflicts)
data meusedata(meuseall)data(meuseriv)driftmap(meuseall$xmeuseall$ymeuseall$coppernuage=1lablong=Xlablat=Ylabvar=Concentration de cuivre (en ppm))
eire Eire data sets
Description
The lsquoeirersquo data frame has 26 rows and 11 columns
Usage
data(eire)
Format
A data frame with 26 observations on the following 11 variables
V1 a vector x of size n
V2 a vector y of size n
A Percentage of sample with blood group A
towns Townsunit area
pale Beyond the Pale 0 within the Pale 1
size number of blood type samples
ROADACC arterial road network accessibility in 1961
30 eirepolys
OWNCONS percentage in value terms of gross agricultural output of each county consumed by itself
POPCHG 1961 population as percentage of 1926
RETSALE value of retail sales c000
INCOME total personal income c000
Details
This data provides from spdep package
Source
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
Examples
data(eire)
eirepolys Spatial polygonal contours of eire dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of eiredataset
Usage
data(eirepolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or rsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibility torepesent spatial polygonal contours as a backgroud map Thatrsquos why we create functions lsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of the polygons
Source
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
findneighbors 31
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
findneighbors Research of the m nearest neighbors for sites
Description
The function lsquofindneighborsrsquo gives for each site of coordinates (xc yc) the m nearest neighbors inthe set of sites
Usage
findneighbors(xc yc m)
Arguments
xc a numerical vector x of size n
yc a numerical vector y of size n
m number of nearest neighbors
Details
In case of ties the nearest neighbor is randomly chosen among the ties This function is called inmakeneighborswr
Value
A matrix of size ntimes n containing 1 on position (i j) if j is m-nearest neighbour to i
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakedistanceWmakeneighborsw
32 genpca
Examples
data(auckland)Wlt-findneighbors(auckland$Eastingauckland$Northing1)
genpca Generalized Principal Component Analysis (PCA)
Description
The function lsquogenpcarsquo computes a generalized Principal Component Analysis (PCA) It calculatesthe principal components the coordinates of the variables and in these principals components axesand the inertia of these principal components
Usage
genpca(data w=rep(1nrow(data)length=nrow(data)) m=diag(1ncol(data)ncol(data))center=TRUE reduc=TRUE)
Arguments
data matrix ntimes p
w vector of size n of weight (by default weight = t(1n 1n))
m matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centered PCA (by default center=TRUE)
reduc boolean if TRUE reduced PCA (by default reduce=TRUE)
Details
LetW = diag(w)
x = data = (xprime1 x
primen)prime
withxi = (x1
i xpi )
Let1n = (1 1)prime
with n rows and 1p = (1 1)prime
with p rows Normalization of weight
wi =wisumi wi
genpca 33
Vector of means x = (x1 xp)prime
withxj =
sumi
wixji
If center=Truexc = xminus 1nxprime
Standart deviation (σj)2 =
sumi
wi(xji )
2 minus (xj)2
Σ = diag((σ1)2 (σp)2)prime
If reduc=True xcr = xc times Σminus12
Variance-Covariance matrix
C = xprimecrWxcr
Cholesky decomposition M = LLprime where M=mLet
Cl = LCLprime
Let U and D as ClU = UD
with D = diag(λ1 λp)Let
V = LprimeU
Then Coordinates of individuals in the principals components basis
CC = xcrV
Coordinates of variables in principals components
V C = CV Dminus12
Inertia I = D1p
Value
Returns lsquoinertiarsquo vector of size p with percent of inertia of each component (corresponding to I)lsquocasecoordrsquo matrix ntimes p (corresponding to matrix CC) lsquovarcoordrsquo matrix ptimes p (corresponding tomatrix V C)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
34 gini
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermappcamap
gini Calculates a Gini Index
Description
The function lsquoginirsquo calculates the Gini Index associated to the variable lsquovarrsquo
Usage
gini(var)
Arguments
var a vector of numerical values of size n
Details
Let xk k = 1 K be the distinct values taken by V ar For each site Ginir returns two pairs offrequencies The pair (f g) where f represents
fk =1n
sumi
1(V ari = xk)
(n is the length of lsquovarrsquo) and g represents
gk =xk
xfk
The pair (FG) represents the corresponding cumulative frequenciesThe Gini Index is calculated as
IG =12x
Ksumi=1
Ksumj=1
|xi minus xj |
Value
(f F g G gini) where f F g and G are vectors of size K and gini a numeric value
Note
This function is used in ginimapR but it is not an interactive function
ginimap 35
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
ginimap
ginimap Lorentz curve and map
Description
The function lsquoginimaprsquo computes a Lorentz curve from rsquovarrsquo and calculates the Gini Index associ-ated to var
Usage
ginimap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
10 barmap
Examples
data(baltimore)
barmap Interactive Bar plot and map
Description
The function lsquobarmaprsquo draws a bar plot (vertical bar) of the given factor variable var and a mapwith sites of coordinates (long lat)
Usage
barmap(long lat var listvar = NULL listnomvar = NULLcriteria = NULL carte = NULL label = color = 1symbol = 0 labvar = labmod = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of factor of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with name of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
barmap 11
labvar name of variable var
labmod names of factors of var
axis 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 selection of a bar on the bar plot results in the corresponding sites coloured on the map with thecorresponding colour observed on the bar Reversely the selection of sites on the map by lsquopointsrsquoor lsquopolygonrsquo results in the drawing of the sub-barplot in red
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
Examples
data oldcoldata(oldcol)data(oldcolpolys)oldcolcontourslt-polylist2list(oldcolpolys)barmap(oldcol$X oldcol$Y oldcol$NSA listvar=oldcolcarte=oldcolcontourslistnomvar=names(oldcol)criteria=(oldcol$CP==1)axis=TRUElablong=Xlablat=Y)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)barmap(eire$V1eire$V2eire$palecarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
12 boston
boston Corrected Boston Housing Data
Description
The boston data frame has 506 rows and 20 columns It contains the Harrison and Rubinfeld(1978) data corrected for a few minor errors and augmented with the latitude and longitude of theobservations Gilley and Pace also point out that MEDEV is censored in that median values at orover USD 50000 are set to USD 50000
Usage
data(boston)
Format
A data frame with 506 observations on the following 22 variables
x a vector x of size n
y a vector y of size n
TOWN a factor with levels given by town names
TOWNNO a numeric vector corresponding to town
TRACT a numeric vector of tract ID numbers
LON a numeric vector of tract point longitudes in decimal degrees
LAT a numeric vector of tract point latitudes in decimal degrees
MEDV a numeric vector of median values of owner-occupied housing in USD 1000
CMEDV a numeric vector corrected median values of owner-occupied housing in USD 1000
CRIM a numeric vector of per capita crime
ZN a numeric vector of proportions of residential land zoned for lots over 25000 sq ft per town(constant for all Boston tracts)
INDUS a numeric vector of proportions of non-retail business acres per town (constant for allBoston tracts)
CHAS a factor with levels 1 if tract borders Charles River 0 otherwise
NOX a numeric vector of nitric oxides concentration (parts per 10 million) per town
RM a numeric vector of average numbers of rooms per dwelling
AGE a numeric vector of proportions of owner-occupied units built prior to 1940
DIS a numeric vector of weighted distances to five Boston employment centres
RAD a numeric vector of an index of accessibility to radial highways per town (constant for allBoston tracts)
TAX a numeric vector full-value proprty-tax rate per USD 10000 per town (constant for all Bostontracts)
PTRATIO a numeric vector of pupil-teacher ratios per town (constant for all Boston tracts)
B a numeric vector of 1000 lowast (Bk minus 063)2 where Bk is the proportion of blacks
LSTAT a numeric vector of percentage values of lower status population
boxplotmap 13
Details
This data provides from spdep package
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Harrison David and Daniel L Rubinfeld ldquoHedonic Housing Prices and the Demand for CleanAirrdquo Journal of Environmental Economics and Management Volume 5 (1978) 81-102 Originaldata
Gilley OW and R Kelley Pace ldquoOn the Harrison and Rubinfeld Datardquo Journal of EnvironmentalEconomics and Management 31 (1996) 403-405 Provided corrections and examined censoring
Pace R Kelley and OW Gilley ldquoUsing the Spatial Configuration of the Data to Improve Estima-tionrdquo Journal of the Real Estate Finance and Economics 14 (1997) 333-340
Examples
data(boston)
boxplotmap Interactive boxplot and map
Description
The function lsquoboxplotmaprsquo draws a boxplot of the given variable var and a map with site of coor-dinates (long lat)
Usage
boxplotmap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
14 boxplotmap
listnomvar list of character of size p with names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar name of variable var
axis 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
There is an interactivity only in one direction the sites selected by interquartile on the boxplot arerepresented on the map in red
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
carte 15
Examples
donnees oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)boxplotmap(oldcol$X oldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CP==1)axis=TRUElablong=Xlablat=Y)
donnees bostondata(boston)boxplotmap(boston$xboston$yboston$CRIMlistvar=bostonlistnomvar=names(boston)criteria=(boston$CHAS==1))
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)boxplotmap(eire$V1eire$V2eire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Taux deacutevolution de la population de 1921 agrave1962)
carte Drawing a map
Description
The function lsquocartersquo draws a map with sites of coordinates (long lat) and represents sites whichhave been selected (obs) in red if symbol=0 or with star if symbol=1 This function is called bymost of the functions of GeoXp (this is not an interactive function)
Usage
carte(long lat obscriteria=NULLbuble=FALSEcbuble=NULLnointer=FALSE carte=NULLnocart=FALSE label=symbol=0col=0 lablong= lablat= method= W=NULL couleurs=classe obsqlegmap=NULLlegends=list(FALSEFALSE)labmod=axis=FALSE)
Arguments
long a vector x of size n
lat a vector y of size n
obs a boolean vector of size n with TRUE on selected sites
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
16 carte
buble a boolean with TRUE for drawing bubbles FALSE otherwise
cbuble vector of size n with size of each site depending on variable with which bubblesare constructed
nointer a boolean with TRUE for drawing sites selected by criteria FALSE otherwise
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
nocart a boolean with TRUE for drawing spatial contours FALSE otherwise
label vector of character of size n with name of each site
col 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points are inred if 1 selected points are stars
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
method Specification for some graphics such as lsquoNeighbourplot1rsquo lsquoNeighbourplot2rsquolsquoClusterrsquo lsquoAngleplotrsquo lsquoVariocloudrsquo
W neighbourhood matrix of size ntimes n necessary when method=lsquoNeighbourplotrsquo
couleurs Possibility to change colors (only for admin)
classe vector of n whith class necessary when method=lsquoClusterrsquo
obsq vector of size n with number of quadrant to which the site belongs necessarywhen method=lsquoQuadrantrsquo
legmap a list of (numericnumericnumericnumericnumericnumericcharacter) with thesizes and the corresponding values of the 3 bubbles represented in the legend andthe variable name of variable choosed
clustermap 17
legends a list of c(booleanbooleanc(numericnumeric)c(numericnumeric)) with TRUEfor drawing legends of bubbles (1st argument) or factors (2nd argument) and thecoordinates of the location of the upper left corner of the legend box
labmod Name of factors
axis a boolean with True for drawing axes on the map
Details
For factors possibility to represent sites with different colors for each level Others options permitto represent with a croice some sites with special lsquocriteriarsquo with lsquobubblersquo according to a variablegiven a spatial contours with lsquocartersquo names of sites with lsquolabelrsquo or a representation in flowerPossibility to draw a legend giving the sizes of bubbles and colors of levels
Value
No values only drawing of a map
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
clustermap Classification of dataset using kmeansr or hclustr and representationof clusters on a map
Description
The function lsquoclustermaprsquo performs a classification of the sites from the variables included indataset and computes a bar plot of the clusters calculated Classification methods comes fromhclustR (hierarchical cluster analysis) and kmeansR (k-means clustering) and number of class ischosen with clustnum
Usage
clustermap(longlatdatasetclustnummethod=kmeanstype=NULLcenters=NULLscale=FALSElistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabvar=Clusterlabel=symbol=0color=1labmod=axis=FALSElablong= lablat=)
18 clustermap
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix of variables of numeric values
clustnum Number of clusters
method two methos lsquokmeansrsquo by default or lsquohclustrsquo
type If method=lsquohclustrdquo type=ldquocompleterdquo by default (the possibilities are given inhelp(hclust) as lsquowardrsquo lsquosinglersquo etc) If method=lsquokmeansrsquo type=Hartigan-Wong by default (the possibilities are given in help(kmeans) as lsquoForgyrsquo etc)
centers If method=rsquokmeansrsquo user can give a matrix with initial cluster centers
scale If scale=TRUE the dataset is reducted
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
labvar name of variable var
label vector of size n with names of each site
color 0 or 1 (by default) choice of representation of selected points If 0 sites arerepresented in blue if 1 sites are represented with different colors for eachcluster
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labmod names of Clusters
clustermap 19
axis 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 two windows are interactive the sites selected by a bar chosen on the bar plot are representedon the map in red and the values of sites selected on the map by lsquopointsrsquo or lsquopolygonrsquo are representedin red on the bar plot The dendogram is also drawn for rsquohclustrsquo method In option possibility tochoose the classification method
Value
A vector of boolean of size n (TRUE if the site was in the last selection) and a vector of size nwhith the number of cluster for each site
Note
To use the functions hclustr and kmeansr we take many arguments by default If the user wouldlike to modify these arguments he should call these functions first and then use the functionbarmapr to visualize the calculated clusters
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Murtagh F (1985) ldquoMultidimensional Clustering Algorithmsrdquo
Hartigan J A and Wong M A (1979) A K-means clustering algorithm Applied Statistics 28100-108
See Also
barmap pcamap
Examples
donneacutees oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)obslt-clustermap(oldcol$X oldcol$Yoldcol[712]3listvar=oldcollistnomvar=names(oldcol)carte=contoursOLDcriteria=(oldcol$CP==1))
20 dbledensitymap
data avifaunelibrary(ade4)data(mafragh)dlt-distchi2(mafragh$flo)
obslt-clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4method=hclusttype=wardlistvar=mafragh$partitionlistnomvar=class)
claslt-obs$vectclasselt-by(dclasmean)glt-rbind(e[1]$1e[2]$2e[3]$3e[4]$4)
clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4centers=glistvar=mafragh$partitionlistnomvar=class)
dbledensitymap Double Kernel density estimates and map
Description
The function lsquodbledensitymaprsquo plots two kernel density estimates from var1 and var2 computedwith lsquobkdeRrsquo and a map with sites of coordinates (long lat) Each site is associated to a value ofvar1 and var2 and the two windows are interactive
Usage
dbledensitymap(long lat var1 var2kernel=triweight listvar = NULLlistnomvar = NULL carte = NULL criteria = NULL label = symbol = 0 color = 1 labvar = c(var1 var2) axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
dbledensitymap 21
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar list of character with names of variables var1 and var2
axis 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 user can choose an interval on the density curve by mouse clicking on the lower and upperboundaries of the interval or by giving directly these values The selected sites are then representedon the map in red A selection by lsquopointsrsquo or lsquopolygonrsquo on the map results in the drawing of thedensity of the corresponding sub-distribution on the density plot Finally the user can modify thebandwith parameter with a cursor in the tcltk window (parameter α) α is the smoothing parameterfor the kernel smooth it represents the mean percentage of sample points involved in the localaveraging (example α = 20 means that on average ntimes 02 points are in any interval of length 2hwhere h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
22 dblehistomap
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dbledensitymap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785))) listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-dbledensitymap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)dbledensitymap(eire$V1eire$V2eire$Aeire$townslabvar=c(Taux dindividus au groupe sanguin ASurface urbaine)carte=eirecontourskernel=normallistvar=eirelistnomvar=names(eire))
dblehistomap Double Interactive Histogram and map
Description
The function lsquodblehistomaprsquo draws two histograms of the given variables var1 and var2 and a mapwith sites of coordinates (long lat) Each site is associated to a value of var1 and var2 and thereis interactivity between the two windows created
dblehistomap 23
Usage
dblehistomap(long lat var1 var2 listvar = NULL listnomvar = NULLnbcol1 = 10 nbcol2 = 10 carte = NULL criteria = NULLsymbol = 0 color = 1 labvar = c( ) label = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
nbcol1 number of cells for histogram 1 (10 by default)
nbcol2 number of cells for histogram 2 (10 by default)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
24 densitymap
Details
The selection of sites by lsquopointsrsquo or lsquopolygonsrsquo on the map results in the drawing of the red his-tograms of the subdistributions corresponding to this subset of sites
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dblehistomap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785)))listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadblehistomap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
densitymap Kernel density estimates and map
Description
The function lsquodensitymaprsquo draws kernel density estimates of the variable var with rsquobkdeRrsquo anda map with sites of coordinate (long lat) Each site is associated to a value of var and there isinteractivity between the two windows
densitymap 25
Usage
densitymap(long lat varkernel=triweightlistvar=NULLlistnomvar=NULLcarte=NULL criteria=NULLlabel=symbol=0color=1 labvar=axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
labvar name of variable var
axis 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
26 densitymap
Details
The user can choose an interval on the density curve by mouse clicking on the graph on the extremi-ties of interval or by specifying directly values The sites selected by an interval are then representedon the map in red The selection of sites on the map by lsquopointsrsquo or lsquopolygonrsquo results in the draw-ing of the kernel densities of the subdistributions corresponding to this subset of sites Finally theuser can modify the bandwith parameter with a cursor in the tcltk window (parameter α) α is thesmoothing parameter for the kernel smooth it represents the mean percentage of sample pointsinvolved in the local averaging (example α = 20 means that on average ntimes 02 points are in anyinterval of length 2h where h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
library tcltk and KernSmooth data olcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)densitymap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadensitymap(colombuscontours$Xcolombuscontours$Ycolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)
distchi2 27
data(eirepolys)eirecontourslt-polylist2list(eirepolys)densitymap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
distchi2 It gives an euclidian distance matrix for factors using metric of χ2
Description
The function lsquodistchi2rsquo calculates an euclidian distance matrix for factors using metric of χ2
Usage
distchi2(mat)
Arguments
mat A matrix of factors given as numeric values
Details
The euclidian distance between two individuals i and k using the metric of χ2 is given by
d2χ2 =
n
p
sumj
p
mjsuml
δjlik
1nj
l
with n number of individuals p number of variables mj is the number of possibilities for variableY j nj
l is the number of individuals where l has been observed for Y j and δjlik = 1 if there is a
discordance between i and k for l and 0 otherwise It is not an interactive function
Value
It returns a dist object (see help(dist))
Author(s)
Laurent Thibault
References
Besse Philippe ldquoData mining 2 Modeacutelisation statistique et apprentissagerdquo Publication du LSPhttpwwwlspups-tlsefrBesse
See Also
clustermap
28 driftmap
driftmap Detection of an eventual trend
Description
The function lsquodriftmaprsquo creates a grid on the map and calculates the mean and median for each cellThe right plot (resp left plot) represents means and medians calculated by row (resp column)
Usage
driftmap(long lat var interpol = 1nuage = 0 carte = NULLlablong = lablat = labvar = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
interpol if 1 the mean and median calculated are linearly interpoled
nuage if 1 the individuals are also represented on the graphics
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
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
labvar name of variable lsquovarrsquo
Details
Possibility to change the number of cells in the grid with the tcltk window to interpolate the meansand medians calculated (by default) to work on a rotated map Notice that this is not an interactivefunction
Value
No values returned only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
eire 29
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmaprotation
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)driftmap(auckland$Eastingauckland$Northingauckland$Deaths197785interpol=0nuage=1lablong=Xlablat=Ylabvar=Deaths197785)
data afcondata(afcon)driftmap(afcon$xafcon$yafcon$totconinterpol=0nuage=1lablong=Xlablat=Ylabvar=Number of conflicts)
data meusedata(meuseall)data(meuseriv)driftmap(meuseall$xmeuseall$ymeuseall$coppernuage=1lablong=Xlablat=Ylabvar=Concentration de cuivre (en ppm))
eire Eire data sets
Description
The lsquoeirersquo data frame has 26 rows and 11 columns
Usage
data(eire)
Format
A data frame with 26 observations on the following 11 variables
V1 a vector x of size n
V2 a vector y of size n
A Percentage of sample with blood group A
towns Townsunit area
pale Beyond the Pale 0 within the Pale 1
size number of blood type samples
ROADACC arterial road network accessibility in 1961
30 eirepolys
OWNCONS percentage in value terms of gross agricultural output of each county consumed by itself
POPCHG 1961 population as percentage of 1926
RETSALE value of retail sales c000
INCOME total personal income c000
Details
This data provides from spdep package
Source
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
Examples
data(eire)
eirepolys Spatial polygonal contours of eire dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of eiredataset
Usage
data(eirepolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or rsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibility torepesent spatial polygonal contours as a backgroud map Thatrsquos why we create functions lsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of the polygons
Source
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
findneighbors 31
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
findneighbors Research of the m nearest neighbors for sites
Description
The function lsquofindneighborsrsquo gives for each site of coordinates (xc yc) the m nearest neighbors inthe set of sites
Usage
findneighbors(xc yc m)
Arguments
xc a numerical vector x of size n
yc a numerical vector y of size n
m number of nearest neighbors
Details
In case of ties the nearest neighbor is randomly chosen among the ties This function is called inmakeneighborswr
Value
A matrix of size ntimes n containing 1 on position (i j) if j is m-nearest neighbour to i
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakedistanceWmakeneighborsw
32 genpca
Examples
data(auckland)Wlt-findneighbors(auckland$Eastingauckland$Northing1)
genpca Generalized Principal Component Analysis (PCA)
Description
The function lsquogenpcarsquo computes a generalized Principal Component Analysis (PCA) It calculatesthe principal components the coordinates of the variables and in these principals components axesand the inertia of these principal components
Usage
genpca(data w=rep(1nrow(data)length=nrow(data)) m=diag(1ncol(data)ncol(data))center=TRUE reduc=TRUE)
Arguments
data matrix ntimes p
w vector of size n of weight (by default weight = t(1n 1n))
m matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centered PCA (by default center=TRUE)
reduc boolean if TRUE reduced PCA (by default reduce=TRUE)
Details
LetW = diag(w)
x = data = (xprime1 x
primen)prime
withxi = (x1
i xpi )
Let1n = (1 1)prime
with n rows and 1p = (1 1)prime
with p rows Normalization of weight
wi =wisumi wi
genpca 33
Vector of means x = (x1 xp)prime
withxj =
sumi
wixji
If center=Truexc = xminus 1nxprime
Standart deviation (σj)2 =
sumi
wi(xji )
2 minus (xj)2
Σ = diag((σ1)2 (σp)2)prime
If reduc=True xcr = xc times Σminus12
Variance-Covariance matrix
C = xprimecrWxcr
Cholesky decomposition M = LLprime where M=mLet
Cl = LCLprime
Let U and D as ClU = UD
with D = diag(λ1 λp)Let
V = LprimeU
Then Coordinates of individuals in the principals components basis
CC = xcrV
Coordinates of variables in principals components
V C = CV Dminus12
Inertia I = D1p
Value
Returns lsquoinertiarsquo vector of size p with percent of inertia of each component (corresponding to I)lsquocasecoordrsquo matrix ntimes p (corresponding to matrix CC) lsquovarcoordrsquo matrix ptimes p (corresponding tomatrix V C)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
34 gini
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermappcamap
gini Calculates a Gini Index
Description
The function lsquoginirsquo calculates the Gini Index associated to the variable lsquovarrsquo
Usage
gini(var)
Arguments
var a vector of numerical values of size n
Details
Let xk k = 1 K be the distinct values taken by V ar For each site Ginir returns two pairs offrequencies The pair (f g) where f represents
fk =1n
sumi
1(V ari = xk)
(n is the length of lsquovarrsquo) and g represents
gk =xk
xfk
The pair (FG) represents the corresponding cumulative frequenciesThe Gini Index is calculated as
IG =12x
Ksumi=1
Ksumj=1
|xi minus xj |
Value
(f F g G gini) where f F g and G are vectors of size K and gini a numeric value
Note
This function is used in ginimapR but it is not an interactive function
ginimap 35
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
ginimap
ginimap Lorentz curve and map
Description
The function lsquoginimaprsquo computes a Lorentz curve from rsquovarrsquo and calculates the Gini Index associ-ated to var
Usage
ginimap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
barmap 11
labvar name of variable var
labmod names of factors of var
axis 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 selection of a bar on the bar plot results in the corresponding sites coloured on the map with thecorresponding colour observed on the bar Reversely the selection of sites on the map by lsquopointsrsquoor lsquopolygonrsquo results in the drawing of the sub-barplot in red
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
Examples
data oldcoldata(oldcol)data(oldcolpolys)oldcolcontourslt-polylist2list(oldcolpolys)barmap(oldcol$X oldcol$Y oldcol$NSA listvar=oldcolcarte=oldcolcontourslistnomvar=names(oldcol)criteria=(oldcol$CP==1)axis=TRUElablong=Xlablat=Y)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)barmap(eire$V1eire$V2eire$palecarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
12 boston
boston Corrected Boston Housing Data
Description
The boston data frame has 506 rows and 20 columns It contains the Harrison and Rubinfeld(1978) data corrected for a few minor errors and augmented with the latitude and longitude of theobservations Gilley and Pace also point out that MEDEV is censored in that median values at orover USD 50000 are set to USD 50000
Usage
data(boston)
Format
A data frame with 506 observations on the following 22 variables
x a vector x of size n
y a vector y of size n
TOWN a factor with levels given by town names
TOWNNO a numeric vector corresponding to town
TRACT a numeric vector of tract ID numbers
LON a numeric vector of tract point longitudes in decimal degrees
LAT a numeric vector of tract point latitudes in decimal degrees
MEDV a numeric vector of median values of owner-occupied housing in USD 1000
CMEDV a numeric vector corrected median values of owner-occupied housing in USD 1000
CRIM a numeric vector of per capita crime
ZN a numeric vector of proportions of residential land zoned for lots over 25000 sq ft per town(constant for all Boston tracts)
INDUS a numeric vector of proportions of non-retail business acres per town (constant for allBoston tracts)
CHAS a factor with levels 1 if tract borders Charles River 0 otherwise
NOX a numeric vector of nitric oxides concentration (parts per 10 million) per town
RM a numeric vector of average numbers of rooms per dwelling
AGE a numeric vector of proportions of owner-occupied units built prior to 1940
DIS a numeric vector of weighted distances to five Boston employment centres
RAD a numeric vector of an index of accessibility to radial highways per town (constant for allBoston tracts)
TAX a numeric vector full-value proprty-tax rate per USD 10000 per town (constant for all Bostontracts)
PTRATIO a numeric vector of pupil-teacher ratios per town (constant for all Boston tracts)
B a numeric vector of 1000 lowast (Bk minus 063)2 where Bk is the proportion of blacks
LSTAT a numeric vector of percentage values of lower status population
boxplotmap 13
Details
This data provides from spdep package
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Harrison David and Daniel L Rubinfeld ldquoHedonic Housing Prices and the Demand for CleanAirrdquo Journal of Environmental Economics and Management Volume 5 (1978) 81-102 Originaldata
Gilley OW and R Kelley Pace ldquoOn the Harrison and Rubinfeld Datardquo Journal of EnvironmentalEconomics and Management 31 (1996) 403-405 Provided corrections and examined censoring
Pace R Kelley and OW Gilley ldquoUsing the Spatial Configuration of the Data to Improve Estima-tionrdquo Journal of the Real Estate Finance and Economics 14 (1997) 333-340
Examples
data(boston)
boxplotmap Interactive boxplot and map
Description
The function lsquoboxplotmaprsquo draws a boxplot of the given variable var and a map with site of coor-dinates (long lat)
Usage
boxplotmap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
14 boxplotmap
listnomvar list of character of size p with names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar name of variable var
axis 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
There is an interactivity only in one direction the sites selected by interquartile on the boxplot arerepresented on the map in red
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
carte 15
Examples
donnees oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)boxplotmap(oldcol$X oldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CP==1)axis=TRUElablong=Xlablat=Y)
donnees bostondata(boston)boxplotmap(boston$xboston$yboston$CRIMlistvar=bostonlistnomvar=names(boston)criteria=(boston$CHAS==1))
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)boxplotmap(eire$V1eire$V2eire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Taux deacutevolution de la population de 1921 agrave1962)
carte Drawing a map
Description
The function lsquocartersquo draws a map with sites of coordinates (long lat) and represents sites whichhave been selected (obs) in red if symbol=0 or with star if symbol=1 This function is called bymost of the functions of GeoXp (this is not an interactive function)
Usage
carte(long lat obscriteria=NULLbuble=FALSEcbuble=NULLnointer=FALSE carte=NULLnocart=FALSE label=symbol=0col=0 lablong= lablat= method= W=NULL couleurs=classe obsqlegmap=NULLlegends=list(FALSEFALSE)labmod=axis=FALSE)
Arguments
long a vector x of size n
lat a vector y of size n
obs a boolean vector of size n with TRUE on selected sites
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
16 carte
buble a boolean with TRUE for drawing bubbles FALSE otherwise
cbuble vector of size n with size of each site depending on variable with which bubblesare constructed
nointer a boolean with TRUE for drawing sites selected by criteria FALSE otherwise
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
nocart a boolean with TRUE for drawing spatial contours FALSE otherwise
label vector of character of size n with name of each site
col 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points are inred if 1 selected points are stars
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
method Specification for some graphics such as lsquoNeighbourplot1rsquo lsquoNeighbourplot2rsquolsquoClusterrsquo lsquoAngleplotrsquo lsquoVariocloudrsquo
W neighbourhood matrix of size ntimes n necessary when method=lsquoNeighbourplotrsquo
couleurs Possibility to change colors (only for admin)
classe vector of n whith class necessary when method=lsquoClusterrsquo
obsq vector of size n with number of quadrant to which the site belongs necessarywhen method=lsquoQuadrantrsquo
legmap a list of (numericnumericnumericnumericnumericnumericcharacter) with thesizes and the corresponding values of the 3 bubbles represented in the legend andthe variable name of variable choosed
clustermap 17
legends a list of c(booleanbooleanc(numericnumeric)c(numericnumeric)) with TRUEfor drawing legends of bubbles (1st argument) or factors (2nd argument) and thecoordinates of the location of the upper left corner of the legend box
labmod Name of factors
axis a boolean with True for drawing axes on the map
Details
For factors possibility to represent sites with different colors for each level Others options permitto represent with a croice some sites with special lsquocriteriarsquo with lsquobubblersquo according to a variablegiven a spatial contours with lsquocartersquo names of sites with lsquolabelrsquo or a representation in flowerPossibility to draw a legend giving the sizes of bubbles and colors of levels
Value
No values only drawing of a map
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
clustermap Classification of dataset using kmeansr or hclustr and representationof clusters on a map
Description
The function lsquoclustermaprsquo performs a classification of the sites from the variables included indataset and computes a bar plot of the clusters calculated Classification methods comes fromhclustR (hierarchical cluster analysis) and kmeansR (k-means clustering) and number of class ischosen with clustnum
Usage
clustermap(longlatdatasetclustnummethod=kmeanstype=NULLcenters=NULLscale=FALSElistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabvar=Clusterlabel=symbol=0color=1labmod=axis=FALSElablong= lablat=)
18 clustermap
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix of variables of numeric values
clustnum Number of clusters
method two methos lsquokmeansrsquo by default or lsquohclustrsquo
type If method=lsquohclustrdquo type=ldquocompleterdquo by default (the possibilities are given inhelp(hclust) as lsquowardrsquo lsquosinglersquo etc) If method=lsquokmeansrsquo type=Hartigan-Wong by default (the possibilities are given in help(kmeans) as lsquoForgyrsquo etc)
centers If method=rsquokmeansrsquo user can give a matrix with initial cluster centers
scale If scale=TRUE the dataset is reducted
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
labvar name of variable var
label vector of size n with names of each site
color 0 or 1 (by default) choice of representation of selected points If 0 sites arerepresented in blue if 1 sites are represented with different colors for eachcluster
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labmod names of Clusters
clustermap 19
axis 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 two windows are interactive the sites selected by a bar chosen on the bar plot are representedon the map in red and the values of sites selected on the map by lsquopointsrsquo or lsquopolygonrsquo are representedin red on the bar plot The dendogram is also drawn for rsquohclustrsquo method In option possibility tochoose the classification method
Value
A vector of boolean of size n (TRUE if the site was in the last selection) and a vector of size nwhith the number of cluster for each site
Note
To use the functions hclustr and kmeansr we take many arguments by default If the user wouldlike to modify these arguments he should call these functions first and then use the functionbarmapr to visualize the calculated clusters
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Murtagh F (1985) ldquoMultidimensional Clustering Algorithmsrdquo
Hartigan J A and Wong M A (1979) A K-means clustering algorithm Applied Statistics 28100-108
See Also
barmap pcamap
Examples
donneacutees oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)obslt-clustermap(oldcol$X oldcol$Yoldcol[712]3listvar=oldcollistnomvar=names(oldcol)carte=contoursOLDcriteria=(oldcol$CP==1))
20 dbledensitymap
data avifaunelibrary(ade4)data(mafragh)dlt-distchi2(mafragh$flo)
obslt-clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4method=hclusttype=wardlistvar=mafragh$partitionlistnomvar=class)
claslt-obs$vectclasselt-by(dclasmean)glt-rbind(e[1]$1e[2]$2e[3]$3e[4]$4)
clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4centers=glistvar=mafragh$partitionlistnomvar=class)
dbledensitymap Double Kernel density estimates and map
Description
The function lsquodbledensitymaprsquo plots two kernel density estimates from var1 and var2 computedwith lsquobkdeRrsquo and a map with sites of coordinates (long lat) Each site is associated to a value ofvar1 and var2 and the two windows are interactive
Usage
dbledensitymap(long lat var1 var2kernel=triweight listvar = NULLlistnomvar = NULL carte = NULL criteria = NULL label = symbol = 0 color = 1 labvar = c(var1 var2) axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
dbledensitymap 21
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar list of character with names of variables var1 and var2
axis 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 user can choose an interval on the density curve by mouse clicking on the lower and upperboundaries of the interval or by giving directly these values The selected sites are then representedon the map in red A selection by lsquopointsrsquo or lsquopolygonrsquo on the map results in the drawing of thedensity of the corresponding sub-distribution on the density plot Finally the user can modify thebandwith parameter with a cursor in the tcltk window (parameter α) α is the smoothing parameterfor the kernel smooth it represents the mean percentage of sample points involved in the localaveraging (example α = 20 means that on average ntimes 02 points are in any interval of length 2hwhere h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
22 dblehistomap
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dbledensitymap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785))) listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-dbledensitymap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)dbledensitymap(eire$V1eire$V2eire$Aeire$townslabvar=c(Taux dindividus au groupe sanguin ASurface urbaine)carte=eirecontourskernel=normallistvar=eirelistnomvar=names(eire))
dblehistomap Double Interactive Histogram and map
Description
The function lsquodblehistomaprsquo draws two histograms of the given variables var1 and var2 and a mapwith sites of coordinates (long lat) Each site is associated to a value of var1 and var2 and thereis interactivity between the two windows created
dblehistomap 23
Usage
dblehistomap(long lat var1 var2 listvar = NULL listnomvar = NULLnbcol1 = 10 nbcol2 = 10 carte = NULL criteria = NULLsymbol = 0 color = 1 labvar = c( ) label = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
nbcol1 number of cells for histogram 1 (10 by default)
nbcol2 number of cells for histogram 2 (10 by default)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
24 densitymap
Details
The selection of sites by lsquopointsrsquo or lsquopolygonsrsquo on the map results in the drawing of the red his-tograms of the subdistributions corresponding to this subset of sites
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dblehistomap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785)))listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadblehistomap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
densitymap Kernel density estimates and map
Description
The function lsquodensitymaprsquo draws kernel density estimates of the variable var with rsquobkdeRrsquo anda map with sites of coordinate (long lat) Each site is associated to a value of var and there isinteractivity between the two windows
densitymap 25
Usage
densitymap(long lat varkernel=triweightlistvar=NULLlistnomvar=NULLcarte=NULL criteria=NULLlabel=symbol=0color=1 labvar=axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
labvar name of variable var
axis 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
26 densitymap
Details
The user can choose an interval on the density curve by mouse clicking on the graph on the extremi-ties of interval or by specifying directly values The sites selected by an interval are then representedon the map in red The selection of sites on the map by lsquopointsrsquo or lsquopolygonrsquo results in the draw-ing of the kernel densities of the subdistributions corresponding to this subset of sites Finally theuser can modify the bandwith parameter with a cursor in the tcltk window (parameter α) α is thesmoothing parameter for the kernel smooth it represents the mean percentage of sample pointsinvolved in the local averaging (example α = 20 means that on average ntimes 02 points are in anyinterval of length 2h where h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
library tcltk and KernSmooth data olcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)densitymap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadensitymap(colombuscontours$Xcolombuscontours$Ycolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)
distchi2 27
data(eirepolys)eirecontourslt-polylist2list(eirepolys)densitymap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
distchi2 It gives an euclidian distance matrix for factors using metric of χ2
Description
The function lsquodistchi2rsquo calculates an euclidian distance matrix for factors using metric of χ2
Usage
distchi2(mat)
Arguments
mat A matrix of factors given as numeric values
Details
The euclidian distance between two individuals i and k using the metric of χ2 is given by
d2χ2 =
n
p
sumj
p
mjsuml
δjlik
1nj
l
with n number of individuals p number of variables mj is the number of possibilities for variableY j nj
l is the number of individuals where l has been observed for Y j and δjlik = 1 if there is a
discordance between i and k for l and 0 otherwise It is not an interactive function
Value
It returns a dist object (see help(dist))
Author(s)
Laurent Thibault
References
Besse Philippe ldquoData mining 2 Modeacutelisation statistique et apprentissagerdquo Publication du LSPhttpwwwlspups-tlsefrBesse
See Also
clustermap
28 driftmap
driftmap Detection of an eventual trend
Description
The function lsquodriftmaprsquo creates a grid on the map and calculates the mean and median for each cellThe right plot (resp left plot) represents means and medians calculated by row (resp column)
Usage
driftmap(long lat var interpol = 1nuage = 0 carte = NULLlablong = lablat = labvar = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
interpol if 1 the mean and median calculated are linearly interpoled
nuage if 1 the individuals are also represented on the graphics
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
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
labvar name of variable lsquovarrsquo
Details
Possibility to change the number of cells in the grid with the tcltk window to interpolate the meansand medians calculated (by default) to work on a rotated map Notice that this is not an interactivefunction
Value
No values returned only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
eire 29
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmaprotation
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)driftmap(auckland$Eastingauckland$Northingauckland$Deaths197785interpol=0nuage=1lablong=Xlablat=Ylabvar=Deaths197785)
data afcondata(afcon)driftmap(afcon$xafcon$yafcon$totconinterpol=0nuage=1lablong=Xlablat=Ylabvar=Number of conflicts)
data meusedata(meuseall)data(meuseriv)driftmap(meuseall$xmeuseall$ymeuseall$coppernuage=1lablong=Xlablat=Ylabvar=Concentration de cuivre (en ppm))
eire Eire data sets
Description
The lsquoeirersquo data frame has 26 rows and 11 columns
Usage
data(eire)
Format
A data frame with 26 observations on the following 11 variables
V1 a vector x of size n
V2 a vector y of size n
A Percentage of sample with blood group A
towns Townsunit area
pale Beyond the Pale 0 within the Pale 1
size number of blood type samples
ROADACC arterial road network accessibility in 1961
30 eirepolys
OWNCONS percentage in value terms of gross agricultural output of each county consumed by itself
POPCHG 1961 population as percentage of 1926
RETSALE value of retail sales c000
INCOME total personal income c000
Details
This data provides from spdep package
Source
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
Examples
data(eire)
eirepolys Spatial polygonal contours of eire dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of eiredataset
Usage
data(eirepolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or rsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibility torepesent spatial polygonal contours as a backgroud map Thatrsquos why we create functions lsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of the polygons
Source
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
findneighbors 31
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
findneighbors Research of the m nearest neighbors for sites
Description
The function lsquofindneighborsrsquo gives for each site of coordinates (xc yc) the m nearest neighbors inthe set of sites
Usage
findneighbors(xc yc m)
Arguments
xc a numerical vector x of size n
yc a numerical vector y of size n
m number of nearest neighbors
Details
In case of ties the nearest neighbor is randomly chosen among the ties This function is called inmakeneighborswr
Value
A matrix of size ntimes n containing 1 on position (i j) if j is m-nearest neighbour to i
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakedistanceWmakeneighborsw
32 genpca
Examples
data(auckland)Wlt-findneighbors(auckland$Eastingauckland$Northing1)
genpca Generalized Principal Component Analysis (PCA)
Description
The function lsquogenpcarsquo computes a generalized Principal Component Analysis (PCA) It calculatesthe principal components the coordinates of the variables and in these principals components axesand the inertia of these principal components
Usage
genpca(data w=rep(1nrow(data)length=nrow(data)) m=diag(1ncol(data)ncol(data))center=TRUE reduc=TRUE)
Arguments
data matrix ntimes p
w vector of size n of weight (by default weight = t(1n 1n))
m matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centered PCA (by default center=TRUE)
reduc boolean if TRUE reduced PCA (by default reduce=TRUE)
Details
LetW = diag(w)
x = data = (xprime1 x
primen)prime
withxi = (x1
i xpi )
Let1n = (1 1)prime
with n rows and 1p = (1 1)prime
with p rows Normalization of weight
wi =wisumi wi
genpca 33
Vector of means x = (x1 xp)prime
withxj =
sumi
wixji
If center=Truexc = xminus 1nxprime
Standart deviation (σj)2 =
sumi
wi(xji )
2 minus (xj)2
Σ = diag((σ1)2 (σp)2)prime
If reduc=True xcr = xc times Σminus12
Variance-Covariance matrix
C = xprimecrWxcr
Cholesky decomposition M = LLprime where M=mLet
Cl = LCLprime
Let U and D as ClU = UD
with D = diag(λ1 λp)Let
V = LprimeU
Then Coordinates of individuals in the principals components basis
CC = xcrV
Coordinates of variables in principals components
V C = CV Dminus12
Inertia I = D1p
Value
Returns lsquoinertiarsquo vector of size p with percent of inertia of each component (corresponding to I)lsquocasecoordrsquo matrix ntimes p (corresponding to matrix CC) lsquovarcoordrsquo matrix ptimes p (corresponding tomatrix V C)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
34 gini
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermappcamap
gini Calculates a Gini Index
Description
The function lsquoginirsquo calculates the Gini Index associated to the variable lsquovarrsquo
Usage
gini(var)
Arguments
var a vector of numerical values of size n
Details
Let xk k = 1 K be the distinct values taken by V ar For each site Ginir returns two pairs offrequencies The pair (f g) where f represents
fk =1n
sumi
1(V ari = xk)
(n is the length of lsquovarrsquo) and g represents
gk =xk
xfk
The pair (FG) represents the corresponding cumulative frequenciesThe Gini Index is calculated as
IG =12x
Ksumi=1
Ksumj=1
|xi minus xj |
Value
(f F g G gini) where f F g and G are vectors of size K and gini a numeric value
Note
This function is used in ginimapR but it is not an interactive function
ginimap 35
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
ginimap
ginimap Lorentz curve and map
Description
The function lsquoginimaprsquo computes a Lorentz curve from rsquovarrsquo and calculates the Gini Index associ-ated to var
Usage
ginimap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
12 boston
boston Corrected Boston Housing Data
Description
The boston data frame has 506 rows and 20 columns It contains the Harrison and Rubinfeld(1978) data corrected for a few minor errors and augmented with the latitude and longitude of theobservations Gilley and Pace also point out that MEDEV is censored in that median values at orover USD 50000 are set to USD 50000
Usage
data(boston)
Format
A data frame with 506 observations on the following 22 variables
x a vector x of size n
y a vector y of size n
TOWN a factor with levels given by town names
TOWNNO a numeric vector corresponding to town
TRACT a numeric vector of tract ID numbers
LON a numeric vector of tract point longitudes in decimal degrees
LAT a numeric vector of tract point latitudes in decimal degrees
MEDV a numeric vector of median values of owner-occupied housing in USD 1000
CMEDV a numeric vector corrected median values of owner-occupied housing in USD 1000
CRIM a numeric vector of per capita crime
ZN a numeric vector of proportions of residential land zoned for lots over 25000 sq ft per town(constant for all Boston tracts)
INDUS a numeric vector of proportions of non-retail business acres per town (constant for allBoston tracts)
CHAS a factor with levels 1 if tract borders Charles River 0 otherwise
NOX a numeric vector of nitric oxides concentration (parts per 10 million) per town
RM a numeric vector of average numbers of rooms per dwelling
AGE a numeric vector of proportions of owner-occupied units built prior to 1940
DIS a numeric vector of weighted distances to five Boston employment centres
RAD a numeric vector of an index of accessibility to radial highways per town (constant for allBoston tracts)
TAX a numeric vector full-value proprty-tax rate per USD 10000 per town (constant for all Bostontracts)
PTRATIO a numeric vector of pupil-teacher ratios per town (constant for all Boston tracts)
B a numeric vector of 1000 lowast (Bk minus 063)2 where Bk is the proportion of blacks
LSTAT a numeric vector of percentage values of lower status population
boxplotmap 13
Details
This data provides from spdep package
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Harrison David and Daniel L Rubinfeld ldquoHedonic Housing Prices and the Demand for CleanAirrdquo Journal of Environmental Economics and Management Volume 5 (1978) 81-102 Originaldata
Gilley OW and R Kelley Pace ldquoOn the Harrison and Rubinfeld Datardquo Journal of EnvironmentalEconomics and Management 31 (1996) 403-405 Provided corrections and examined censoring
Pace R Kelley and OW Gilley ldquoUsing the Spatial Configuration of the Data to Improve Estima-tionrdquo Journal of the Real Estate Finance and Economics 14 (1997) 333-340
Examples
data(boston)
boxplotmap Interactive boxplot and map
Description
The function lsquoboxplotmaprsquo draws a boxplot of the given variable var and a map with site of coor-dinates (long lat)
Usage
boxplotmap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
14 boxplotmap
listnomvar list of character of size p with names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar name of variable var
axis 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
There is an interactivity only in one direction the sites selected by interquartile on the boxplot arerepresented on the map in red
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
carte 15
Examples
donnees oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)boxplotmap(oldcol$X oldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CP==1)axis=TRUElablong=Xlablat=Y)
donnees bostondata(boston)boxplotmap(boston$xboston$yboston$CRIMlistvar=bostonlistnomvar=names(boston)criteria=(boston$CHAS==1))
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)boxplotmap(eire$V1eire$V2eire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Taux deacutevolution de la population de 1921 agrave1962)
carte Drawing a map
Description
The function lsquocartersquo draws a map with sites of coordinates (long lat) and represents sites whichhave been selected (obs) in red if symbol=0 or with star if symbol=1 This function is called bymost of the functions of GeoXp (this is not an interactive function)
Usage
carte(long lat obscriteria=NULLbuble=FALSEcbuble=NULLnointer=FALSE carte=NULLnocart=FALSE label=symbol=0col=0 lablong= lablat= method= W=NULL couleurs=classe obsqlegmap=NULLlegends=list(FALSEFALSE)labmod=axis=FALSE)
Arguments
long a vector x of size n
lat a vector y of size n
obs a boolean vector of size n with TRUE on selected sites
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
16 carte
buble a boolean with TRUE for drawing bubbles FALSE otherwise
cbuble vector of size n with size of each site depending on variable with which bubblesare constructed
nointer a boolean with TRUE for drawing sites selected by criteria FALSE otherwise
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
nocart a boolean with TRUE for drawing spatial contours FALSE otherwise
label vector of character of size n with name of each site
col 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points are inred if 1 selected points are stars
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
method Specification for some graphics such as lsquoNeighbourplot1rsquo lsquoNeighbourplot2rsquolsquoClusterrsquo lsquoAngleplotrsquo lsquoVariocloudrsquo
W neighbourhood matrix of size ntimes n necessary when method=lsquoNeighbourplotrsquo
couleurs Possibility to change colors (only for admin)
classe vector of n whith class necessary when method=lsquoClusterrsquo
obsq vector of size n with number of quadrant to which the site belongs necessarywhen method=lsquoQuadrantrsquo
legmap a list of (numericnumericnumericnumericnumericnumericcharacter) with thesizes and the corresponding values of the 3 bubbles represented in the legend andthe variable name of variable choosed
clustermap 17
legends a list of c(booleanbooleanc(numericnumeric)c(numericnumeric)) with TRUEfor drawing legends of bubbles (1st argument) or factors (2nd argument) and thecoordinates of the location of the upper left corner of the legend box
labmod Name of factors
axis a boolean with True for drawing axes on the map
Details
For factors possibility to represent sites with different colors for each level Others options permitto represent with a croice some sites with special lsquocriteriarsquo with lsquobubblersquo according to a variablegiven a spatial contours with lsquocartersquo names of sites with lsquolabelrsquo or a representation in flowerPossibility to draw a legend giving the sizes of bubbles and colors of levels
Value
No values only drawing of a map
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
clustermap Classification of dataset using kmeansr or hclustr and representationof clusters on a map
Description
The function lsquoclustermaprsquo performs a classification of the sites from the variables included indataset and computes a bar plot of the clusters calculated Classification methods comes fromhclustR (hierarchical cluster analysis) and kmeansR (k-means clustering) and number of class ischosen with clustnum
Usage
clustermap(longlatdatasetclustnummethod=kmeanstype=NULLcenters=NULLscale=FALSElistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabvar=Clusterlabel=symbol=0color=1labmod=axis=FALSElablong= lablat=)
18 clustermap
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix of variables of numeric values
clustnum Number of clusters
method two methos lsquokmeansrsquo by default or lsquohclustrsquo
type If method=lsquohclustrdquo type=ldquocompleterdquo by default (the possibilities are given inhelp(hclust) as lsquowardrsquo lsquosinglersquo etc) If method=lsquokmeansrsquo type=Hartigan-Wong by default (the possibilities are given in help(kmeans) as lsquoForgyrsquo etc)
centers If method=rsquokmeansrsquo user can give a matrix with initial cluster centers
scale If scale=TRUE the dataset is reducted
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
labvar name of variable var
label vector of size n with names of each site
color 0 or 1 (by default) choice of representation of selected points If 0 sites arerepresented in blue if 1 sites are represented with different colors for eachcluster
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labmod names of Clusters
clustermap 19
axis 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 two windows are interactive the sites selected by a bar chosen on the bar plot are representedon the map in red and the values of sites selected on the map by lsquopointsrsquo or lsquopolygonrsquo are representedin red on the bar plot The dendogram is also drawn for rsquohclustrsquo method In option possibility tochoose the classification method
Value
A vector of boolean of size n (TRUE if the site was in the last selection) and a vector of size nwhith the number of cluster for each site
Note
To use the functions hclustr and kmeansr we take many arguments by default If the user wouldlike to modify these arguments he should call these functions first and then use the functionbarmapr to visualize the calculated clusters
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Murtagh F (1985) ldquoMultidimensional Clustering Algorithmsrdquo
Hartigan J A and Wong M A (1979) A K-means clustering algorithm Applied Statistics 28100-108
See Also
barmap pcamap
Examples
donneacutees oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)obslt-clustermap(oldcol$X oldcol$Yoldcol[712]3listvar=oldcollistnomvar=names(oldcol)carte=contoursOLDcriteria=(oldcol$CP==1))
20 dbledensitymap
data avifaunelibrary(ade4)data(mafragh)dlt-distchi2(mafragh$flo)
obslt-clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4method=hclusttype=wardlistvar=mafragh$partitionlistnomvar=class)
claslt-obs$vectclasselt-by(dclasmean)glt-rbind(e[1]$1e[2]$2e[3]$3e[4]$4)
clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4centers=glistvar=mafragh$partitionlistnomvar=class)
dbledensitymap Double Kernel density estimates and map
Description
The function lsquodbledensitymaprsquo plots two kernel density estimates from var1 and var2 computedwith lsquobkdeRrsquo and a map with sites of coordinates (long lat) Each site is associated to a value ofvar1 and var2 and the two windows are interactive
Usage
dbledensitymap(long lat var1 var2kernel=triweight listvar = NULLlistnomvar = NULL carte = NULL criteria = NULL label = symbol = 0 color = 1 labvar = c(var1 var2) axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
dbledensitymap 21
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar list of character with names of variables var1 and var2
axis 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 user can choose an interval on the density curve by mouse clicking on the lower and upperboundaries of the interval or by giving directly these values The selected sites are then representedon the map in red A selection by lsquopointsrsquo or lsquopolygonrsquo on the map results in the drawing of thedensity of the corresponding sub-distribution on the density plot Finally the user can modify thebandwith parameter with a cursor in the tcltk window (parameter α) α is the smoothing parameterfor the kernel smooth it represents the mean percentage of sample points involved in the localaveraging (example α = 20 means that on average ntimes 02 points are in any interval of length 2hwhere h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
22 dblehistomap
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dbledensitymap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785))) listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-dbledensitymap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)dbledensitymap(eire$V1eire$V2eire$Aeire$townslabvar=c(Taux dindividus au groupe sanguin ASurface urbaine)carte=eirecontourskernel=normallistvar=eirelistnomvar=names(eire))
dblehistomap Double Interactive Histogram and map
Description
The function lsquodblehistomaprsquo draws two histograms of the given variables var1 and var2 and a mapwith sites of coordinates (long lat) Each site is associated to a value of var1 and var2 and thereis interactivity between the two windows created
dblehistomap 23
Usage
dblehistomap(long lat var1 var2 listvar = NULL listnomvar = NULLnbcol1 = 10 nbcol2 = 10 carte = NULL criteria = NULLsymbol = 0 color = 1 labvar = c( ) label = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
nbcol1 number of cells for histogram 1 (10 by default)
nbcol2 number of cells for histogram 2 (10 by default)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
24 densitymap
Details
The selection of sites by lsquopointsrsquo or lsquopolygonsrsquo on the map results in the drawing of the red his-tograms of the subdistributions corresponding to this subset of sites
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dblehistomap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785)))listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadblehistomap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
densitymap Kernel density estimates and map
Description
The function lsquodensitymaprsquo draws kernel density estimates of the variable var with rsquobkdeRrsquo anda map with sites of coordinate (long lat) Each site is associated to a value of var and there isinteractivity between the two windows
densitymap 25
Usage
densitymap(long lat varkernel=triweightlistvar=NULLlistnomvar=NULLcarte=NULL criteria=NULLlabel=symbol=0color=1 labvar=axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
labvar name of variable var
axis 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
26 densitymap
Details
The user can choose an interval on the density curve by mouse clicking on the graph on the extremi-ties of interval or by specifying directly values The sites selected by an interval are then representedon the map in red The selection of sites on the map by lsquopointsrsquo or lsquopolygonrsquo results in the draw-ing of the kernel densities of the subdistributions corresponding to this subset of sites Finally theuser can modify the bandwith parameter with a cursor in the tcltk window (parameter α) α is thesmoothing parameter for the kernel smooth it represents the mean percentage of sample pointsinvolved in the local averaging (example α = 20 means that on average ntimes 02 points are in anyinterval of length 2h where h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
library tcltk and KernSmooth data olcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)densitymap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadensitymap(colombuscontours$Xcolombuscontours$Ycolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)
distchi2 27
data(eirepolys)eirecontourslt-polylist2list(eirepolys)densitymap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
distchi2 It gives an euclidian distance matrix for factors using metric of χ2
Description
The function lsquodistchi2rsquo calculates an euclidian distance matrix for factors using metric of χ2
Usage
distchi2(mat)
Arguments
mat A matrix of factors given as numeric values
Details
The euclidian distance between two individuals i and k using the metric of χ2 is given by
d2χ2 =
n
p
sumj
p
mjsuml
δjlik
1nj
l
with n number of individuals p number of variables mj is the number of possibilities for variableY j nj
l is the number of individuals where l has been observed for Y j and δjlik = 1 if there is a
discordance between i and k for l and 0 otherwise It is not an interactive function
Value
It returns a dist object (see help(dist))
Author(s)
Laurent Thibault
References
Besse Philippe ldquoData mining 2 Modeacutelisation statistique et apprentissagerdquo Publication du LSPhttpwwwlspups-tlsefrBesse
See Also
clustermap
28 driftmap
driftmap Detection of an eventual trend
Description
The function lsquodriftmaprsquo creates a grid on the map and calculates the mean and median for each cellThe right plot (resp left plot) represents means and medians calculated by row (resp column)
Usage
driftmap(long lat var interpol = 1nuage = 0 carte = NULLlablong = lablat = labvar = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
interpol if 1 the mean and median calculated are linearly interpoled
nuage if 1 the individuals are also represented on the graphics
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
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
labvar name of variable lsquovarrsquo
Details
Possibility to change the number of cells in the grid with the tcltk window to interpolate the meansand medians calculated (by default) to work on a rotated map Notice that this is not an interactivefunction
Value
No values returned only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
eire 29
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmaprotation
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)driftmap(auckland$Eastingauckland$Northingauckland$Deaths197785interpol=0nuage=1lablong=Xlablat=Ylabvar=Deaths197785)
data afcondata(afcon)driftmap(afcon$xafcon$yafcon$totconinterpol=0nuage=1lablong=Xlablat=Ylabvar=Number of conflicts)
data meusedata(meuseall)data(meuseriv)driftmap(meuseall$xmeuseall$ymeuseall$coppernuage=1lablong=Xlablat=Ylabvar=Concentration de cuivre (en ppm))
eire Eire data sets
Description
The lsquoeirersquo data frame has 26 rows and 11 columns
Usage
data(eire)
Format
A data frame with 26 observations on the following 11 variables
V1 a vector x of size n
V2 a vector y of size n
A Percentage of sample with blood group A
towns Townsunit area
pale Beyond the Pale 0 within the Pale 1
size number of blood type samples
ROADACC arterial road network accessibility in 1961
30 eirepolys
OWNCONS percentage in value terms of gross agricultural output of each county consumed by itself
POPCHG 1961 population as percentage of 1926
RETSALE value of retail sales c000
INCOME total personal income c000
Details
This data provides from spdep package
Source
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
Examples
data(eire)
eirepolys Spatial polygonal contours of eire dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of eiredataset
Usage
data(eirepolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or rsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibility torepesent spatial polygonal contours as a backgroud map Thatrsquos why we create functions lsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of the polygons
Source
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
findneighbors 31
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
findneighbors Research of the m nearest neighbors for sites
Description
The function lsquofindneighborsrsquo gives for each site of coordinates (xc yc) the m nearest neighbors inthe set of sites
Usage
findneighbors(xc yc m)
Arguments
xc a numerical vector x of size n
yc a numerical vector y of size n
m number of nearest neighbors
Details
In case of ties the nearest neighbor is randomly chosen among the ties This function is called inmakeneighborswr
Value
A matrix of size ntimes n containing 1 on position (i j) if j is m-nearest neighbour to i
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakedistanceWmakeneighborsw
32 genpca
Examples
data(auckland)Wlt-findneighbors(auckland$Eastingauckland$Northing1)
genpca Generalized Principal Component Analysis (PCA)
Description
The function lsquogenpcarsquo computes a generalized Principal Component Analysis (PCA) It calculatesthe principal components the coordinates of the variables and in these principals components axesand the inertia of these principal components
Usage
genpca(data w=rep(1nrow(data)length=nrow(data)) m=diag(1ncol(data)ncol(data))center=TRUE reduc=TRUE)
Arguments
data matrix ntimes p
w vector of size n of weight (by default weight = t(1n 1n))
m matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centered PCA (by default center=TRUE)
reduc boolean if TRUE reduced PCA (by default reduce=TRUE)
Details
LetW = diag(w)
x = data = (xprime1 x
primen)prime
withxi = (x1
i xpi )
Let1n = (1 1)prime
with n rows and 1p = (1 1)prime
with p rows Normalization of weight
wi =wisumi wi
genpca 33
Vector of means x = (x1 xp)prime
withxj =
sumi
wixji
If center=Truexc = xminus 1nxprime
Standart deviation (σj)2 =
sumi
wi(xji )
2 minus (xj)2
Σ = diag((σ1)2 (σp)2)prime
If reduc=True xcr = xc times Σminus12
Variance-Covariance matrix
C = xprimecrWxcr
Cholesky decomposition M = LLprime where M=mLet
Cl = LCLprime
Let U and D as ClU = UD
with D = diag(λ1 λp)Let
V = LprimeU
Then Coordinates of individuals in the principals components basis
CC = xcrV
Coordinates of variables in principals components
V C = CV Dminus12
Inertia I = D1p
Value
Returns lsquoinertiarsquo vector of size p with percent of inertia of each component (corresponding to I)lsquocasecoordrsquo matrix ntimes p (corresponding to matrix CC) lsquovarcoordrsquo matrix ptimes p (corresponding tomatrix V C)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
34 gini
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermappcamap
gini Calculates a Gini Index
Description
The function lsquoginirsquo calculates the Gini Index associated to the variable lsquovarrsquo
Usage
gini(var)
Arguments
var a vector of numerical values of size n
Details
Let xk k = 1 K be the distinct values taken by V ar For each site Ginir returns two pairs offrequencies The pair (f g) where f represents
fk =1n
sumi
1(V ari = xk)
(n is the length of lsquovarrsquo) and g represents
gk =xk
xfk
The pair (FG) represents the corresponding cumulative frequenciesThe Gini Index is calculated as
IG =12x
Ksumi=1
Ksumj=1
|xi minus xj |
Value
(f F g G gini) where f F g and G are vectors of size K and gini a numeric value
Note
This function is used in ginimapR but it is not an interactive function
ginimap 35
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
ginimap
ginimap Lorentz curve and map
Description
The function lsquoginimaprsquo computes a Lorentz curve from rsquovarrsquo and calculates the Gini Index associ-ated to var
Usage
ginimap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
boxplotmap 13
Details
This data provides from spdep package
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Harrison David and Daniel L Rubinfeld ldquoHedonic Housing Prices and the Demand for CleanAirrdquo Journal of Environmental Economics and Management Volume 5 (1978) 81-102 Originaldata
Gilley OW and R Kelley Pace ldquoOn the Harrison and Rubinfeld Datardquo Journal of EnvironmentalEconomics and Management 31 (1996) 403-405 Provided corrections and examined censoring
Pace R Kelley and OW Gilley ldquoUsing the Spatial Configuration of the Data to Improve Estima-tionrdquo Journal of the Real Estate Finance and Economics 14 (1997) 333-340
Examples
data(boston)
boxplotmap Interactive boxplot and map
Description
The function lsquoboxplotmaprsquo draws a boxplot of the given variable var and a map with site of coor-dinates (long lat)
Usage
boxplotmap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
14 boxplotmap
listnomvar list of character of size p with names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar name of variable var
axis 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
There is an interactivity only in one direction the sites selected by interquartile on the boxplot arerepresented on the map in red
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
carte 15
Examples
donnees oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)boxplotmap(oldcol$X oldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CP==1)axis=TRUElablong=Xlablat=Y)
donnees bostondata(boston)boxplotmap(boston$xboston$yboston$CRIMlistvar=bostonlistnomvar=names(boston)criteria=(boston$CHAS==1))
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)boxplotmap(eire$V1eire$V2eire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Taux deacutevolution de la population de 1921 agrave1962)
carte Drawing a map
Description
The function lsquocartersquo draws a map with sites of coordinates (long lat) and represents sites whichhave been selected (obs) in red if symbol=0 or with star if symbol=1 This function is called bymost of the functions of GeoXp (this is not an interactive function)
Usage
carte(long lat obscriteria=NULLbuble=FALSEcbuble=NULLnointer=FALSE carte=NULLnocart=FALSE label=symbol=0col=0 lablong= lablat= method= W=NULL couleurs=classe obsqlegmap=NULLlegends=list(FALSEFALSE)labmod=axis=FALSE)
Arguments
long a vector x of size n
lat a vector y of size n
obs a boolean vector of size n with TRUE on selected sites
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
16 carte
buble a boolean with TRUE for drawing bubbles FALSE otherwise
cbuble vector of size n with size of each site depending on variable with which bubblesare constructed
nointer a boolean with TRUE for drawing sites selected by criteria FALSE otherwise
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
nocart a boolean with TRUE for drawing spatial contours FALSE otherwise
label vector of character of size n with name of each site
col 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points are inred if 1 selected points are stars
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
method Specification for some graphics such as lsquoNeighbourplot1rsquo lsquoNeighbourplot2rsquolsquoClusterrsquo lsquoAngleplotrsquo lsquoVariocloudrsquo
W neighbourhood matrix of size ntimes n necessary when method=lsquoNeighbourplotrsquo
couleurs Possibility to change colors (only for admin)
classe vector of n whith class necessary when method=lsquoClusterrsquo
obsq vector of size n with number of quadrant to which the site belongs necessarywhen method=lsquoQuadrantrsquo
legmap a list of (numericnumericnumericnumericnumericnumericcharacter) with thesizes and the corresponding values of the 3 bubbles represented in the legend andthe variable name of variable choosed
clustermap 17
legends a list of c(booleanbooleanc(numericnumeric)c(numericnumeric)) with TRUEfor drawing legends of bubbles (1st argument) or factors (2nd argument) and thecoordinates of the location of the upper left corner of the legend box
labmod Name of factors
axis a boolean with True for drawing axes on the map
Details
For factors possibility to represent sites with different colors for each level Others options permitto represent with a croice some sites with special lsquocriteriarsquo with lsquobubblersquo according to a variablegiven a spatial contours with lsquocartersquo names of sites with lsquolabelrsquo or a representation in flowerPossibility to draw a legend giving the sizes of bubbles and colors of levels
Value
No values only drawing of a map
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
clustermap Classification of dataset using kmeansr or hclustr and representationof clusters on a map
Description
The function lsquoclustermaprsquo performs a classification of the sites from the variables included indataset and computes a bar plot of the clusters calculated Classification methods comes fromhclustR (hierarchical cluster analysis) and kmeansR (k-means clustering) and number of class ischosen with clustnum
Usage
clustermap(longlatdatasetclustnummethod=kmeanstype=NULLcenters=NULLscale=FALSElistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabvar=Clusterlabel=symbol=0color=1labmod=axis=FALSElablong= lablat=)
18 clustermap
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix of variables of numeric values
clustnum Number of clusters
method two methos lsquokmeansrsquo by default or lsquohclustrsquo
type If method=lsquohclustrdquo type=ldquocompleterdquo by default (the possibilities are given inhelp(hclust) as lsquowardrsquo lsquosinglersquo etc) If method=lsquokmeansrsquo type=Hartigan-Wong by default (the possibilities are given in help(kmeans) as lsquoForgyrsquo etc)
centers If method=rsquokmeansrsquo user can give a matrix with initial cluster centers
scale If scale=TRUE the dataset is reducted
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
labvar name of variable var
label vector of size n with names of each site
color 0 or 1 (by default) choice of representation of selected points If 0 sites arerepresented in blue if 1 sites are represented with different colors for eachcluster
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labmod names of Clusters
clustermap 19
axis 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 two windows are interactive the sites selected by a bar chosen on the bar plot are representedon the map in red and the values of sites selected on the map by lsquopointsrsquo or lsquopolygonrsquo are representedin red on the bar plot The dendogram is also drawn for rsquohclustrsquo method In option possibility tochoose the classification method
Value
A vector of boolean of size n (TRUE if the site was in the last selection) and a vector of size nwhith the number of cluster for each site
Note
To use the functions hclustr and kmeansr we take many arguments by default If the user wouldlike to modify these arguments he should call these functions first and then use the functionbarmapr to visualize the calculated clusters
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Murtagh F (1985) ldquoMultidimensional Clustering Algorithmsrdquo
Hartigan J A and Wong M A (1979) A K-means clustering algorithm Applied Statistics 28100-108
See Also
barmap pcamap
Examples
donneacutees oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)obslt-clustermap(oldcol$X oldcol$Yoldcol[712]3listvar=oldcollistnomvar=names(oldcol)carte=contoursOLDcriteria=(oldcol$CP==1))
20 dbledensitymap
data avifaunelibrary(ade4)data(mafragh)dlt-distchi2(mafragh$flo)
obslt-clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4method=hclusttype=wardlistvar=mafragh$partitionlistnomvar=class)
claslt-obs$vectclasselt-by(dclasmean)glt-rbind(e[1]$1e[2]$2e[3]$3e[4]$4)
clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4centers=glistvar=mafragh$partitionlistnomvar=class)
dbledensitymap Double Kernel density estimates and map
Description
The function lsquodbledensitymaprsquo plots two kernel density estimates from var1 and var2 computedwith lsquobkdeRrsquo and a map with sites of coordinates (long lat) Each site is associated to a value ofvar1 and var2 and the two windows are interactive
Usage
dbledensitymap(long lat var1 var2kernel=triweight listvar = NULLlistnomvar = NULL carte = NULL criteria = NULL label = symbol = 0 color = 1 labvar = c(var1 var2) axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
dbledensitymap 21
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar list of character with names of variables var1 and var2
axis 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 user can choose an interval on the density curve by mouse clicking on the lower and upperboundaries of the interval or by giving directly these values The selected sites are then representedon the map in red A selection by lsquopointsrsquo or lsquopolygonrsquo on the map results in the drawing of thedensity of the corresponding sub-distribution on the density plot Finally the user can modify thebandwith parameter with a cursor in the tcltk window (parameter α) α is the smoothing parameterfor the kernel smooth it represents the mean percentage of sample points involved in the localaveraging (example α = 20 means that on average ntimes 02 points are in any interval of length 2hwhere h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
22 dblehistomap
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dbledensitymap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785))) listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-dbledensitymap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)dbledensitymap(eire$V1eire$V2eire$Aeire$townslabvar=c(Taux dindividus au groupe sanguin ASurface urbaine)carte=eirecontourskernel=normallistvar=eirelistnomvar=names(eire))
dblehistomap Double Interactive Histogram and map
Description
The function lsquodblehistomaprsquo draws two histograms of the given variables var1 and var2 and a mapwith sites of coordinates (long lat) Each site is associated to a value of var1 and var2 and thereis interactivity between the two windows created
dblehistomap 23
Usage
dblehistomap(long lat var1 var2 listvar = NULL listnomvar = NULLnbcol1 = 10 nbcol2 = 10 carte = NULL criteria = NULLsymbol = 0 color = 1 labvar = c( ) label = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
nbcol1 number of cells for histogram 1 (10 by default)
nbcol2 number of cells for histogram 2 (10 by default)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
24 densitymap
Details
The selection of sites by lsquopointsrsquo or lsquopolygonsrsquo on the map results in the drawing of the red his-tograms of the subdistributions corresponding to this subset of sites
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dblehistomap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785)))listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadblehistomap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
densitymap Kernel density estimates and map
Description
The function lsquodensitymaprsquo draws kernel density estimates of the variable var with rsquobkdeRrsquo anda map with sites of coordinate (long lat) Each site is associated to a value of var and there isinteractivity between the two windows
densitymap 25
Usage
densitymap(long lat varkernel=triweightlistvar=NULLlistnomvar=NULLcarte=NULL criteria=NULLlabel=symbol=0color=1 labvar=axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
labvar name of variable var
axis 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
26 densitymap
Details
The user can choose an interval on the density curve by mouse clicking on the graph on the extremi-ties of interval or by specifying directly values The sites selected by an interval are then representedon the map in red The selection of sites on the map by lsquopointsrsquo or lsquopolygonrsquo results in the draw-ing of the kernel densities of the subdistributions corresponding to this subset of sites Finally theuser can modify the bandwith parameter with a cursor in the tcltk window (parameter α) α is thesmoothing parameter for the kernel smooth it represents the mean percentage of sample pointsinvolved in the local averaging (example α = 20 means that on average ntimes 02 points are in anyinterval of length 2h where h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
library tcltk and KernSmooth data olcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)densitymap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadensitymap(colombuscontours$Xcolombuscontours$Ycolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)
distchi2 27
data(eirepolys)eirecontourslt-polylist2list(eirepolys)densitymap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
distchi2 It gives an euclidian distance matrix for factors using metric of χ2
Description
The function lsquodistchi2rsquo calculates an euclidian distance matrix for factors using metric of χ2
Usage
distchi2(mat)
Arguments
mat A matrix of factors given as numeric values
Details
The euclidian distance between two individuals i and k using the metric of χ2 is given by
d2χ2 =
n
p
sumj
p
mjsuml
δjlik
1nj
l
with n number of individuals p number of variables mj is the number of possibilities for variableY j nj
l is the number of individuals where l has been observed for Y j and δjlik = 1 if there is a
discordance between i and k for l and 0 otherwise It is not an interactive function
Value
It returns a dist object (see help(dist))
Author(s)
Laurent Thibault
References
Besse Philippe ldquoData mining 2 Modeacutelisation statistique et apprentissagerdquo Publication du LSPhttpwwwlspups-tlsefrBesse
See Also
clustermap
28 driftmap
driftmap Detection of an eventual trend
Description
The function lsquodriftmaprsquo creates a grid on the map and calculates the mean and median for each cellThe right plot (resp left plot) represents means and medians calculated by row (resp column)
Usage
driftmap(long lat var interpol = 1nuage = 0 carte = NULLlablong = lablat = labvar = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
interpol if 1 the mean and median calculated are linearly interpoled
nuage if 1 the individuals are also represented on the graphics
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
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
labvar name of variable lsquovarrsquo
Details
Possibility to change the number of cells in the grid with the tcltk window to interpolate the meansand medians calculated (by default) to work on a rotated map Notice that this is not an interactivefunction
Value
No values returned only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
eire 29
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmaprotation
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)driftmap(auckland$Eastingauckland$Northingauckland$Deaths197785interpol=0nuage=1lablong=Xlablat=Ylabvar=Deaths197785)
data afcondata(afcon)driftmap(afcon$xafcon$yafcon$totconinterpol=0nuage=1lablong=Xlablat=Ylabvar=Number of conflicts)
data meusedata(meuseall)data(meuseriv)driftmap(meuseall$xmeuseall$ymeuseall$coppernuage=1lablong=Xlablat=Ylabvar=Concentration de cuivre (en ppm))
eire Eire data sets
Description
The lsquoeirersquo data frame has 26 rows and 11 columns
Usage
data(eire)
Format
A data frame with 26 observations on the following 11 variables
V1 a vector x of size n
V2 a vector y of size n
A Percentage of sample with blood group A
towns Townsunit area
pale Beyond the Pale 0 within the Pale 1
size number of blood type samples
ROADACC arterial road network accessibility in 1961
30 eirepolys
OWNCONS percentage in value terms of gross agricultural output of each county consumed by itself
POPCHG 1961 population as percentage of 1926
RETSALE value of retail sales c000
INCOME total personal income c000
Details
This data provides from spdep package
Source
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
Examples
data(eire)
eirepolys Spatial polygonal contours of eire dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of eiredataset
Usage
data(eirepolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or rsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibility torepesent spatial polygonal contours as a backgroud map Thatrsquos why we create functions lsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of the polygons
Source
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
findneighbors 31
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
findneighbors Research of the m nearest neighbors for sites
Description
The function lsquofindneighborsrsquo gives for each site of coordinates (xc yc) the m nearest neighbors inthe set of sites
Usage
findneighbors(xc yc m)
Arguments
xc a numerical vector x of size n
yc a numerical vector y of size n
m number of nearest neighbors
Details
In case of ties the nearest neighbor is randomly chosen among the ties This function is called inmakeneighborswr
Value
A matrix of size ntimes n containing 1 on position (i j) if j is m-nearest neighbour to i
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakedistanceWmakeneighborsw
32 genpca
Examples
data(auckland)Wlt-findneighbors(auckland$Eastingauckland$Northing1)
genpca Generalized Principal Component Analysis (PCA)
Description
The function lsquogenpcarsquo computes a generalized Principal Component Analysis (PCA) It calculatesthe principal components the coordinates of the variables and in these principals components axesand the inertia of these principal components
Usage
genpca(data w=rep(1nrow(data)length=nrow(data)) m=diag(1ncol(data)ncol(data))center=TRUE reduc=TRUE)
Arguments
data matrix ntimes p
w vector of size n of weight (by default weight = t(1n 1n))
m matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centered PCA (by default center=TRUE)
reduc boolean if TRUE reduced PCA (by default reduce=TRUE)
Details
LetW = diag(w)
x = data = (xprime1 x
primen)prime
withxi = (x1
i xpi )
Let1n = (1 1)prime
with n rows and 1p = (1 1)prime
with p rows Normalization of weight
wi =wisumi wi
genpca 33
Vector of means x = (x1 xp)prime
withxj =
sumi
wixji
If center=Truexc = xminus 1nxprime
Standart deviation (σj)2 =
sumi
wi(xji )
2 minus (xj)2
Σ = diag((σ1)2 (σp)2)prime
If reduc=True xcr = xc times Σminus12
Variance-Covariance matrix
C = xprimecrWxcr
Cholesky decomposition M = LLprime where M=mLet
Cl = LCLprime
Let U and D as ClU = UD
with D = diag(λ1 λp)Let
V = LprimeU
Then Coordinates of individuals in the principals components basis
CC = xcrV
Coordinates of variables in principals components
V C = CV Dminus12
Inertia I = D1p
Value
Returns lsquoinertiarsquo vector of size p with percent of inertia of each component (corresponding to I)lsquocasecoordrsquo matrix ntimes p (corresponding to matrix CC) lsquovarcoordrsquo matrix ptimes p (corresponding tomatrix V C)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
34 gini
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermappcamap
gini Calculates a Gini Index
Description
The function lsquoginirsquo calculates the Gini Index associated to the variable lsquovarrsquo
Usage
gini(var)
Arguments
var a vector of numerical values of size n
Details
Let xk k = 1 K be the distinct values taken by V ar For each site Ginir returns two pairs offrequencies The pair (f g) where f represents
fk =1n
sumi
1(V ari = xk)
(n is the length of lsquovarrsquo) and g represents
gk =xk
xfk
The pair (FG) represents the corresponding cumulative frequenciesThe Gini Index is calculated as
IG =12x
Ksumi=1
Ksumj=1
|xi minus xj |
Value
(f F g G gini) where f F g and G are vectors of size K and gini a numeric value
Note
This function is used in ginimapR but it is not an interactive function
ginimap 35
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
ginimap
ginimap Lorentz curve and map
Description
The function lsquoginimaprsquo computes a Lorentz curve from rsquovarrsquo and calculates the Gini Index associ-ated to var
Usage
ginimap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
14 boxplotmap
listnomvar list of character of size p with names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar name of variable var
axis 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
There is an interactivity only in one direction the sites selected by interquartile on the boxplot arerepresented on the map in red
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
carte 15
Examples
donnees oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)boxplotmap(oldcol$X oldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CP==1)axis=TRUElablong=Xlablat=Y)
donnees bostondata(boston)boxplotmap(boston$xboston$yboston$CRIMlistvar=bostonlistnomvar=names(boston)criteria=(boston$CHAS==1))
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)boxplotmap(eire$V1eire$V2eire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Taux deacutevolution de la population de 1921 agrave1962)
carte Drawing a map
Description
The function lsquocartersquo draws a map with sites of coordinates (long lat) and represents sites whichhave been selected (obs) in red if symbol=0 or with star if symbol=1 This function is called bymost of the functions of GeoXp (this is not an interactive function)
Usage
carte(long lat obscriteria=NULLbuble=FALSEcbuble=NULLnointer=FALSE carte=NULLnocart=FALSE label=symbol=0col=0 lablong= lablat= method= W=NULL couleurs=classe obsqlegmap=NULLlegends=list(FALSEFALSE)labmod=axis=FALSE)
Arguments
long a vector x of size n
lat a vector y of size n
obs a boolean vector of size n with TRUE on selected sites
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
16 carte
buble a boolean with TRUE for drawing bubbles FALSE otherwise
cbuble vector of size n with size of each site depending on variable with which bubblesare constructed
nointer a boolean with TRUE for drawing sites selected by criteria FALSE otherwise
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
nocart a boolean with TRUE for drawing spatial contours FALSE otherwise
label vector of character of size n with name of each site
col 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points are inred if 1 selected points are stars
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
method Specification for some graphics such as lsquoNeighbourplot1rsquo lsquoNeighbourplot2rsquolsquoClusterrsquo lsquoAngleplotrsquo lsquoVariocloudrsquo
W neighbourhood matrix of size ntimes n necessary when method=lsquoNeighbourplotrsquo
couleurs Possibility to change colors (only for admin)
classe vector of n whith class necessary when method=lsquoClusterrsquo
obsq vector of size n with number of quadrant to which the site belongs necessarywhen method=lsquoQuadrantrsquo
legmap a list of (numericnumericnumericnumericnumericnumericcharacter) with thesizes and the corresponding values of the 3 bubbles represented in the legend andthe variable name of variable choosed
clustermap 17
legends a list of c(booleanbooleanc(numericnumeric)c(numericnumeric)) with TRUEfor drawing legends of bubbles (1st argument) or factors (2nd argument) and thecoordinates of the location of the upper left corner of the legend box
labmod Name of factors
axis a boolean with True for drawing axes on the map
Details
For factors possibility to represent sites with different colors for each level Others options permitto represent with a croice some sites with special lsquocriteriarsquo with lsquobubblersquo according to a variablegiven a spatial contours with lsquocartersquo names of sites with lsquolabelrsquo or a representation in flowerPossibility to draw a legend giving the sizes of bubbles and colors of levels
Value
No values only drawing of a map
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
clustermap Classification of dataset using kmeansr or hclustr and representationof clusters on a map
Description
The function lsquoclustermaprsquo performs a classification of the sites from the variables included indataset and computes a bar plot of the clusters calculated Classification methods comes fromhclustR (hierarchical cluster analysis) and kmeansR (k-means clustering) and number of class ischosen with clustnum
Usage
clustermap(longlatdatasetclustnummethod=kmeanstype=NULLcenters=NULLscale=FALSElistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabvar=Clusterlabel=symbol=0color=1labmod=axis=FALSElablong= lablat=)
18 clustermap
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix of variables of numeric values
clustnum Number of clusters
method two methos lsquokmeansrsquo by default or lsquohclustrsquo
type If method=lsquohclustrdquo type=ldquocompleterdquo by default (the possibilities are given inhelp(hclust) as lsquowardrsquo lsquosinglersquo etc) If method=lsquokmeansrsquo type=Hartigan-Wong by default (the possibilities are given in help(kmeans) as lsquoForgyrsquo etc)
centers If method=rsquokmeansrsquo user can give a matrix with initial cluster centers
scale If scale=TRUE the dataset is reducted
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
labvar name of variable var
label vector of size n with names of each site
color 0 or 1 (by default) choice of representation of selected points If 0 sites arerepresented in blue if 1 sites are represented with different colors for eachcluster
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labmod names of Clusters
clustermap 19
axis 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 two windows are interactive the sites selected by a bar chosen on the bar plot are representedon the map in red and the values of sites selected on the map by lsquopointsrsquo or lsquopolygonrsquo are representedin red on the bar plot The dendogram is also drawn for rsquohclustrsquo method In option possibility tochoose the classification method
Value
A vector of boolean of size n (TRUE if the site was in the last selection) and a vector of size nwhith the number of cluster for each site
Note
To use the functions hclustr and kmeansr we take many arguments by default If the user wouldlike to modify these arguments he should call these functions first and then use the functionbarmapr to visualize the calculated clusters
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Murtagh F (1985) ldquoMultidimensional Clustering Algorithmsrdquo
Hartigan J A and Wong M A (1979) A K-means clustering algorithm Applied Statistics 28100-108
See Also
barmap pcamap
Examples
donneacutees oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)obslt-clustermap(oldcol$X oldcol$Yoldcol[712]3listvar=oldcollistnomvar=names(oldcol)carte=contoursOLDcriteria=(oldcol$CP==1))
20 dbledensitymap
data avifaunelibrary(ade4)data(mafragh)dlt-distchi2(mafragh$flo)
obslt-clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4method=hclusttype=wardlistvar=mafragh$partitionlistnomvar=class)
claslt-obs$vectclasselt-by(dclasmean)glt-rbind(e[1]$1e[2]$2e[3]$3e[4]$4)
clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4centers=glistvar=mafragh$partitionlistnomvar=class)
dbledensitymap Double Kernel density estimates and map
Description
The function lsquodbledensitymaprsquo plots two kernel density estimates from var1 and var2 computedwith lsquobkdeRrsquo and a map with sites of coordinates (long lat) Each site is associated to a value ofvar1 and var2 and the two windows are interactive
Usage
dbledensitymap(long lat var1 var2kernel=triweight listvar = NULLlistnomvar = NULL carte = NULL criteria = NULL label = symbol = 0 color = 1 labvar = c(var1 var2) axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
dbledensitymap 21
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar list of character with names of variables var1 and var2
axis 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 user can choose an interval on the density curve by mouse clicking on the lower and upperboundaries of the interval or by giving directly these values The selected sites are then representedon the map in red A selection by lsquopointsrsquo or lsquopolygonrsquo on the map results in the drawing of thedensity of the corresponding sub-distribution on the density plot Finally the user can modify thebandwith parameter with a cursor in the tcltk window (parameter α) α is the smoothing parameterfor the kernel smooth it represents the mean percentage of sample points involved in the localaveraging (example α = 20 means that on average ntimes 02 points are in any interval of length 2hwhere h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
22 dblehistomap
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dbledensitymap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785))) listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-dbledensitymap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)dbledensitymap(eire$V1eire$V2eire$Aeire$townslabvar=c(Taux dindividus au groupe sanguin ASurface urbaine)carte=eirecontourskernel=normallistvar=eirelistnomvar=names(eire))
dblehistomap Double Interactive Histogram and map
Description
The function lsquodblehistomaprsquo draws two histograms of the given variables var1 and var2 and a mapwith sites of coordinates (long lat) Each site is associated to a value of var1 and var2 and thereis interactivity between the two windows created
dblehistomap 23
Usage
dblehistomap(long lat var1 var2 listvar = NULL listnomvar = NULLnbcol1 = 10 nbcol2 = 10 carte = NULL criteria = NULLsymbol = 0 color = 1 labvar = c( ) label = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
nbcol1 number of cells for histogram 1 (10 by default)
nbcol2 number of cells for histogram 2 (10 by default)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
24 densitymap
Details
The selection of sites by lsquopointsrsquo or lsquopolygonsrsquo on the map results in the drawing of the red his-tograms of the subdistributions corresponding to this subset of sites
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dblehistomap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785)))listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadblehistomap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
densitymap Kernel density estimates and map
Description
The function lsquodensitymaprsquo draws kernel density estimates of the variable var with rsquobkdeRrsquo anda map with sites of coordinate (long lat) Each site is associated to a value of var and there isinteractivity between the two windows
densitymap 25
Usage
densitymap(long lat varkernel=triweightlistvar=NULLlistnomvar=NULLcarte=NULL criteria=NULLlabel=symbol=0color=1 labvar=axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
labvar name of variable var
axis 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
26 densitymap
Details
The user can choose an interval on the density curve by mouse clicking on the graph on the extremi-ties of interval or by specifying directly values The sites selected by an interval are then representedon the map in red The selection of sites on the map by lsquopointsrsquo or lsquopolygonrsquo results in the draw-ing of the kernel densities of the subdistributions corresponding to this subset of sites Finally theuser can modify the bandwith parameter with a cursor in the tcltk window (parameter α) α is thesmoothing parameter for the kernel smooth it represents the mean percentage of sample pointsinvolved in the local averaging (example α = 20 means that on average ntimes 02 points are in anyinterval of length 2h where h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
library tcltk and KernSmooth data olcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)densitymap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadensitymap(colombuscontours$Xcolombuscontours$Ycolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)
distchi2 27
data(eirepolys)eirecontourslt-polylist2list(eirepolys)densitymap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
distchi2 It gives an euclidian distance matrix for factors using metric of χ2
Description
The function lsquodistchi2rsquo calculates an euclidian distance matrix for factors using metric of χ2
Usage
distchi2(mat)
Arguments
mat A matrix of factors given as numeric values
Details
The euclidian distance between two individuals i and k using the metric of χ2 is given by
d2χ2 =
n
p
sumj
p
mjsuml
δjlik
1nj
l
with n number of individuals p number of variables mj is the number of possibilities for variableY j nj
l is the number of individuals where l has been observed for Y j and δjlik = 1 if there is a
discordance between i and k for l and 0 otherwise It is not an interactive function
Value
It returns a dist object (see help(dist))
Author(s)
Laurent Thibault
References
Besse Philippe ldquoData mining 2 Modeacutelisation statistique et apprentissagerdquo Publication du LSPhttpwwwlspups-tlsefrBesse
See Also
clustermap
28 driftmap
driftmap Detection of an eventual trend
Description
The function lsquodriftmaprsquo creates a grid on the map and calculates the mean and median for each cellThe right plot (resp left plot) represents means and medians calculated by row (resp column)
Usage
driftmap(long lat var interpol = 1nuage = 0 carte = NULLlablong = lablat = labvar = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
interpol if 1 the mean and median calculated are linearly interpoled
nuage if 1 the individuals are also represented on the graphics
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
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
labvar name of variable lsquovarrsquo
Details
Possibility to change the number of cells in the grid with the tcltk window to interpolate the meansand medians calculated (by default) to work on a rotated map Notice that this is not an interactivefunction
Value
No values returned only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
eire 29
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmaprotation
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)driftmap(auckland$Eastingauckland$Northingauckland$Deaths197785interpol=0nuage=1lablong=Xlablat=Ylabvar=Deaths197785)
data afcondata(afcon)driftmap(afcon$xafcon$yafcon$totconinterpol=0nuage=1lablong=Xlablat=Ylabvar=Number of conflicts)
data meusedata(meuseall)data(meuseriv)driftmap(meuseall$xmeuseall$ymeuseall$coppernuage=1lablong=Xlablat=Ylabvar=Concentration de cuivre (en ppm))
eire Eire data sets
Description
The lsquoeirersquo data frame has 26 rows and 11 columns
Usage
data(eire)
Format
A data frame with 26 observations on the following 11 variables
V1 a vector x of size n
V2 a vector y of size n
A Percentage of sample with blood group A
towns Townsunit area
pale Beyond the Pale 0 within the Pale 1
size number of blood type samples
ROADACC arterial road network accessibility in 1961
30 eirepolys
OWNCONS percentage in value terms of gross agricultural output of each county consumed by itself
POPCHG 1961 population as percentage of 1926
RETSALE value of retail sales c000
INCOME total personal income c000
Details
This data provides from spdep package
Source
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
Examples
data(eire)
eirepolys Spatial polygonal contours of eire dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of eiredataset
Usage
data(eirepolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or rsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibility torepesent spatial polygonal contours as a backgroud map Thatrsquos why we create functions lsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of the polygons
Source
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
findneighbors 31
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
findneighbors Research of the m nearest neighbors for sites
Description
The function lsquofindneighborsrsquo gives for each site of coordinates (xc yc) the m nearest neighbors inthe set of sites
Usage
findneighbors(xc yc m)
Arguments
xc a numerical vector x of size n
yc a numerical vector y of size n
m number of nearest neighbors
Details
In case of ties the nearest neighbor is randomly chosen among the ties This function is called inmakeneighborswr
Value
A matrix of size ntimes n containing 1 on position (i j) if j is m-nearest neighbour to i
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakedistanceWmakeneighborsw
32 genpca
Examples
data(auckland)Wlt-findneighbors(auckland$Eastingauckland$Northing1)
genpca Generalized Principal Component Analysis (PCA)
Description
The function lsquogenpcarsquo computes a generalized Principal Component Analysis (PCA) It calculatesthe principal components the coordinates of the variables and in these principals components axesand the inertia of these principal components
Usage
genpca(data w=rep(1nrow(data)length=nrow(data)) m=diag(1ncol(data)ncol(data))center=TRUE reduc=TRUE)
Arguments
data matrix ntimes p
w vector of size n of weight (by default weight = t(1n 1n))
m matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centered PCA (by default center=TRUE)
reduc boolean if TRUE reduced PCA (by default reduce=TRUE)
Details
LetW = diag(w)
x = data = (xprime1 x
primen)prime
withxi = (x1
i xpi )
Let1n = (1 1)prime
with n rows and 1p = (1 1)prime
with p rows Normalization of weight
wi =wisumi wi
genpca 33
Vector of means x = (x1 xp)prime
withxj =
sumi
wixji
If center=Truexc = xminus 1nxprime
Standart deviation (σj)2 =
sumi
wi(xji )
2 minus (xj)2
Σ = diag((σ1)2 (σp)2)prime
If reduc=True xcr = xc times Σminus12
Variance-Covariance matrix
C = xprimecrWxcr
Cholesky decomposition M = LLprime where M=mLet
Cl = LCLprime
Let U and D as ClU = UD
with D = diag(λ1 λp)Let
V = LprimeU
Then Coordinates of individuals in the principals components basis
CC = xcrV
Coordinates of variables in principals components
V C = CV Dminus12
Inertia I = D1p
Value
Returns lsquoinertiarsquo vector of size p with percent of inertia of each component (corresponding to I)lsquocasecoordrsquo matrix ntimes p (corresponding to matrix CC) lsquovarcoordrsquo matrix ptimes p (corresponding tomatrix V C)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
34 gini
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermappcamap
gini Calculates a Gini Index
Description
The function lsquoginirsquo calculates the Gini Index associated to the variable lsquovarrsquo
Usage
gini(var)
Arguments
var a vector of numerical values of size n
Details
Let xk k = 1 K be the distinct values taken by V ar For each site Ginir returns two pairs offrequencies The pair (f g) where f represents
fk =1n
sumi
1(V ari = xk)
(n is the length of lsquovarrsquo) and g represents
gk =xk
xfk
The pair (FG) represents the corresponding cumulative frequenciesThe Gini Index is calculated as
IG =12x
Ksumi=1
Ksumj=1
|xi minus xj |
Value
(f F g G gini) where f F g and G are vectors of size K and gini a numeric value
Note
This function is used in ginimapR but it is not an interactive function
ginimap 35
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
ginimap
ginimap Lorentz curve and map
Description
The function lsquoginimaprsquo computes a Lorentz curve from rsquovarrsquo and calculates the Gini Index associ-ated to var
Usage
ginimap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
carte 15
Examples
donnees oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)boxplotmap(oldcol$X oldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CP==1)axis=TRUElablong=Xlablat=Y)
donnees bostondata(boston)boxplotmap(boston$xboston$yboston$CRIMlistvar=bostonlistnomvar=names(boston)criteria=(boston$CHAS==1))
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)boxplotmap(eire$V1eire$V2eire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Taux deacutevolution de la population de 1921 agrave1962)
carte Drawing a map
Description
The function lsquocartersquo draws a map with sites of coordinates (long lat) and represents sites whichhave been selected (obs) in red if symbol=0 or with star if symbol=1 This function is called bymost of the functions of GeoXp (this is not an interactive function)
Usage
carte(long lat obscriteria=NULLbuble=FALSEcbuble=NULLnointer=FALSE carte=NULLnocart=FALSE label=symbol=0col=0 lablong= lablat= method= W=NULL couleurs=classe obsqlegmap=NULLlegends=list(FALSEFALSE)labmod=axis=FALSE)
Arguments
long a vector x of size n
lat a vector y of size n
obs a boolean vector of size n with TRUE on selected sites
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
16 carte
buble a boolean with TRUE for drawing bubbles FALSE otherwise
cbuble vector of size n with size of each site depending on variable with which bubblesare constructed
nointer a boolean with TRUE for drawing sites selected by criteria FALSE otherwise
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
nocart a boolean with TRUE for drawing spatial contours FALSE otherwise
label vector of character of size n with name of each site
col 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points are inred if 1 selected points are stars
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
method Specification for some graphics such as lsquoNeighbourplot1rsquo lsquoNeighbourplot2rsquolsquoClusterrsquo lsquoAngleplotrsquo lsquoVariocloudrsquo
W neighbourhood matrix of size ntimes n necessary when method=lsquoNeighbourplotrsquo
couleurs Possibility to change colors (only for admin)
classe vector of n whith class necessary when method=lsquoClusterrsquo
obsq vector of size n with number of quadrant to which the site belongs necessarywhen method=lsquoQuadrantrsquo
legmap a list of (numericnumericnumericnumericnumericnumericcharacter) with thesizes and the corresponding values of the 3 bubbles represented in the legend andthe variable name of variable choosed
clustermap 17
legends a list of c(booleanbooleanc(numericnumeric)c(numericnumeric)) with TRUEfor drawing legends of bubbles (1st argument) or factors (2nd argument) and thecoordinates of the location of the upper left corner of the legend box
labmod Name of factors
axis a boolean with True for drawing axes on the map
Details
For factors possibility to represent sites with different colors for each level Others options permitto represent with a croice some sites with special lsquocriteriarsquo with lsquobubblersquo according to a variablegiven a spatial contours with lsquocartersquo names of sites with lsquolabelrsquo or a representation in flowerPossibility to draw a legend giving the sizes of bubbles and colors of levels
Value
No values only drawing of a map
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
clustermap Classification of dataset using kmeansr or hclustr and representationof clusters on a map
Description
The function lsquoclustermaprsquo performs a classification of the sites from the variables included indataset and computes a bar plot of the clusters calculated Classification methods comes fromhclustR (hierarchical cluster analysis) and kmeansR (k-means clustering) and number of class ischosen with clustnum
Usage
clustermap(longlatdatasetclustnummethod=kmeanstype=NULLcenters=NULLscale=FALSElistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabvar=Clusterlabel=symbol=0color=1labmod=axis=FALSElablong= lablat=)
18 clustermap
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix of variables of numeric values
clustnum Number of clusters
method two methos lsquokmeansrsquo by default or lsquohclustrsquo
type If method=lsquohclustrdquo type=ldquocompleterdquo by default (the possibilities are given inhelp(hclust) as lsquowardrsquo lsquosinglersquo etc) If method=lsquokmeansrsquo type=Hartigan-Wong by default (the possibilities are given in help(kmeans) as lsquoForgyrsquo etc)
centers If method=rsquokmeansrsquo user can give a matrix with initial cluster centers
scale If scale=TRUE the dataset is reducted
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
labvar name of variable var
label vector of size n with names of each site
color 0 or 1 (by default) choice of representation of selected points If 0 sites arerepresented in blue if 1 sites are represented with different colors for eachcluster
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labmod names of Clusters
clustermap 19
axis 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 two windows are interactive the sites selected by a bar chosen on the bar plot are representedon the map in red and the values of sites selected on the map by lsquopointsrsquo or lsquopolygonrsquo are representedin red on the bar plot The dendogram is also drawn for rsquohclustrsquo method In option possibility tochoose the classification method
Value
A vector of boolean of size n (TRUE if the site was in the last selection) and a vector of size nwhith the number of cluster for each site
Note
To use the functions hclustr and kmeansr we take many arguments by default If the user wouldlike to modify these arguments he should call these functions first and then use the functionbarmapr to visualize the calculated clusters
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Murtagh F (1985) ldquoMultidimensional Clustering Algorithmsrdquo
Hartigan J A and Wong M A (1979) A K-means clustering algorithm Applied Statistics 28100-108
See Also
barmap pcamap
Examples
donneacutees oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)obslt-clustermap(oldcol$X oldcol$Yoldcol[712]3listvar=oldcollistnomvar=names(oldcol)carte=contoursOLDcriteria=(oldcol$CP==1))
20 dbledensitymap
data avifaunelibrary(ade4)data(mafragh)dlt-distchi2(mafragh$flo)
obslt-clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4method=hclusttype=wardlistvar=mafragh$partitionlistnomvar=class)
claslt-obs$vectclasselt-by(dclasmean)glt-rbind(e[1]$1e[2]$2e[3]$3e[4]$4)
clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4centers=glistvar=mafragh$partitionlistnomvar=class)
dbledensitymap Double Kernel density estimates and map
Description
The function lsquodbledensitymaprsquo plots two kernel density estimates from var1 and var2 computedwith lsquobkdeRrsquo and a map with sites of coordinates (long lat) Each site is associated to a value ofvar1 and var2 and the two windows are interactive
Usage
dbledensitymap(long lat var1 var2kernel=triweight listvar = NULLlistnomvar = NULL carte = NULL criteria = NULL label = symbol = 0 color = 1 labvar = c(var1 var2) axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
dbledensitymap 21
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar list of character with names of variables var1 and var2
axis 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 user can choose an interval on the density curve by mouse clicking on the lower and upperboundaries of the interval or by giving directly these values The selected sites are then representedon the map in red A selection by lsquopointsrsquo or lsquopolygonrsquo on the map results in the drawing of thedensity of the corresponding sub-distribution on the density plot Finally the user can modify thebandwith parameter with a cursor in the tcltk window (parameter α) α is the smoothing parameterfor the kernel smooth it represents the mean percentage of sample points involved in the localaveraging (example α = 20 means that on average ntimes 02 points are in any interval of length 2hwhere h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
22 dblehistomap
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dbledensitymap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785))) listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-dbledensitymap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)dbledensitymap(eire$V1eire$V2eire$Aeire$townslabvar=c(Taux dindividus au groupe sanguin ASurface urbaine)carte=eirecontourskernel=normallistvar=eirelistnomvar=names(eire))
dblehistomap Double Interactive Histogram and map
Description
The function lsquodblehistomaprsquo draws two histograms of the given variables var1 and var2 and a mapwith sites of coordinates (long lat) Each site is associated to a value of var1 and var2 and thereis interactivity between the two windows created
dblehistomap 23
Usage
dblehistomap(long lat var1 var2 listvar = NULL listnomvar = NULLnbcol1 = 10 nbcol2 = 10 carte = NULL criteria = NULLsymbol = 0 color = 1 labvar = c( ) label = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
nbcol1 number of cells for histogram 1 (10 by default)
nbcol2 number of cells for histogram 2 (10 by default)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
24 densitymap
Details
The selection of sites by lsquopointsrsquo or lsquopolygonsrsquo on the map results in the drawing of the red his-tograms of the subdistributions corresponding to this subset of sites
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dblehistomap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785)))listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadblehistomap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
densitymap Kernel density estimates and map
Description
The function lsquodensitymaprsquo draws kernel density estimates of the variable var with rsquobkdeRrsquo anda map with sites of coordinate (long lat) Each site is associated to a value of var and there isinteractivity between the two windows
densitymap 25
Usage
densitymap(long lat varkernel=triweightlistvar=NULLlistnomvar=NULLcarte=NULL criteria=NULLlabel=symbol=0color=1 labvar=axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
labvar name of variable var
axis 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
26 densitymap
Details
The user can choose an interval on the density curve by mouse clicking on the graph on the extremi-ties of interval or by specifying directly values The sites selected by an interval are then representedon the map in red The selection of sites on the map by lsquopointsrsquo or lsquopolygonrsquo results in the draw-ing of the kernel densities of the subdistributions corresponding to this subset of sites Finally theuser can modify the bandwith parameter with a cursor in the tcltk window (parameter α) α is thesmoothing parameter for the kernel smooth it represents the mean percentage of sample pointsinvolved in the local averaging (example α = 20 means that on average ntimes 02 points are in anyinterval of length 2h where h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
library tcltk and KernSmooth data olcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)densitymap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadensitymap(colombuscontours$Xcolombuscontours$Ycolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)
distchi2 27
data(eirepolys)eirecontourslt-polylist2list(eirepolys)densitymap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
distchi2 It gives an euclidian distance matrix for factors using metric of χ2
Description
The function lsquodistchi2rsquo calculates an euclidian distance matrix for factors using metric of χ2
Usage
distchi2(mat)
Arguments
mat A matrix of factors given as numeric values
Details
The euclidian distance between two individuals i and k using the metric of χ2 is given by
d2χ2 =
n
p
sumj
p
mjsuml
δjlik
1nj
l
with n number of individuals p number of variables mj is the number of possibilities for variableY j nj
l is the number of individuals where l has been observed for Y j and δjlik = 1 if there is a
discordance between i and k for l and 0 otherwise It is not an interactive function
Value
It returns a dist object (see help(dist))
Author(s)
Laurent Thibault
References
Besse Philippe ldquoData mining 2 Modeacutelisation statistique et apprentissagerdquo Publication du LSPhttpwwwlspups-tlsefrBesse
See Also
clustermap
28 driftmap
driftmap Detection of an eventual trend
Description
The function lsquodriftmaprsquo creates a grid on the map and calculates the mean and median for each cellThe right plot (resp left plot) represents means and medians calculated by row (resp column)
Usage
driftmap(long lat var interpol = 1nuage = 0 carte = NULLlablong = lablat = labvar = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
interpol if 1 the mean and median calculated are linearly interpoled
nuage if 1 the individuals are also represented on the graphics
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
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
labvar name of variable lsquovarrsquo
Details
Possibility to change the number of cells in the grid with the tcltk window to interpolate the meansand medians calculated (by default) to work on a rotated map Notice that this is not an interactivefunction
Value
No values returned only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
eire 29
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmaprotation
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)driftmap(auckland$Eastingauckland$Northingauckland$Deaths197785interpol=0nuage=1lablong=Xlablat=Ylabvar=Deaths197785)
data afcondata(afcon)driftmap(afcon$xafcon$yafcon$totconinterpol=0nuage=1lablong=Xlablat=Ylabvar=Number of conflicts)
data meusedata(meuseall)data(meuseriv)driftmap(meuseall$xmeuseall$ymeuseall$coppernuage=1lablong=Xlablat=Ylabvar=Concentration de cuivre (en ppm))
eire Eire data sets
Description
The lsquoeirersquo data frame has 26 rows and 11 columns
Usage
data(eire)
Format
A data frame with 26 observations on the following 11 variables
V1 a vector x of size n
V2 a vector y of size n
A Percentage of sample with blood group A
towns Townsunit area
pale Beyond the Pale 0 within the Pale 1
size number of blood type samples
ROADACC arterial road network accessibility in 1961
30 eirepolys
OWNCONS percentage in value terms of gross agricultural output of each county consumed by itself
POPCHG 1961 population as percentage of 1926
RETSALE value of retail sales c000
INCOME total personal income c000
Details
This data provides from spdep package
Source
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
Examples
data(eire)
eirepolys Spatial polygonal contours of eire dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of eiredataset
Usage
data(eirepolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or rsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibility torepesent spatial polygonal contours as a backgroud map Thatrsquos why we create functions lsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of the polygons
Source
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
findneighbors 31
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
findneighbors Research of the m nearest neighbors for sites
Description
The function lsquofindneighborsrsquo gives for each site of coordinates (xc yc) the m nearest neighbors inthe set of sites
Usage
findneighbors(xc yc m)
Arguments
xc a numerical vector x of size n
yc a numerical vector y of size n
m number of nearest neighbors
Details
In case of ties the nearest neighbor is randomly chosen among the ties This function is called inmakeneighborswr
Value
A matrix of size ntimes n containing 1 on position (i j) if j is m-nearest neighbour to i
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakedistanceWmakeneighborsw
32 genpca
Examples
data(auckland)Wlt-findneighbors(auckland$Eastingauckland$Northing1)
genpca Generalized Principal Component Analysis (PCA)
Description
The function lsquogenpcarsquo computes a generalized Principal Component Analysis (PCA) It calculatesthe principal components the coordinates of the variables and in these principals components axesand the inertia of these principal components
Usage
genpca(data w=rep(1nrow(data)length=nrow(data)) m=diag(1ncol(data)ncol(data))center=TRUE reduc=TRUE)
Arguments
data matrix ntimes p
w vector of size n of weight (by default weight = t(1n 1n))
m matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centered PCA (by default center=TRUE)
reduc boolean if TRUE reduced PCA (by default reduce=TRUE)
Details
LetW = diag(w)
x = data = (xprime1 x
primen)prime
withxi = (x1
i xpi )
Let1n = (1 1)prime
with n rows and 1p = (1 1)prime
with p rows Normalization of weight
wi =wisumi wi
genpca 33
Vector of means x = (x1 xp)prime
withxj =
sumi
wixji
If center=Truexc = xminus 1nxprime
Standart deviation (σj)2 =
sumi
wi(xji )
2 minus (xj)2
Σ = diag((σ1)2 (σp)2)prime
If reduc=True xcr = xc times Σminus12
Variance-Covariance matrix
C = xprimecrWxcr
Cholesky decomposition M = LLprime where M=mLet
Cl = LCLprime
Let U and D as ClU = UD
with D = diag(λ1 λp)Let
V = LprimeU
Then Coordinates of individuals in the principals components basis
CC = xcrV
Coordinates of variables in principals components
V C = CV Dminus12
Inertia I = D1p
Value
Returns lsquoinertiarsquo vector of size p with percent of inertia of each component (corresponding to I)lsquocasecoordrsquo matrix ntimes p (corresponding to matrix CC) lsquovarcoordrsquo matrix ptimes p (corresponding tomatrix V C)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
34 gini
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermappcamap
gini Calculates a Gini Index
Description
The function lsquoginirsquo calculates the Gini Index associated to the variable lsquovarrsquo
Usage
gini(var)
Arguments
var a vector of numerical values of size n
Details
Let xk k = 1 K be the distinct values taken by V ar For each site Ginir returns two pairs offrequencies The pair (f g) where f represents
fk =1n
sumi
1(V ari = xk)
(n is the length of lsquovarrsquo) and g represents
gk =xk
xfk
The pair (FG) represents the corresponding cumulative frequenciesThe Gini Index is calculated as
IG =12x
Ksumi=1
Ksumj=1
|xi minus xj |
Value
(f F g G gini) where f F g and G are vectors of size K and gini a numeric value
Note
This function is used in ginimapR but it is not an interactive function
ginimap 35
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
ginimap
ginimap Lorentz curve and map
Description
The function lsquoginimaprsquo computes a Lorentz curve from rsquovarrsquo and calculates the Gini Index associ-ated to var
Usage
ginimap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
16 carte
buble a boolean with TRUE for drawing bubbles FALSE otherwise
cbuble vector of size n with size of each site depending on variable with which bubblesare constructed
nointer a boolean with TRUE for drawing sites selected by criteria FALSE otherwise
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
nocart a boolean with TRUE for drawing spatial contours FALSE otherwise
label vector of character of size n with name of each site
col 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points are inred if 1 selected points are stars
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
method Specification for some graphics such as lsquoNeighbourplot1rsquo lsquoNeighbourplot2rsquolsquoClusterrsquo lsquoAngleplotrsquo lsquoVariocloudrsquo
W neighbourhood matrix of size ntimes n necessary when method=lsquoNeighbourplotrsquo
couleurs Possibility to change colors (only for admin)
classe vector of n whith class necessary when method=lsquoClusterrsquo
obsq vector of size n with number of quadrant to which the site belongs necessarywhen method=lsquoQuadrantrsquo
legmap a list of (numericnumericnumericnumericnumericnumericcharacter) with thesizes and the corresponding values of the 3 bubbles represented in the legend andthe variable name of variable choosed
clustermap 17
legends a list of c(booleanbooleanc(numericnumeric)c(numericnumeric)) with TRUEfor drawing legends of bubbles (1st argument) or factors (2nd argument) and thecoordinates of the location of the upper left corner of the legend box
labmod Name of factors
axis a boolean with True for drawing axes on the map
Details
For factors possibility to represent sites with different colors for each level Others options permitto represent with a croice some sites with special lsquocriteriarsquo with lsquobubblersquo according to a variablegiven a spatial contours with lsquocartersquo names of sites with lsquolabelrsquo or a representation in flowerPossibility to draw a legend giving the sizes of bubbles and colors of levels
Value
No values only drawing of a map
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
clustermap Classification of dataset using kmeansr or hclustr and representationof clusters on a map
Description
The function lsquoclustermaprsquo performs a classification of the sites from the variables included indataset and computes a bar plot of the clusters calculated Classification methods comes fromhclustR (hierarchical cluster analysis) and kmeansR (k-means clustering) and number of class ischosen with clustnum
Usage
clustermap(longlatdatasetclustnummethod=kmeanstype=NULLcenters=NULLscale=FALSElistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabvar=Clusterlabel=symbol=0color=1labmod=axis=FALSElablong= lablat=)
18 clustermap
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix of variables of numeric values
clustnum Number of clusters
method two methos lsquokmeansrsquo by default or lsquohclustrsquo
type If method=lsquohclustrdquo type=ldquocompleterdquo by default (the possibilities are given inhelp(hclust) as lsquowardrsquo lsquosinglersquo etc) If method=lsquokmeansrsquo type=Hartigan-Wong by default (the possibilities are given in help(kmeans) as lsquoForgyrsquo etc)
centers If method=rsquokmeansrsquo user can give a matrix with initial cluster centers
scale If scale=TRUE the dataset is reducted
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
labvar name of variable var
label vector of size n with names of each site
color 0 or 1 (by default) choice of representation of selected points If 0 sites arerepresented in blue if 1 sites are represented with different colors for eachcluster
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labmod names of Clusters
clustermap 19
axis 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 two windows are interactive the sites selected by a bar chosen on the bar plot are representedon the map in red and the values of sites selected on the map by lsquopointsrsquo or lsquopolygonrsquo are representedin red on the bar plot The dendogram is also drawn for rsquohclustrsquo method In option possibility tochoose the classification method
Value
A vector of boolean of size n (TRUE if the site was in the last selection) and a vector of size nwhith the number of cluster for each site
Note
To use the functions hclustr and kmeansr we take many arguments by default If the user wouldlike to modify these arguments he should call these functions first and then use the functionbarmapr to visualize the calculated clusters
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Murtagh F (1985) ldquoMultidimensional Clustering Algorithmsrdquo
Hartigan J A and Wong M A (1979) A K-means clustering algorithm Applied Statistics 28100-108
See Also
barmap pcamap
Examples
donneacutees oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)obslt-clustermap(oldcol$X oldcol$Yoldcol[712]3listvar=oldcollistnomvar=names(oldcol)carte=contoursOLDcriteria=(oldcol$CP==1))
20 dbledensitymap
data avifaunelibrary(ade4)data(mafragh)dlt-distchi2(mafragh$flo)
obslt-clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4method=hclusttype=wardlistvar=mafragh$partitionlistnomvar=class)
claslt-obs$vectclasselt-by(dclasmean)glt-rbind(e[1]$1e[2]$2e[3]$3e[4]$4)
clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4centers=glistvar=mafragh$partitionlistnomvar=class)
dbledensitymap Double Kernel density estimates and map
Description
The function lsquodbledensitymaprsquo plots two kernel density estimates from var1 and var2 computedwith lsquobkdeRrsquo and a map with sites of coordinates (long lat) Each site is associated to a value ofvar1 and var2 and the two windows are interactive
Usage
dbledensitymap(long lat var1 var2kernel=triweight listvar = NULLlistnomvar = NULL carte = NULL criteria = NULL label = symbol = 0 color = 1 labvar = c(var1 var2) axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
dbledensitymap 21
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar list of character with names of variables var1 and var2
axis 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 user can choose an interval on the density curve by mouse clicking on the lower and upperboundaries of the interval or by giving directly these values The selected sites are then representedon the map in red A selection by lsquopointsrsquo or lsquopolygonrsquo on the map results in the drawing of thedensity of the corresponding sub-distribution on the density plot Finally the user can modify thebandwith parameter with a cursor in the tcltk window (parameter α) α is the smoothing parameterfor the kernel smooth it represents the mean percentage of sample points involved in the localaveraging (example α = 20 means that on average ntimes 02 points are in any interval of length 2hwhere h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
22 dblehistomap
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dbledensitymap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785))) listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-dbledensitymap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)dbledensitymap(eire$V1eire$V2eire$Aeire$townslabvar=c(Taux dindividus au groupe sanguin ASurface urbaine)carte=eirecontourskernel=normallistvar=eirelistnomvar=names(eire))
dblehistomap Double Interactive Histogram and map
Description
The function lsquodblehistomaprsquo draws two histograms of the given variables var1 and var2 and a mapwith sites of coordinates (long lat) Each site is associated to a value of var1 and var2 and thereis interactivity between the two windows created
dblehistomap 23
Usage
dblehistomap(long lat var1 var2 listvar = NULL listnomvar = NULLnbcol1 = 10 nbcol2 = 10 carte = NULL criteria = NULLsymbol = 0 color = 1 labvar = c( ) label = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
nbcol1 number of cells for histogram 1 (10 by default)
nbcol2 number of cells for histogram 2 (10 by default)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
24 densitymap
Details
The selection of sites by lsquopointsrsquo or lsquopolygonsrsquo on the map results in the drawing of the red his-tograms of the subdistributions corresponding to this subset of sites
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dblehistomap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785)))listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadblehistomap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
densitymap Kernel density estimates and map
Description
The function lsquodensitymaprsquo draws kernel density estimates of the variable var with rsquobkdeRrsquo anda map with sites of coordinate (long lat) Each site is associated to a value of var and there isinteractivity between the two windows
densitymap 25
Usage
densitymap(long lat varkernel=triweightlistvar=NULLlistnomvar=NULLcarte=NULL criteria=NULLlabel=symbol=0color=1 labvar=axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
labvar name of variable var
axis 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
26 densitymap
Details
The user can choose an interval on the density curve by mouse clicking on the graph on the extremi-ties of interval or by specifying directly values The sites selected by an interval are then representedon the map in red The selection of sites on the map by lsquopointsrsquo or lsquopolygonrsquo results in the draw-ing of the kernel densities of the subdistributions corresponding to this subset of sites Finally theuser can modify the bandwith parameter with a cursor in the tcltk window (parameter α) α is thesmoothing parameter for the kernel smooth it represents the mean percentage of sample pointsinvolved in the local averaging (example α = 20 means that on average ntimes 02 points are in anyinterval of length 2h where h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
library tcltk and KernSmooth data olcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)densitymap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadensitymap(colombuscontours$Xcolombuscontours$Ycolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)
distchi2 27
data(eirepolys)eirecontourslt-polylist2list(eirepolys)densitymap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
distchi2 It gives an euclidian distance matrix for factors using metric of χ2
Description
The function lsquodistchi2rsquo calculates an euclidian distance matrix for factors using metric of χ2
Usage
distchi2(mat)
Arguments
mat A matrix of factors given as numeric values
Details
The euclidian distance between two individuals i and k using the metric of χ2 is given by
d2χ2 =
n
p
sumj
p
mjsuml
δjlik
1nj
l
with n number of individuals p number of variables mj is the number of possibilities for variableY j nj
l is the number of individuals where l has been observed for Y j and δjlik = 1 if there is a
discordance between i and k for l and 0 otherwise It is not an interactive function
Value
It returns a dist object (see help(dist))
Author(s)
Laurent Thibault
References
Besse Philippe ldquoData mining 2 Modeacutelisation statistique et apprentissagerdquo Publication du LSPhttpwwwlspups-tlsefrBesse
See Also
clustermap
28 driftmap
driftmap Detection of an eventual trend
Description
The function lsquodriftmaprsquo creates a grid on the map and calculates the mean and median for each cellThe right plot (resp left plot) represents means and medians calculated by row (resp column)
Usage
driftmap(long lat var interpol = 1nuage = 0 carte = NULLlablong = lablat = labvar = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
interpol if 1 the mean and median calculated are linearly interpoled
nuage if 1 the individuals are also represented on the graphics
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
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
labvar name of variable lsquovarrsquo
Details
Possibility to change the number of cells in the grid with the tcltk window to interpolate the meansand medians calculated (by default) to work on a rotated map Notice that this is not an interactivefunction
Value
No values returned only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
eire 29
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmaprotation
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)driftmap(auckland$Eastingauckland$Northingauckland$Deaths197785interpol=0nuage=1lablong=Xlablat=Ylabvar=Deaths197785)
data afcondata(afcon)driftmap(afcon$xafcon$yafcon$totconinterpol=0nuage=1lablong=Xlablat=Ylabvar=Number of conflicts)
data meusedata(meuseall)data(meuseriv)driftmap(meuseall$xmeuseall$ymeuseall$coppernuage=1lablong=Xlablat=Ylabvar=Concentration de cuivre (en ppm))
eire Eire data sets
Description
The lsquoeirersquo data frame has 26 rows and 11 columns
Usage
data(eire)
Format
A data frame with 26 observations on the following 11 variables
V1 a vector x of size n
V2 a vector y of size n
A Percentage of sample with blood group A
towns Townsunit area
pale Beyond the Pale 0 within the Pale 1
size number of blood type samples
ROADACC arterial road network accessibility in 1961
30 eirepolys
OWNCONS percentage in value terms of gross agricultural output of each county consumed by itself
POPCHG 1961 population as percentage of 1926
RETSALE value of retail sales c000
INCOME total personal income c000
Details
This data provides from spdep package
Source
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
Examples
data(eire)
eirepolys Spatial polygonal contours of eire dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of eiredataset
Usage
data(eirepolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or rsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibility torepesent spatial polygonal contours as a backgroud map Thatrsquos why we create functions lsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of the polygons
Source
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
findneighbors 31
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
findneighbors Research of the m nearest neighbors for sites
Description
The function lsquofindneighborsrsquo gives for each site of coordinates (xc yc) the m nearest neighbors inthe set of sites
Usage
findneighbors(xc yc m)
Arguments
xc a numerical vector x of size n
yc a numerical vector y of size n
m number of nearest neighbors
Details
In case of ties the nearest neighbor is randomly chosen among the ties This function is called inmakeneighborswr
Value
A matrix of size ntimes n containing 1 on position (i j) if j is m-nearest neighbour to i
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakedistanceWmakeneighborsw
32 genpca
Examples
data(auckland)Wlt-findneighbors(auckland$Eastingauckland$Northing1)
genpca Generalized Principal Component Analysis (PCA)
Description
The function lsquogenpcarsquo computes a generalized Principal Component Analysis (PCA) It calculatesthe principal components the coordinates of the variables and in these principals components axesand the inertia of these principal components
Usage
genpca(data w=rep(1nrow(data)length=nrow(data)) m=diag(1ncol(data)ncol(data))center=TRUE reduc=TRUE)
Arguments
data matrix ntimes p
w vector of size n of weight (by default weight = t(1n 1n))
m matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centered PCA (by default center=TRUE)
reduc boolean if TRUE reduced PCA (by default reduce=TRUE)
Details
LetW = diag(w)
x = data = (xprime1 x
primen)prime
withxi = (x1
i xpi )
Let1n = (1 1)prime
with n rows and 1p = (1 1)prime
with p rows Normalization of weight
wi =wisumi wi
genpca 33
Vector of means x = (x1 xp)prime
withxj =
sumi
wixji
If center=Truexc = xminus 1nxprime
Standart deviation (σj)2 =
sumi
wi(xji )
2 minus (xj)2
Σ = diag((σ1)2 (σp)2)prime
If reduc=True xcr = xc times Σminus12
Variance-Covariance matrix
C = xprimecrWxcr
Cholesky decomposition M = LLprime where M=mLet
Cl = LCLprime
Let U and D as ClU = UD
with D = diag(λ1 λp)Let
V = LprimeU
Then Coordinates of individuals in the principals components basis
CC = xcrV
Coordinates of variables in principals components
V C = CV Dminus12
Inertia I = D1p
Value
Returns lsquoinertiarsquo vector of size p with percent of inertia of each component (corresponding to I)lsquocasecoordrsquo matrix ntimes p (corresponding to matrix CC) lsquovarcoordrsquo matrix ptimes p (corresponding tomatrix V C)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
34 gini
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermappcamap
gini Calculates a Gini Index
Description
The function lsquoginirsquo calculates the Gini Index associated to the variable lsquovarrsquo
Usage
gini(var)
Arguments
var a vector of numerical values of size n
Details
Let xk k = 1 K be the distinct values taken by V ar For each site Ginir returns two pairs offrequencies The pair (f g) where f represents
fk =1n
sumi
1(V ari = xk)
(n is the length of lsquovarrsquo) and g represents
gk =xk
xfk
The pair (FG) represents the corresponding cumulative frequenciesThe Gini Index is calculated as
IG =12x
Ksumi=1
Ksumj=1
|xi minus xj |
Value
(f F g G gini) where f F g and G are vectors of size K and gini a numeric value
Note
This function is used in ginimapR but it is not an interactive function
ginimap 35
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
ginimap
ginimap Lorentz curve and map
Description
The function lsquoginimaprsquo computes a Lorentz curve from rsquovarrsquo and calculates the Gini Index associ-ated to var
Usage
ginimap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
clustermap 17
legends a list of c(booleanbooleanc(numericnumeric)c(numericnumeric)) with TRUEfor drawing legends of bubbles (1st argument) or factors (2nd argument) and thecoordinates of the location of the upper left corner of the legend box
labmod Name of factors
axis a boolean with True for drawing axes on the map
Details
For factors possibility to represent sites with different colors for each level Others options permitto represent with a croice some sites with special lsquocriteriarsquo with lsquobubblersquo according to a variablegiven a spatial contours with lsquocartersquo names of sites with lsquolabelrsquo or a representation in flowerPossibility to draw a legend giving the sizes of bubbles and colors of levels
Value
No values only drawing of a map
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
clustermap Classification of dataset using kmeansr or hclustr and representationof clusters on a map
Description
The function lsquoclustermaprsquo performs a classification of the sites from the variables included indataset and computes a bar plot of the clusters calculated Classification methods comes fromhclustR (hierarchical cluster analysis) and kmeansR (k-means clustering) and number of class ischosen with clustnum
Usage
clustermap(longlatdatasetclustnummethod=kmeanstype=NULLcenters=NULLscale=FALSElistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabvar=Clusterlabel=symbol=0color=1labmod=axis=FALSElablong= lablat=)
18 clustermap
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix of variables of numeric values
clustnum Number of clusters
method two methos lsquokmeansrsquo by default or lsquohclustrsquo
type If method=lsquohclustrdquo type=ldquocompleterdquo by default (the possibilities are given inhelp(hclust) as lsquowardrsquo lsquosinglersquo etc) If method=lsquokmeansrsquo type=Hartigan-Wong by default (the possibilities are given in help(kmeans) as lsquoForgyrsquo etc)
centers If method=rsquokmeansrsquo user can give a matrix with initial cluster centers
scale If scale=TRUE the dataset is reducted
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
labvar name of variable var
label vector of size n with names of each site
color 0 or 1 (by default) choice of representation of selected points If 0 sites arerepresented in blue if 1 sites are represented with different colors for eachcluster
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labmod names of Clusters
clustermap 19
axis 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 two windows are interactive the sites selected by a bar chosen on the bar plot are representedon the map in red and the values of sites selected on the map by lsquopointsrsquo or lsquopolygonrsquo are representedin red on the bar plot The dendogram is also drawn for rsquohclustrsquo method In option possibility tochoose the classification method
Value
A vector of boolean of size n (TRUE if the site was in the last selection) and a vector of size nwhith the number of cluster for each site
Note
To use the functions hclustr and kmeansr we take many arguments by default If the user wouldlike to modify these arguments he should call these functions first and then use the functionbarmapr to visualize the calculated clusters
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Murtagh F (1985) ldquoMultidimensional Clustering Algorithmsrdquo
Hartigan J A and Wong M A (1979) A K-means clustering algorithm Applied Statistics 28100-108
See Also
barmap pcamap
Examples
donneacutees oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)obslt-clustermap(oldcol$X oldcol$Yoldcol[712]3listvar=oldcollistnomvar=names(oldcol)carte=contoursOLDcriteria=(oldcol$CP==1))
20 dbledensitymap
data avifaunelibrary(ade4)data(mafragh)dlt-distchi2(mafragh$flo)
obslt-clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4method=hclusttype=wardlistvar=mafragh$partitionlistnomvar=class)
claslt-obs$vectclasselt-by(dclasmean)glt-rbind(e[1]$1e[2]$2e[3]$3e[4]$4)
clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4centers=glistvar=mafragh$partitionlistnomvar=class)
dbledensitymap Double Kernel density estimates and map
Description
The function lsquodbledensitymaprsquo plots two kernel density estimates from var1 and var2 computedwith lsquobkdeRrsquo and a map with sites of coordinates (long lat) Each site is associated to a value ofvar1 and var2 and the two windows are interactive
Usage
dbledensitymap(long lat var1 var2kernel=triweight listvar = NULLlistnomvar = NULL carte = NULL criteria = NULL label = symbol = 0 color = 1 labvar = c(var1 var2) axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
dbledensitymap 21
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar list of character with names of variables var1 and var2
axis 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 user can choose an interval on the density curve by mouse clicking on the lower and upperboundaries of the interval or by giving directly these values The selected sites are then representedon the map in red A selection by lsquopointsrsquo or lsquopolygonrsquo on the map results in the drawing of thedensity of the corresponding sub-distribution on the density plot Finally the user can modify thebandwith parameter with a cursor in the tcltk window (parameter α) α is the smoothing parameterfor the kernel smooth it represents the mean percentage of sample points involved in the localaveraging (example α = 20 means that on average ntimes 02 points are in any interval of length 2hwhere h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
22 dblehistomap
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dbledensitymap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785))) listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-dbledensitymap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)dbledensitymap(eire$V1eire$V2eire$Aeire$townslabvar=c(Taux dindividus au groupe sanguin ASurface urbaine)carte=eirecontourskernel=normallistvar=eirelistnomvar=names(eire))
dblehistomap Double Interactive Histogram and map
Description
The function lsquodblehistomaprsquo draws two histograms of the given variables var1 and var2 and a mapwith sites of coordinates (long lat) Each site is associated to a value of var1 and var2 and thereis interactivity between the two windows created
dblehistomap 23
Usage
dblehistomap(long lat var1 var2 listvar = NULL listnomvar = NULLnbcol1 = 10 nbcol2 = 10 carte = NULL criteria = NULLsymbol = 0 color = 1 labvar = c( ) label = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
nbcol1 number of cells for histogram 1 (10 by default)
nbcol2 number of cells for histogram 2 (10 by default)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
24 densitymap
Details
The selection of sites by lsquopointsrsquo or lsquopolygonsrsquo on the map results in the drawing of the red his-tograms of the subdistributions corresponding to this subset of sites
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dblehistomap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785)))listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadblehistomap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
densitymap Kernel density estimates and map
Description
The function lsquodensitymaprsquo draws kernel density estimates of the variable var with rsquobkdeRrsquo anda map with sites of coordinate (long lat) Each site is associated to a value of var and there isinteractivity between the two windows
densitymap 25
Usage
densitymap(long lat varkernel=triweightlistvar=NULLlistnomvar=NULLcarte=NULL criteria=NULLlabel=symbol=0color=1 labvar=axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
labvar name of variable var
axis 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
26 densitymap
Details
The user can choose an interval on the density curve by mouse clicking on the graph on the extremi-ties of interval or by specifying directly values The sites selected by an interval are then representedon the map in red The selection of sites on the map by lsquopointsrsquo or lsquopolygonrsquo results in the draw-ing of the kernel densities of the subdistributions corresponding to this subset of sites Finally theuser can modify the bandwith parameter with a cursor in the tcltk window (parameter α) α is thesmoothing parameter for the kernel smooth it represents the mean percentage of sample pointsinvolved in the local averaging (example α = 20 means that on average ntimes 02 points are in anyinterval of length 2h where h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
library tcltk and KernSmooth data olcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)densitymap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadensitymap(colombuscontours$Xcolombuscontours$Ycolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)
distchi2 27
data(eirepolys)eirecontourslt-polylist2list(eirepolys)densitymap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
distchi2 It gives an euclidian distance matrix for factors using metric of χ2
Description
The function lsquodistchi2rsquo calculates an euclidian distance matrix for factors using metric of χ2
Usage
distchi2(mat)
Arguments
mat A matrix of factors given as numeric values
Details
The euclidian distance between two individuals i and k using the metric of χ2 is given by
d2χ2 =
n
p
sumj
p
mjsuml
δjlik
1nj
l
with n number of individuals p number of variables mj is the number of possibilities for variableY j nj
l is the number of individuals where l has been observed for Y j and δjlik = 1 if there is a
discordance between i and k for l and 0 otherwise It is not an interactive function
Value
It returns a dist object (see help(dist))
Author(s)
Laurent Thibault
References
Besse Philippe ldquoData mining 2 Modeacutelisation statistique et apprentissagerdquo Publication du LSPhttpwwwlspups-tlsefrBesse
See Also
clustermap
28 driftmap
driftmap Detection of an eventual trend
Description
The function lsquodriftmaprsquo creates a grid on the map and calculates the mean and median for each cellThe right plot (resp left plot) represents means and medians calculated by row (resp column)
Usage
driftmap(long lat var interpol = 1nuage = 0 carte = NULLlablong = lablat = labvar = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
interpol if 1 the mean and median calculated are linearly interpoled
nuage if 1 the individuals are also represented on the graphics
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
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
labvar name of variable lsquovarrsquo
Details
Possibility to change the number of cells in the grid with the tcltk window to interpolate the meansand medians calculated (by default) to work on a rotated map Notice that this is not an interactivefunction
Value
No values returned only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
eire 29
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmaprotation
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)driftmap(auckland$Eastingauckland$Northingauckland$Deaths197785interpol=0nuage=1lablong=Xlablat=Ylabvar=Deaths197785)
data afcondata(afcon)driftmap(afcon$xafcon$yafcon$totconinterpol=0nuage=1lablong=Xlablat=Ylabvar=Number of conflicts)
data meusedata(meuseall)data(meuseriv)driftmap(meuseall$xmeuseall$ymeuseall$coppernuage=1lablong=Xlablat=Ylabvar=Concentration de cuivre (en ppm))
eire Eire data sets
Description
The lsquoeirersquo data frame has 26 rows and 11 columns
Usage
data(eire)
Format
A data frame with 26 observations on the following 11 variables
V1 a vector x of size n
V2 a vector y of size n
A Percentage of sample with blood group A
towns Townsunit area
pale Beyond the Pale 0 within the Pale 1
size number of blood type samples
ROADACC arterial road network accessibility in 1961
30 eirepolys
OWNCONS percentage in value terms of gross agricultural output of each county consumed by itself
POPCHG 1961 population as percentage of 1926
RETSALE value of retail sales c000
INCOME total personal income c000
Details
This data provides from spdep package
Source
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
Examples
data(eire)
eirepolys Spatial polygonal contours of eire dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of eiredataset
Usage
data(eirepolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or rsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibility torepesent spatial polygonal contours as a backgroud map Thatrsquos why we create functions lsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of the polygons
Source
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
findneighbors 31
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
findneighbors Research of the m nearest neighbors for sites
Description
The function lsquofindneighborsrsquo gives for each site of coordinates (xc yc) the m nearest neighbors inthe set of sites
Usage
findneighbors(xc yc m)
Arguments
xc a numerical vector x of size n
yc a numerical vector y of size n
m number of nearest neighbors
Details
In case of ties the nearest neighbor is randomly chosen among the ties This function is called inmakeneighborswr
Value
A matrix of size ntimes n containing 1 on position (i j) if j is m-nearest neighbour to i
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakedistanceWmakeneighborsw
32 genpca
Examples
data(auckland)Wlt-findneighbors(auckland$Eastingauckland$Northing1)
genpca Generalized Principal Component Analysis (PCA)
Description
The function lsquogenpcarsquo computes a generalized Principal Component Analysis (PCA) It calculatesthe principal components the coordinates of the variables and in these principals components axesand the inertia of these principal components
Usage
genpca(data w=rep(1nrow(data)length=nrow(data)) m=diag(1ncol(data)ncol(data))center=TRUE reduc=TRUE)
Arguments
data matrix ntimes p
w vector of size n of weight (by default weight = t(1n 1n))
m matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centered PCA (by default center=TRUE)
reduc boolean if TRUE reduced PCA (by default reduce=TRUE)
Details
LetW = diag(w)
x = data = (xprime1 x
primen)prime
withxi = (x1
i xpi )
Let1n = (1 1)prime
with n rows and 1p = (1 1)prime
with p rows Normalization of weight
wi =wisumi wi
genpca 33
Vector of means x = (x1 xp)prime
withxj =
sumi
wixji
If center=Truexc = xminus 1nxprime
Standart deviation (σj)2 =
sumi
wi(xji )
2 minus (xj)2
Σ = diag((σ1)2 (σp)2)prime
If reduc=True xcr = xc times Σminus12
Variance-Covariance matrix
C = xprimecrWxcr
Cholesky decomposition M = LLprime where M=mLet
Cl = LCLprime
Let U and D as ClU = UD
with D = diag(λ1 λp)Let
V = LprimeU
Then Coordinates of individuals in the principals components basis
CC = xcrV
Coordinates of variables in principals components
V C = CV Dminus12
Inertia I = D1p
Value
Returns lsquoinertiarsquo vector of size p with percent of inertia of each component (corresponding to I)lsquocasecoordrsquo matrix ntimes p (corresponding to matrix CC) lsquovarcoordrsquo matrix ptimes p (corresponding tomatrix V C)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
34 gini
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermappcamap
gini Calculates a Gini Index
Description
The function lsquoginirsquo calculates the Gini Index associated to the variable lsquovarrsquo
Usage
gini(var)
Arguments
var a vector of numerical values of size n
Details
Let xk k = 1 K be the distinct values taken by V ar For each site Ginir returns two pairs offrequencies The pair (f g) where f represents
fk =1n
sumi
1(V ari = xk)
(n is the length of lsquovarrsquo) and g represents
gk =xk
xfk
The pair (FG) represents the corresponding cumulative frequenciesThe Gini Index is calculated as
IG =12x
Ksumi=1
Ksumj=1
|xi minus xj |
Value
(f F g G gini) where f F g and G are vectors of size K and gini a numeric value
Note
This function is used in ginimapR but it is not an interactive function
ginimap 35
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
ginimap
ginimap Lorentz curve and map
Description
The function lsquoginimaprsquo computes a Lorentz curve from rsquovarrsquo and calculates the Gini Index associ-ated to var
Usage
ginimap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
18 clustermap
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix of variables of numeric values
clustnum Number of clusters
method two methos lsquokmeansrsquo by default or lsquohclustrsquo
type If method=lsquohclustrdquo type=ldquocompleterdquo by default (the possibilities are given inhelp(hclust) as lsquowardrsquo lsquosinglersquo etc) If method=lsquokmeansrsquo type=Hartigan-Wong by default (the possibilities are given in help(kmeans) as lsquoForgyrsquo etc)
centers If method=rsquokmeansrsquo user can give a matrix with initial cluster centers
scale If scale=TRUE the dataset is reducted
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
labvar name of variable var
label vector of size n with names of each site
color 0 or 1 (by default) choice of representation of selected points If 0 sites arerepresented in blue if 1 sites are represented with different colors for eachcluster
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labmod names of Clusters
clustermap 19
axis 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 two windows are interactive the sites selected by a bar chosen on the bar plot are representedon the map in red and the values of sites selected on the map by lsquopointsrsquo or lsquopolygonrsquo are representedin red on the bar plot The dendogram is also drawn for rsquohclustrsquo method In option possibility tochoose the classification method
Value
A vector of boolean of size n (TRUE if the site was in the last selection) and a vector of size nwhith the number of cluster for each site
Note
To use the functions hclustr and kmeansr we take many arguments by default If the user wouldlike to modify these arguments he should call these functions first and then use the functionbarmapr to visualize the calculated clusters
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Murtagh F (1985) ldquoMultidimensional Clustering Algorithmsrdquo
Hartigan J A and Wong M A (1979) A K-means clustering algorithm Applied Statistics 28100-108
See Also
barmap pcamap
Examples
donneacutees oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)obslt-clustermap(oldcol$X oldcol$Yoldcol[712]3listvar=oldcollistnomvar=names(oldcol)carte=contoursOLDcriteria=(oldcol$CP==1))
20 dbledensitymap
data avifaunelibrary(ade4)data(mafragh)dlt-distchi2(mafragh$flo)
obslt-clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4method=hclusttype=wardlistvar=mafragh$partitionlistnomvar=class)
claslt-obs$vectclasselt-by(dclasmean)glt-rbind(e[1]$1e[2]$2e[3]$3e[4]$4)
clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4centers=glistvar=mafragh$partitionlistnomvar=class)
dbledensitymap Double Kernel density estimates and map
Description
The function lsquodbledensitymaprsquo plots two kernel density estimates from var1 and var2 computedwith lsquobkdeRrsquo and a map with sites of coordinates (long lat) Each site is associated to a value ofvar1 and var2 and the two windows are interactive
Usage
dbledensitymap(long lat var1 var2kernel=triweight listvar = NULLlistnomvar = NULL carte = NULL criteria = NULL label = symbol = 0 color = 1 labvar = c(var1 var2) axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
dbledensitymap 21
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar list of character with names of variables var1 and var2
axis 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 user can choose an interval on the density curve by mouse clicking on the lower and upperboundaries of the interval or by giving directly these values The selected sites are then representedon the map in red A selection by lsquopointsrsquo or lsquopolygonrsquo on the map results in the drawing of thedensity of the corresponding sub-distribution on the density plot Finally the user can modify thebandwith parameter with a cursor in the tcltk window (parameter α) α is the smoothing parameterfor the kernel smooth it represents the mean percentage of sample points involved in the localaveraging (example α = 20 means that on average ntimes 02 points are in any interval of length 2hwhere h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
22 dblehistomap
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dbledensitymap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785))) listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-dbledensitymap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)dbledensitymap(eire$V1eire$V2eire$Aeire$townslabvar=c(Taux dindividus au groupe sanguin ASurface urbaine)carte=eirecontourskernel=normallistvar=eirelistnomvar=names(eire))
dblehistomap Double Interactive Histogram and map
Description
The function lsquodblehistomaprsquo draws two histograms of the given variables var1 and var2 and a mapwith sites of coordinates (long lat) Each site is associated to a value of var1 and var2 and thereis interactivity between the two windows created
dblehistomap 23
Usage
dblehistomap(long lat var1 var2 listvar = NULL listnomvar = NULLnbcol1 = 10 nbcol2 = 10 carte = NULL criteria = NULLsymbol = 0 color = 1 labvar = c( ) label = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
nbcol1 number of cells for histogram 1 (10 by default)
nbcol2 number of cells for histogram 2 (10 by default)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
24 densitymap
Details
The selection of sites by lsquopointsrsquo or lsquopolygonsrsquo on the map results in the drawing of the red his-tograms of the subdistributions corresponding to this subset of sites
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dblehistomap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785)))listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadblehistomap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
densitymap Kernel density estimates and map
Description
The function lsquodensitymaprsquo draws kernel density estimates of the variable var with rsquobkdeRrsquo anda map with sites of coordinate (long lat) Each site is associated to a value of var and there isinteractivity between the two windows
densitymap 25
Usage
densitymap(long lat varkernel=triweightlistvar=NULLlistnomvar=NULLcarte=NULL criteria=NULLlabel=symbol=0color=1 labvar=axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
labvar name of variable var
axis 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
26 densitymap
Details
The user can choose an interval on the density curve by mouse clicking on the graph on the extremi-ties of interval or by specifying directly values The sites selected by an interval are then representedon the map in red The selection of sites on the map by lsquopointsrsquo or lsquopolygonrsquo results in the draw-ing of the kernel densities of the subdistributions corresponding to this subset of sites Finally theuser can modify the bandwith parameter with a cursor in the tcltk window (parameter α) α is thesmoothing parameter for the kernel smooth it represents the mean percentage of sample pointsinvolved in the local averaging (example α = 20 means that on average ntimes 02 points are in anyinterval of length 2h where h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
library tcltk and KernSmooth data olcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)densitymap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadensitymap(colombuscontours$Xcolombuscontours$Ycolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)
distchi2 27
data(eirepolys)eirecontourslt-polylist2list(eirepolys)densitymap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
distchi2 It gives an euclidian distance matrix for factors using metric of χ2
Description
The function lsquodistchi2rsquo calculates an euclidian distance matrix for factors using metric of χ2
Usage
distchi2(mat)
Arguments
mat A matrix of factors given as numeric values
Details
The euclidian distance between two individuals i and k using the metric of χ2 is given by
d2χ2 =
n
p
sumj
p
mjsuml
δjlik
1nj
l
with n number of individuals p number of variables mj is the number of possibilities for variableY j nj
l is the number of individuals where l has been observed for Y j and δjlik = 1 if there is a
discordance between i and k for l and 0 otherwise It is not an interactive function
Value
It returns a dist object (see help(dist))
Author(s)
Laurent Thibault
References
Besse Philippe ldquoData mining 2 Modeacutelisation statistique et apprentissagerdquo Publication du LSPhttpwwwlspups-tlsefrBesse
See Also
clustermap
28 driftmap
driftmap Detection of an eventual trend
Description
The function lsquodriftmaprsquo creates a grid on the map and calculates the mean and median for each cellThe right plot (resp left plot) represents means and medians calculated by row (resp column)
Usage
driftmap(long lat var interpol = 1nuage = 0 carte = NULLlablong = lablat = labvar = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
interpol if 1 the mean and median calculated are linearly interpoled
nuage if 1 the individuals are also represented on the graphics
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
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
labvar name of variable lsquovarrsquo
Details
Possibility to change the number of cells in the grid with the tcltk window to interpolate the meansand medians calculated (by default) to work on a rotated map Notice that this is not an interactivefunction
Value
No values returned only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
eire 29
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmaprotation
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)driftmap(auckland$Eastingauckland$Northingauckland$Deaths197785interpol=0nuage=1lablong=Xlablat=Ylabvar=Deaths197785)
data afcondata(afcon)driftmap(afcon$xafcon$yafcon$totconinterpol=0nuage=1lablong=Xlablat=Ylabvar=Number of conflicts)
data meusedata(meuseall)data(meuseriv)driftmap(meuseall$xmeuseall$ymeuseall$coppernuage=1lablong=Xlablat=Ylabvar=Concentration de cuivre (en ppm))
eire Eire data sets
Description
The lsquoeirersquo data frame has 26 rows and 11 columns
Usage
data(eire)
Format
A data frame with 26 observations on the following 11 variables
V1 a vector x of size n
V2 a vector y of size n
A Percentage of sample with blood group A
towns Townsunit area
pale Beyond the Pale 0 within the Pale 1
size number of blood type samples
ROADACC arterial road network accessibility in 1961
30 eirepolys
OWNCONS percentage in value terms of gross agricultural output of each county consumed by itself
POPCHG 1961 population as percentage of 1926
RETSALE value of retail sales c000
INCOME total personal income c000
Details
This data provides from spdep package
Source
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
Examples
data(eire)
eirepolys Spatial polygonal contours of eire dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of eiredataset
Usage
data(eirepolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or rsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibility torepesent spatial polygonal contours as a backgroud map Thatrsquos why we create functions lsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of the polygons
Source
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
findneighbors 31
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
findneighbors Research of the m nearest neighbors for sites
Description
The function lsquofindneighborsrsquo gives for each site of coordinates (xc yc) the m nearest neighbors inthe set of sites
Usage
findneighbors(xc yc m)
Arguments
xc a numerical vector x of size n
yc a numerical vector y of size n
m number of nearest neighbors
Details
In case of ties the nearest neighbor is randomly chosen among the ties This function is called inmakeneighborswr
Value
A matrix of size ntimes n containing 1 on position (i j) if j is m-nearest neighbour to i
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakedistanceWmakeneighborsw
32 genpca
Examples
data(auckland)Wlt-findneighbors(auckland$Eastingauckland$Northing1)
genpca Generalized Principal Component Analysis (PCA)
Description
The function lsquogenpcarsquo computes a generalized Principal Component Analysis (PCA) It calculatesthe principal components the coordinates of the variables and in these principals components axesand the inertia of these principal components
Usage
genpca(data w=rep(1nrow(data)length=nrow(data)) m=diag(1ncol(data)ncol(data))center=TRUE reduc=TRUE)
Arguments
data matrix ntimes p
w vector of size n of weight (by default weight = t(1n 1n))
m matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centered PCA (by default center=TRUE)
reduc boolean if TRUE reduced PCA (by default reduce=TRUE)
Details
LetW = diag(w)
x = data = (xprime1 x
primen)prime
withxi = (x1
i xpi )
Let1n = (1 1)prime
with n rows and 1p = (1 1)prime
with p rows Normalization of weight
wi =wisumi wi
genpca 33
Vector of means x = (x1 xp)prime
withxj =
sumi
wixji
If center=Truexc = xminus 1nxprime
Standart deviation (σj)2 =
sumi
wi(xji )
2 minus (xj)2
Σ = diag((σ1)2 (σp)2)prime
If reduc=True xcr = xc times Σminus12
Variance-Covariance matrix
C = xprimecrWxcr
Cholesky decomposition M = LLprime where M=mLet
Cl = LCLprime
Let U and D as ClU = UD
with D = diag(λ1 λp)Let
V = LprimeU
Then Coordinates of individuals in the principals components basis
CC = xcrV
Coordinates of variables in principals components
V C = CV Dminus12
Inertia I = D1p
Value
Returns lsquoinertiarsquo vector of size p with percent of inertia of each component (corresponding to I)lsquocasecoordrsquo matrix ntimes p (corresponding to matrix CC) lsquovarcoordrsquo matrix ptimes p (corresponding tomatrix V C)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
34 gini
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermappcamap
gini Calculates a Gini Index
Description
The function lsquoginirsquo calculates the Gini Index associated to the variable lsquovarrsquo
Usage
gini(var)
Arguments
var a vector of numerical values of size n
Details
Let xk k = 1 K be the distinct values taken by V ar For each site Ginir returns two pairs offrequencies The pair (f g) where f represents
fk =1n
sumi
1(V ari = xk)
(n is the length of lsquovarrsquo) and g represents
gk =xk
xfk
The pair (FG) represents the corresponding cumulative frequenciesThe Gini Index is calculated as
IG =12x
Ksumi=1
Ksumj=1
|xi minus xj |
Value
(f F g G gini) where f F g and G are vectors of size K and gini a numeric value
Note
This function is used in ginimapR but it is not an interactive function
ginimap 35
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
ginimap
ginimap Lorentz curve and map
Description
The function lsquoginimaprsquo computes a Lorentz curve from rsquovarrsquo and calculates the Gini Index associ-ated to var
Usage
ginimap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
clustermap 19
axis 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 two windows are interactive the sites selected by a bar chosen on the bar plot are representedon the map in red and the values of sites selected on the map by lsquopointsrsquo or lsquopolygonrsquo are representedin red on the bar plot The dendogram is also drawn for rsquohclustrsquo method In option possibility tochoose the classification method
Value
A vector of boolean of size n (TRUE if the site was in the last selection) and a vector of size nwhith the number of cluster for each site
Note
To use the functions hclustr and kmeansr we take many arguments by default If the user wouldlike to modify these arguments he should call these functions first and then use the functionbarmapr to visualize the calculated clusters
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Murtagh F (1985) ldquoMultidimensional Clustering Algorithmsrdquo
Hartigan J A and Wong M A (1979) A K-means clustering algorithm Applied Statistics 28100-108
See Also
barmap pcamap
Examples
donneacutees oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)obslt-clustermap(oldcol$X oldcol$Yoldcol[712]3listvar=oldcollistnomvar=names(oldcol)carte=contoursOLDcriteria=(oldcol$CP==1))
20 dbledensitymap
data avifaunelibrary(ade4)data(mafragh)dlt-distchi2(mafragh$flo)
obslt-clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4method=hclusttype=wardlistvar=mafragh$partitionlistnomvar=class)
claslt-obs$vectclasselt-by(dclasmean)glt-rbind(e[1]$1e[2]$2e[3]$3e[4]$4)
clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4centers=glistvar=mafragh$partitionlistnomvar=class)
dbledensitymap Double Kernel density estimates and map
Description
The function lsquodbledensitymaprsquo plots two kernel density estimates from var1 and var2 computedwith lsquobkdeRrsquo and a map with sites of coordinates (long lat) Each site is associated to a value ofvar1 and var2 and the two windows are interactive
Usage
dbledensitymap(long lat var1 var2kernel=triweight listvar = NULLlistnomvar = NULL carte = NULL criteria = NULL label = symbol = 0 color = 1 labvar = c(var1 var2) axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
dbledensitymap 21
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar list of character with names of variables var1 and var2
axis 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 user can choose an interval on the density curve by mouse clicking on the lower and upperboundaries of the interval or by giving directly these values The selected sites are then representedon the map in red A selection by lsquopointsrsquo or lsquopolygonrsquo on the map results in the drawing of thedensity of the corresponding sub-distribution on the density plot Finally the user can modify thebandwith parameter with a cursor in the tcltk window (parameter α) α is the smoothing parameterfor the kernel smooth it represents the mean percentage of sample points involved in the localaveraging (example α = 20 means that on average ntimes 02 points are in any interval of length 2hwhere h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
22 dblehistomap
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dbledensitymap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785))) listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-dbledensitymap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)dbledensitymap(eire$V1eire$V2eire$Aeire$townslabvar=c(Taux dindividus au groupe sanguin ASurface urbaine)carte=eirecontourskernel=normallistvar=eirelistnomvar=names(eire))
dblehistomap Double Interactive Histogram and map
Description
The function lsquodblehistomaprsquo draws two histograms of the given variables var1 and var2 and a mapwith sites of coordinates (long lat) Each site is associated to a value of var1 and var2 and thereis interactivity between the two windows created
dblehistomap 23
Usage
dblehistomap(long lat var1 var2 listvar = NULL listnomvar = NULLnbcol1 = 10 nbcol2 = 10 carte = NULL criteria = NULLsymbol = 0 color = 1 labvar = c( ) label = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
nbcol1 number of cells for histogram 1 (10 by default)
nbcol2 number of cells for histogram 2 (10 by default)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
24 densitymap
Details
The selection of sites by lsquopointsrsquo or lsquopolygonsrsquo on the map results in the drawing of the red his-tograms of the subdistributions corresponding to this subset of sites
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dblehistomap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785)))listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadblehistomap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
densitymap Kernel density estimates and map
Description
The function lsquodensitymaprsquo draws kernel density estimates of the variable var with rsquobkdeRrsquo anda map with sites of coordinate (long lat) Each site is associated to a value of var and there isinteractivity between the two windows
densitymap 25
Usage
densitymap(long lat varkernel=triweightlistvar=NULLlistnomvar=NULLcarte=NULL criteria=NULLlabel=symbol=0color=1 labvar=axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
labvar name of variable var
axis 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
26 densitymap
Details
The user can choose an interval on the density curve by mouse clicking on the graph on the extremi-ties of interval or by specifying directly values The sites selected by an interval are then representedon the map in red The selection of sites on the map by lsquopointsrsquo or lsquopolygonrsquo results in the draw-ing of the kernel densities of the subdistributions corresponding to this subset of sites Finally theuser can modify the bandwith parameter with a cursor in the tcltk window (parameter α) α is thesmoothing parameter for the kernel smooth it represents the mean percentage of sample pointsinvolved in the local averaging (example α = 20 means that on average ntimes 02 points are in anyinterval of length 2h where h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
library tcltk and KernSmooth data olcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)densitymap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadensitymap(colombuscontours$Xcolombuscontours$Ycolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)
distchi2 27
data(eirepolys)eirecontourslt-polylist2list(eirepolys)densitymap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
distchi2 It gives an euclidian distance matrix for factors using metric of χ2
Description
The function lsquodistchi2rsquo calculates an euclidian distance matrix for factors using metric of χ2
Usage
distchi2(mat)
Arguments
mat A matrix of factors given as numeric values
Details
The euclidian distance between two individuals i and k using the metric of χ2 is given by
d2χ2 =
n
p
sumj
p
mjsuml
δjlik
1nj
l
with n number of individuals p number of variables mj is the number of possibilities for variableY j nj
l is the number of individuals where l has been observed for Y j and δjlik = 1 if there is a
discordance between i and k for l and 0 otherwise It is not an interactive function
Value
It returns a dist object (see help(dist))
Author(s)
Laurent Thibault
References
Besse Philippe ldquoData mining 2 Modeacutelisation statistique et apprentissagerdquo Publication du LSPhttpwwwlspups-tlsefrBesse
See Also
clustermap
28 driftmap
driftmap Detection of an eventual trend
Description
The function lsquodriftmaprsquo creates a grid on the map and calculates the mean and median for each cellThe right plot (resp left plot) represents means and medians calculated by row (resp column)
Usage
driftmap(long lat var interpol = 1nuage = 0 carte = NULLlablong = lablat = labvar = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
interpol if 1 the mean and median calculated are linearly interpoled
nuage if 1 the individuals are also represented on the graphics
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
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
labvar name of variable lsquovarrsquo
Details
Possibility to change the number of cells in the grid with the tcltk window to interpolate the meansand medians calculated (by default) to work on a rotated map Notice that this is not an interactivefunction
Value
No values returned only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
eire 29
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmaprotation
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)driftmap(auckland$Eastingauckland$Northingauckland$Deaths197785interpol=0nuage=1lablong=Xlablat=Ylabvar=Deaths197785)
data afcondata(afcon)driftmap(afcon$xafcon$yafcon$totconinterpol=0nuage=1lablong=Xlablat=Ylabvar=Number of conflicts)
data meusedata(meuseall)data(meuseriv)driftmap(meuseall$xmeuseall$ymeuseall$coppernuage=1lablong=Xlablat=Ylabvar=Concentration de cuivre (en ppm))
eire Eire data sets
Description
The lsquoeirersquo data frame has 26 rows and 11 columns
Usage
data(eire)
Format
A data frame with 26 observations on the following 11 variables
V1 a vector x of size n
V2 a vector y of size n
A Percentage of sample with blood group A
towns Townsunit area
pale Beyond the Pale 0 within the Pale 1
size number of blood type samples
ROADACC arterial road network accessibility in 1961
30 eirepolys
OWNCONS percentage in value terms of gross agricultural output of each county consumed by itself
POPCHG 1961 population as percentage of 1926
RETSALE value of retail sales c000
INCOME total personal income c000
Details
This data provides from spdep package
Source
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
Examples
data(eire)
eirepolys Spatial polygonal contours of eire dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of eiredataset
Usage
data(eirepolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or rsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibility torepesent spatial polygonal contours as a backgroud map Thatrsquos why we create functions lsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of the polygons
Source
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
findneighbors 31
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
findneighbors Research of the m nearest neighbors for sites
Description
The function lsquofindneighborsrsquo gives for each site of coordinates (xc yc) the m nearest neighbors inthe set of sites
Usage
findneighbors(xc yc m)
Arguments
xc a numerical vector x of size n
yc a numerical vector y of size n
m number of nearest neighbors
Details
In case of ties the nearest neighbor is randomly chosen among the ties This function is called inmakeneighborswr
Value
A matrix of size ntimes n containing 1 on position (i j) if j is m-nearest neighbour to i
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakedistanceWmakeneighborsw
32 genpca
Examples
data(auckland)Wlt-findneighbors(auckland$Eastingauckland$Northing1)
genpca Generalized Principal Component Analysis (PCA)
Description
The function lsquogenpcarsquo computes a generalized Principal Component Analysis (PCA) It calculatesthe principal components the coordinates of the variables and in these principals components axesand the inertia of these principal components
Usage
genpca(data w=rep(1nrow(data)length=nrow(data)) m=diag(1ncol(data)ncol(data))center=TRUE reduc=TRUE)
Arguments
data matrix ntimes p
w vector of size n of weight (by default weight = t(1n 1n))
m matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centered PCA (by default center=TRUE)
reduc boolean if TRUE reduced PCA (by default reduce=TRUE)
Details
LetW = diag(w)
x = data = (xprime1 x
primen)prime
withxi = (x1
i xpi )
Let1n = (1 1)prime
with n rows and 1p = (1 1)prime
with p rows Normalization of weight
wi =wisumi wi
genpca 33
Vector of means x = (x1 xp)prime
withxj =
sumi
wixji
If center=Truexc = xminus 1nxprime
Standart deviation (σj)2 =
sumi
wi(xji )
2 minus (xj)2
Σ = diag((σ1)2 (σp)2)prime
If reduc=True xcr = xc times Σminus12
Variance-Covariance matrix
C = xprimecrWxcr
Cholesky decomposition M = LLprime where M=mLet
Cl = LCLprime
Let U and D as ClU = UD
with D = diag(λ1 λp)Let
V = LprimeU
Then Coordinates of individuals in the principals components basis
CC = xcrV
Coordinates of variables in principals components
V C = CV Dminus12
Inertia I = D1p
Value
Returns lsquoinertiarsquo vector of size p with percent of inertia of each component (corresponding to I)lsquocasecoordrsquo matrix ntimes p (corresponding to matrix CC) lsquovarcoordrsquo matrix ptimes p (corresponding tomatrix V C)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
34 gini
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermappcamap
gini Calculates a Gini Index
Description
The function lsquoginirsquo calculates the Gini Index associated to the variable lsquovarrsquo
Usage
gini(var)
Arguments
var a vector of numerical values of size n
Details
Let xk k = 1 K be the distinct values taken by V ar For each site Ginir returns two pairs offrequencies The pair (f g) where f represents
fk =1n
sumi
1(V ari = xk)
(n is the length of lsquovarrsquo) and g represents
gk =xk
xfk
The pair (FG) represents the corresponding cumulative frequenciesThe Gini Index is calculated as
IG =12x
Ksumi=1
Ksumj=1
|xi minus xj |
Value
(f F g G gini) where f F g and G are vectors of size K and gini a numeric value
Note
This function is used in ginimapR but it is not an interactive function
ginimap 35
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
ginimap
ginimap Lorentz curve and map
Description
The function lsquoginimaprsquo computes a Lorentz curve from rsquovarrsquo and calculates the Gini Index associ-ated to var
Usage
ginimap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
20 dbledensitymap
data avifaunelibrary(ade4)data(mafragh)dlt-distchi2(mafragh$flo)
obslt-clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4method=hclusttype=wardlistvar=mafragh$partitionlistnomvar=class)
claslt-obs$vectclasselt-by(dclasmean)glt-rbind(e[1]$1e[2]$2e[3]$3e[4]$4)
clustermap(xlt-mafragh$xy[1]ylt-mafragh$xy[2]d4centers=glistvar=mafragh$partitionlistnomvar=class)
dbledensitymap Double Kernel density estimates and map
Description
The function lsquodbledensitymaprsquo plots two kernel density estimates from var1 and var2 computedwith lsquobkdeRrsquo and a map with sites of coordinates (long lat) Each site is associated to a value ofvar1 and var2 and the two windows are interactive
Usage
dbledensitymap(long lat var1 var2kernel=triweight listvar = NULLlistnomvar = NULL carte = NULL criteria = NULL label = symbol = 0 color = 1 labvar = c(var1 var2) axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
dbledensitymap 21
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar list of character with names of variables var1 and var2
axis 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 user can choose an interval on the density curve by mouse clicking on the lower and upperboundaries of the interval or by giving directly these values The selected sites are then representedon the map in red A selection by lsquopointsrsquo or lsquopolygonrsquo on the map results in the drawing of thedensity of the corresponding sub-distribution on the density plot Finally the user can modify thebandwith parameter with a cursor in the tcltk window (parameter α) α is the smoothing parameterfor the kernel smooth it represents the mean percentage of sample points involved in the localaveraging (example α = 20 means that on average ntimes 02 points are in any interval of length 2hwhere h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
22 dblehistomap
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dbledensitymap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785))) listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-dbledensitymap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)dbledensitymap(eire$V1eire$V2eire$Aeire$townslabvar=c(Taux dindividus au groupe sanguin ASurface urbaine)carte=eirecontourskernel=normallistvar=eirelistnomvar=names(eire))
dblehistomap Double Interactive Histogram and map
Description
The function lsquodblehistomaprsquo draws two histograms of the given variables var1 and var2 and a mapwith sites of coordinates (long lat) Each site is associated to a value of var1 and var2 and thereis interactivity between the two windows created
dblehistomap 23
Usage
dblehistomap(long lat var1 var2 listvar = NULL listnomvar = NULLnbcol1 = 10 nbcol2 = 10 carte = NULL criteria = NULLsymbol = 0 color = 1 labvar = c( ) label = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
nbcol1 number of cells for histogram 1 (10 by default)
nbcol2 number of cells for histogram 2 (10 by default)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
24 densitymap
Details
The selection of sites by lsquopointsrsquo or lsquopolygonsrsquo on the map results in the drawing of the red his-tograms of the subdistributions corresponding to this subset of sites
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dblehistomap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785)))listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadblehistomap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
densitymap Kernel density estimates and map
Description
The function lsquodensitymaprsquo draws kernel density estimates of the variable var with rsquobkdeRrsquo anda map with sites of coordinate (long lat) Each site is associated to a value of var and there isinteractivity between the two windows
densitymap 25
Usage
densitymap(long lat varkernel=triweightlistvar=NULLlistnomvar=NULLcarte=NULL criteria=NULLlabel=symbol=0color=1 labvar=axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
labvar name of variable var
axis 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
26 densitymap
Details
The user can choose an interval on the density curve by mouse clicking on the graph on the extremi-ties of interval or by specifying directly values The sites selected by an interval are then representedon the map in red The selection of sites on the map by lsquopointsrsquo or lsquopolygonrsquo results in the draw-ing of the kernel densities of the subdistributions corresponding to this subset of sites Finally theuser can modify the bandwith parameter with a cursor in the tcltk window (parameter α) α is thesmoothing parameter for the kernel smooth it represents the mean percentage of sample pointsinvolved in the local averaging (example α = 20 means that on average ntimes 02 points are in anyinterval of length 2h where h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
library tcltk and KernSmooth data olcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)densitymap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadensitymap(colombuscontours$Xcolombuscontours$Ycolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)
distchi2 27
data(eirepolys)eirecontourslt-polylist2list(eirepolys)densitymap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
distchi2 It gives an euclidian distance matrix for factors using metric of χ2
Description
The function lsquodistchi2rsquo calculates an euclidian distance matrix for factors using metric of χ2
Usage
distchi2(mat)
Arguments
mat A matrix of factors given as numeric values
Details
The euclidian distance between two individuals i and k using the metric of χ2 is given by
d2χ2 =
n
p
sumj
p
mjsuml
δjlik
1nj
l
with n number of individuals p number of variables mj is the number of possibilities for variableY j nj
l is the number of individuals where l has been observed for Y j and δjlik = 1 if there is a
discordance between i and k for l and 0 otherwise It is not an interactive function
Value
It returns a dist object (see help(dist))
Author(s)
Laurent Thibault
References
Besse Philippe ldquoData mining 2 Modeacutelisation statistique et apprentissagerdquo Publication du LSPhttpwwwlspups-tlsefrBesse
See Also
clustermap
28 driftmap
driftmap Detection of an eventual trend
Description
The function lsquodriftmaprsquo creates a grid on the map and calculates the mean and median for each cellThe right plot (resp left plot) represents means and medians calculated by row (resp column)
Usage
driftmap(long lat var interpol = 1nuage = 0 carte = NULLlablong = lablat = labvar = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
interpol if 1 the mean and median calculated are linearly interpoled
nuage if 1 the individuals are also represented on the graphics
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
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
labvar name of variable lsquovarrsquo
Details
Possibility to change the number of cells in the grid with the tcltk window to interpolate the meansand medians calculated (by default) to work on a rotated map Notice that this is not an interactivefunction
Value
No values returned only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
eire 29
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmaprotation
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)driftmap(auckland$Eastingauckland$Northingauckland$Deaths197785interpol=0nuage=1lablong=Xlablat=Ylabvar=Deaths197785)
data afcondata(afcon)driftmap(afcon$xafcon$yafcon$totconinterpol=0nuage=1lablong=Xlablat=Ylabvar=Number of conflicts)
data meusedata(meuseall)data(meuseriv)driftmap(meuseall$xmeuseall$ymeuseall$coppernuage=1lablong=Xlablat=Ylabvar=Concentration de cuivre (en ppm))
eire Eire data sets
Description
The lsquoeirersquo data frame has 26 rows and 11 columns
Usage
data(eire)
Format
A data frame with 26 observations on the following 11 variables
V1 a vector x of size n
V2 a vector y of size n
A Percentage of sample with blood group A
towns Townsunit area
pale Beyond the Pale 0 within the Pale 1
size number of blood type samples
ROADACC arterial road network accessibility in 1961
30 eirepolys
OWNCONS percentage in value terms of gross agricultural output of each county consumed by itself
POPCHG 1961 population as percentage of 1926
RETSALE value of retail sales c000
INCOME total personal income c000
Details
This data provides from spdep package
Source
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
Examples
data(eire)
eirepolys Spatial polygonal contours of eire dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of eiredataset
Usage
data(eirepolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or rsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibility torepesent spatial polygonal contours as a backgroud map Thatrsquos why we create functions lsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of the polygons
Source
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
findneighbors 31
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
findneighbors Research of the m nearest neighbors for sites
Description
The function lsquofindneighborsrsquo gives for each site of coordinates (xc yc) the m nearest neighbors inthe set of sites
Usage
findneighbors(xc yc m)
Arguments
xc a numerical vector x of size n
yc a numerical vector y of size n
m number of nearest neighbors
Details
In case of ties the nearest neighbor is randomly chosen among the ties This function is called inmakeneighborswr
Value
A matrix of size ntimes n containing 1 on position (i j) if j is m-nearest neighbour to i
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakedistanceWmakeneighborsw
32 genpca
Examples
data(auckland)Wlt-findneighbors(auckland$Eastingauckland$Northing1)
genpca Generalized Principal Component Analysis (PCA)
Description
The function lsquogenpcarsquo computes a generalized Principal Component Analysis (PCA) It calculatesthe principal components the coordinates of the variables and in these principals components axesand the inertia of these principal components
Usage
genpca(data w=rep(1nrow(data)length=nrow(data)) m=diag(1ncol(data)ncol(data))center=TRUE reduc=TRUE)
Arguments
data matrix ntimes p
w vector of size n of weight (by default weight = t(1n 1n))
m matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centered PCA (by default center=TRUE)
reduc boolean if TRUE reduced PCA (by default reduce=TRUE)
Details
LetW = diag(w)
x = data = (xprime1 x
primen)prime
withxi = (x1
i xpi )
Let1n = (1 1)prime
with n rows and 1p = (1 1)prime
with p rows Normalization of weight
wi =wisumi wi
genpca 33
Vector of means x = (x1 xp)prime
withxj =
sumi
wixji
If center=Truexc = xminus 1nxprime
Standart deviation (σj)2 =
sumi
wi(xji )
2 minus (xj)2
Σ = diag((σ1)2 (σp)2)prime
If reduc=True xcr = xc times Σminus12
Variance-Covariance matrix
C = xprimecrWxcr
Cholesky decomposition M = LLprime where M=mLet
Cl = LCLprime
Let U and D as ClU = UD
with D = diag(λ1 λp)Let
V = LprimeU
Then Coordinates of individuals in the principals components basis
CC = xcrV
Coordinates of variables in principals components
V C = CV Dminus12
Inertia I = D1p
Value
Returns lsquoinertiarsquo vector of size p with percent of inertia of each component (corresponding to I)lsquocasecoordrsquo matrix ntimes p (corresponding to matrix CC) lsquovarcoordrsquo matrix ptimes p (corresponding tomatrix V C)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
34 gini
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermappcamap
gini Calculates a Gini Index
Description
The function lsquoginirsquo calculates the Gini Index associated to the variable lsquovarrsquo
Usage
gini(var)
Arguments
var a vector of numerical values of size n
Details
Let xk k = 1 K be the distinct values taken by V ar For each site Ginir returns two pairs offrequencies The pair (f g) where f represents
fk =1n
sumi
1(V ari = xk)
(n is the length of lsquovarrsquo) and g represents
gk =xk
xfk
The pair (FG) represents the corresponding cumulative frequenciesThe Gini Index is calculated as
IG =12x
Ksumi=1
Ksumj=1
|xi minus xj |
Value
(f F g G gini) where f F g and G are vectors of size K and gini a numeric value
Note
This function is used in ginimapR but it is not an interactive function
ginimap 35
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
ginimap
ginimap Lorentz curve and map
Description
The function lsquoginimaprsquo computes a Lorentz curve from rsquovarrsquo and calculates the Gini Index associ-ated to var
Usage
ginimap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
dbledensitymap 21
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar list of character with names of variables var1 and var2
axis 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 user can choose an interval on the density curve by mouse clicking on the lower and upperboundaries of the interval or by giving directly these values The selected sites are then representedon the map in red A selection by lsquopointsrsquo or lsquopolygonrsquo on the map results in the drawing of thedensity of the corresponding sub-distribution on the density plot Finally the user can modify thebandwith parameter with a cursor in the tcltk window (parameter α) α is the smoothing parameterfor the kernel smooth it represents the mean percentage of sample points involved in the localaveraging (example α = 20 means that on average ntimes 02 points are in any interval of length 2hwhere h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
22 dblehistomap
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dbledensitymap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785))) listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-dbledensitymap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)dbledensitymap(eire$V1eire$V2eire$Aeire$townslabvar=c(Taux dindividus au groupe sanguin ASurface urbaine)carte=eirecontourskernel=normallistvar=eirelistnomvar=names(eire))
dblehistomap Double Interactive Histogram and map
Description
The function lsquodblehistomaprsquo draws two histograms of the given variables var1 and var2 and a mapwith sites of coordinates (long lat) Each site is associated to a value of var1 and var2 and thereis interactivity between the two windows created
dblehistomap 23
Usage
dblehistomap(long lat var1 var2 listvar = NULL listnomvar = NULLnbcol1 = 10 nbcol2 = 10 carte = NULL criteria = NULLsymbol = 0 color = 1 labvar = c( ) label = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
nbcol1 number of cells for histogram 1 (10 by default)
nbcol2 number of cells for histogram 2 (10 by default)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
24 densitymap
Details
The selection of sites by lsquopointsrsquo or lsquopolygonsrsquo on the map results in the drawing of the red his-tograms of the subdistributions corresponding to this subset of sites
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dblehistomap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785)))listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadblehistomap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
densitymap Kernel density estimates and map
Description
The function lsquodensitymaprsquo draws kernel density estimates of the variable var with rsquobkdeRrsquo anda map with sites of coordinate (long lat) Each site is associated to a value of var and there isinteractivity between the two windows
densitymap 25
Usage
densitymap(long lat varkernel=triweightlistvar=NULLlistnomvar=NULLcarte=NULL criteria=NULLlabel=symbol=0color=1 labvar=axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
labvar name of variable var
axis 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
26 densitymap
Details
The user can choose an interval on the density curve by mouse clicking on the graph on the extremi-ties of interval or by specifying directly values The sites selected by an interval are then representedon the map in red The selection of sites on the map by lsquopointsrsquo or lsquopolygonrsquo results in the draw-ing of the kernel densities of the subdistributions corresponding to this subset of sites Finally theuser can modify the bandwith parameter with a cursor in the tcltk window (parameter α) α is thesmoothing parameter for the kernel smooth it represents the mean percentage of sample pointsinvolved in the local averaging (example α = 20 means that on average ntimes 02 points are in anyinterval of length 2h where h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
library tcltk and KernSmooth data olcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)densitymap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadensitymap(colombuscontours$Xcolombuscontours$Ycolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)
distchi2 27
data(eirepolys)eirecontourslt-polylist2list(eirepolys)densitymap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
distchi2 It gives an euclidian distance matrix for factors using metric of χ2
Description
The function lsquodistchi2rsquo calculates an euclidian distance matrix for factors using metric of χ2
Usage
distchi2(mat)
Arguments
mat A matrix of factors given as numeric values
Details
The euclidian distance between two individuals i and k using the metric of χ2 is given by
d2χ2 =
n
p
sumj
p
mjsuml
δjlik
1nj
l
with n number of individuals p number of variables mj is the number of possibilities for variableY j nj
l is the number of individuals where l has been observed for Y j and δjlik = 1 if there is a
discordance between i and k for l and 0 otherwise It is not an interactive function
Value
It returns a dist object (see help(dist))
Author(s)
Laurent Thibault
References
Besse Philippe ldquoData mining 2 Modeacutelisation statistique et apprentissagerdquo Publication du LSPhttpwwwlspups-tlsefrBesse
See Also
clustermap
28 driftmap
driftmap Detection of an eventual trend
Description
The function lsquodriftmaprsquo creates a grid on the map and calculates the mean and median for each cellThe right plot (resp left plot) represents means and medians calculated by row (resp column)
Usage
driftmap(long lat var interpol = 1nuage = 0 carte = NULLlablong = lablat = labvar = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
interpol if 1 the mean and median calculated are linearly interpoled
nuage if 1 the individuals are also represented on the graphics
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
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
labvar name of variable lsquovarrsquo
Details
Possibility to change the number of cells in the grid with the tcltk window to interpolate the meansand medians calculated (by default) to work on a rotated map Notice that this is not an interactivefunction
Value
No values returned only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
eire 29
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmaprotation
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)driftmap(auckland$Eastingauckland$Northingauckland$Deaths197785interpol=0nuage=1lablong=Xlablat=Ylabvar=Deaths197785)
data afcondata(afcon)driftmap(afcon$xafcon$yafcon$totconinterpol=0nuage=1lablong=Xlablat=Ylabvar=Number of conflicts)
data meusedata(meuseall)data(meuseriv)driftmap(meuseall$xmeuseall$ymeuseall$coppernuage=1lablong=Xlablat=Ylabvar=Concentration de cuivre (en ppm))
eire Eire data sets
Description
The lsquoeirersquo data frame has 26 rows and 11 columns
Usage
data(eire)
Format
A data frame with 26 observations on the following 11 variables
V1 a vector x of size n
V2 a vector y of size n
A Percentage of sample with blood group A
towns Townsunit area
pale Beyond the Pale 0 within the Pale 1
size number of blood type samples
ROADACC arterial road network accessibility in 1961
30 eirepolys
OWNCONS percentage in value terms of gross agricultural output of each county consumed by itself
POPCHG 1961 population as percentage of 1926
RETSALE value of retail sales c000
INCOME total personal income c000
Details
This data provides from spdep package
Source
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
Examples
data(eire)
eirepolys Spatial polygonal contours of eire dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of eiredataset
Usage
data(eirepolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or rsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibility torepesent spatial polygonal contours as a backgroud map Thatrsquos why we create functions lsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of the polygons
Source
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
findneighbors 31
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
findneighbors Research of the m nearest neighbors for sites
Description
The function lsquofindneighborsrsquo gives for each site of coordinates (xc yc) the m nearest neighbors inthe set of sites
Usage
findneighbors(xc yc m)
Arguments
xc a numerical vector x of size n
yc a numerical vector y of size n
m number of nearest neighbors
Details
In case of ties the nearest neighbor is randomly chosen among the ties This function is called inmakeneighborswr
Value
A matrix of size ntimes n containing 1 on position (i j) if j is m-nearest neighbour to i
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakedistanceWmakeneighborsw
32 genpca
Examples
data(auckland)Wlt-findneighbors(auckland$Eastingauckland$Northing1)
genpca Generalized Principal Component Analysis (PCA)
Description
The function lsquogenpcarsquo computes a generalized Principal Component Analysis (PCA) It calculatesthe principal components the coordinates of the variables and in these principals components axesand the inertia of these principal components
Usage
genpca(data w=rep(1nrow(data)length=nrow(data)) m=diag(1ncol(data)ncol(data))center=TRUE reduc=TRUE)
Arguments
data matrix ntimes p
w vector of size n of weight (by default weight = t(1n 1n))
m matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centered PCA (by default center=TRUE)
reduc boolean if TRUE reduced PCA (by default reduce=TRUE)
Details
LetW = diag(w)
x = data = (xprime1 x
primen)prime
withxi = (x1
i xpi )
Let1n = (1 1)prime
with n rows and 1p = (1 1)prime
with p rows Normalization of weight
wi =wisumi wi
genpca 33
Vector of means x = (x1 xp)prime
withxj =
sumi
wixji
If center=Truexc = xminus 1nxprime
Standart deviation (σj)2 =
sumi
wi(xji )
2 minus (xj)2
Σ = diag((σ1)2 (σp)2)prime
If reduc=True xcr = xc times Σminus12
Variance-Covariance matrix
C = xprimecrWxcr
Cholesky decomposition M = LLprime where M=mLet
Cl = LCLprime
Let U and D as ClU = UD
with D = diag(λ1 λp)Let
V = LprimeU
Then Coordinates of individuals in the principals components basis
CC = xcrV
Coordinates of variables in principals components
V C = CV Dminus12
Inertia I = D1p
Value
Returns lsquoinertiarsquo vector of size p with percent of inertia of each component (corresponding to I)lsquocasecoordrsquo matrix ntimes p (corresponding to matrix CC) lsquovarcoordrsquo matrix ptimes p (corresponding tomatrix V C)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
34 gini
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermappcamap
gini Calculates a Gini Index
Description
The function lsquoginirsquo calculates the Gini Index associated to the variable lsquovarrsquo
Usage
gini(var)
Arguments
var a vector of numerical values of size n
Details
Let xk k = 1 K be the distinct values taken by V ar For each site Ginir returns two pairs offrequencies The pair (f g) where f represents
fk =1n
sumi
1(V ari = xk)
(n is the length of lsquovarrsquo) and g represents
gk =xk
xfk
The pair (FG) represents the corresponding cumulative frequenciesThe Gini Index is calculated as
IG =12x
Ksumi=1
Ksumj=1
|xi minus xj |
Value
(f F g G gini) where f F g and G are vectors of size K and gini a numeric value
Note
This function is used in ginimapR but it is not an interactive function
ginimap 35
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
ginimap
ginimap Lorentz curve and map
Description
The function lsquoginimaprsquo computes a Lorentz curve from rsquovarrsquo and calculates the Gini Index associ-ated to var
Usage
ginimap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
22 dblehistomap
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dbledensitymap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785))) listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-dbledensitymap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)dbledensitymap(eire$V1eire$V2eire$Aeire$townslabvar=c(Taux dindividus au groupe sanguin ASurface urbaine)carte=eirecontourskernel=normallistvar=eirelistnomvar=names(eire))
dblehistomap Double Interactive Histogram and map
Description
The function lsquodblehistomaprsquo draws two histograms of the given variables var1 and var2 and a mapwith sites of coordinates (long lat) Each site is associated to a value of var1 and var2 and thereis interactivity between the two windows created
dblehistomap 23
Usage
dblehistomap(long lat var1 var2 listvar = NULL listnomvar = NULLnbcol1 = 10 nbcol2 = 10 carte = NULL criteria = NULLsymbol = 0 color = 1 labvar = c( ) label = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
nbcol1 number of cells for histogram 1 (10 by default)
nbcol2 number of cells for histogram 2 (10 by default)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
24 densitymap
Details
The selection of sites by lsquopointsrsquo or lsquopolygonsrsquo on the map results in the drawing of the red his-tograms of the subdistributions corresponding to this subset of sites
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dblehistomap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785)))listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadblehistomap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
densitymap Kernel density estimates and map
Description
The function lsquodensitymaprsquo draws kernel density estimates of the variable var with rsquobkdeRrsquo anda map with sites of coordinate (long lat) Each site is associated to a value of var and there isinteractivity between the two windows
densitymap 25
Usage
densitymap(long lat varkernel=triweightlistvar=NULLlistnomvar=NULLcarte=NULL criteria=NULLlabel=symbol=0color=1 labvar=axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
labvar name of variable var
axis 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
26 densitymap
Details
The user can choose an interval on the density curve by mouse clicking on the graph on the extremi-ties of interval or by specifying directly values The sites selected by an interval are then representedon the map in red The selection of sites on the map by lsquopointsrsquo or lsquopolygonrsquo results in the draw-ing of the kernel densities of the subdistributions corresponding to this subset of sites Finally theuser can modify the bandwith parameter with a cursor in the tcltk window (parameter α) α is thesmoothing parameter for the kernel smooth it represents the mean percentage of sample pointsinvolved in the local averaging (example α = 20 means that on average ntimes 02 points are in anyinterval of length 2h where h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
library tcltk and KernSmooth data olcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)densitymap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadensitymap(colombuscontours$Xcolombuscontours$Ycolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)
distchi2 27
data(eirepolys)eirecontourslt-polylist2list(eirepolys)densitymap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
distchi2 It gives an euclidian distance matrix for factors using metric of χ2
Description
The function lsquodistchi2rsquo calculates an euclidian distance matrix for factors using metric of χ2
Usage
distchi2(mat)
Arguments
mat A matrix of factors given as numeric values
Details
The euclidian distance between two individuals i and k using the metric of χ2 is given by
d2χ2 =
n
p
sumj
p
mjsuml
δjlik
1nj
l
with n number of individuals p number of variables mj is the number of possibilities for variableY j nj
l is the number of individuals where l has been observed for Y j and δjlik = 1 if there is a
discordance between i and k for l and 0 otherwise It is not an interactive function
Value
It returns a dist object (see help(dist))
Author(s)
Laurent Thibault
References
Besse Philippe ldquoData mining 2 Modeacutelisation statistique et apprentissagerdquo Publication du LSPhttpwwwlspups-tlsefrBesse
See Also
clustermap
28 driftmap
driftmap Detection of an eventual trend
Description
The function lsquodriftmaprsquo creates a grid on the map and calculates the mean and median for each cellThe right plot (resp left plot) represents means and medians calculated by row (resp column)
Usage
driftmap(long lat var interpol = 1nuage = 0 carte = NULLlablong = lablat = labvar = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
interpol if 1 the mean and median calculated are linearly interpoled
nuage if 1 the individuals are also represented on the graphics
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
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
labvar name of variable lsquovarrsquo
Details
Possibility to change the number of cells in the grid with the tcltk window to interpolate the meansand medians calculated (by default) to work on a rotated map Notice that this is not an interactivefunction
Value
No values returned only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
eire 29
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmaprotation
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)driftmap(auckland$Eastingauckland$Northingauckland$Deaths197785interpol=0nuage=1lablong=Xlablat=Ylabvar=Deaths197785)
data afcondata(afcon)driftmap(afcon$xafcon$yafcon$totconinterpol=0nuage=1lablong=Xlablat=Ylabvar=Number of conflicts)
data meusedata(meuseall)data(meuseriv)driftmap(meuseall$xmeuseall$ymeuseall$coppernuage=1lablong=Xlablat=Ylabvar=Concentration de cuivre (en ppm))
eire Eire data sets
Description
The lsquoeirersquo data frame has 26 rows and 11 columns
Usage
data(eire)
Format
A data frame with 26 observations on the following 11 variables
V1 a vector x of size n
V2 a vector y of size n
A Percentage of sample with blood group A
towns Townsunit area
pale Beyond the Pale 0 within the Pale 1
size number of blood type samples
ROADACC arterial road network accessibility in 1961
30 eirepolys
OWNCONS percentage in value terms of gross agricultural output of each county consumed by itself
POPCHG 1961 population as percentage of 1926
RETSALE value of retail sales c000
INCOME total personal income c000
Details
This data provides from spdep package
Source
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
Examples
data(eire)
eirepolys Spatial polygonal contours of eire dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of eiredataset
Usage
data(eirepolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or rsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibility torepesent spatial polygonal contours as a backgroud map Thatrsquos why we create functions lsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of the polygons
Source
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
findneighbors 31
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
findneighbors Research of the m nearest neighbors for sites
Description
The function lsquofindneighborsrsquo gives for each site of coordinates (xc yc) the m nearest neighbors inthe set of sites
Usage
findneighbors(xc yc m)
Arguments
xc a numerical vector x of size n
yc a numerical vector y of size n
m number of nearest neighbors
Details
In case of ties the nearest neighbor is randomly chosen among the ties This function is called inmakeneighborswr
Value
A matrix of size ntimes n containing 1 on position (i j) if j is m-nearest neighbour to i
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakedistanceWmakeneighborsw
32 genpca
Examples
data(auckland)Wlt-findneighbors(auckland$Eastingauckland$Northing1)
genpca Generalized Principal Component Analysis (PCA)
Description
The function lsquogenpcarsquo computes a generalized Principal Component Analysis (PCA) It calculatesthe principal components the coordinates of the variables and in these principals components axesand the inertia of these principal components
Usage
genpca(data w=rep(1nrow(data)length=nrow(data)) m=diag(1ncol(data)ncol(data))center=TRUE reduc=TRUE)
Arguments
data matrix ntimes p
w vector of size n of weight (by default weight = t(1n 1n))
m matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centered PCA (by default center=TRUE)
reduc boolean if TRUE reduced PCA (by default reduce=TRUE)
Details
LetW = diag(w)
x = data = (xprime1 x
primen)prime
withxi = (x1
i xpi )
Let1n = (1 1)prime
with n rows and 1p = (1 1)prime
with p rows Normalization of weight
wi =wisumi wi
genpca 33
Vector of means x = (x1 xp)prime
withxj =
sumi
wixji
If center=Truexc = xminus 1nxprime
Standart deviation (σj)2 =
sumi
wi(xji )
2 minus (xj)2
Σ = diag((σ1)2 (σp)2)prime
If reduc=True xcr = xc times Σminus12
Variance-Covariance matrix
C = xprimecrWxcr
Cholesky decomposition M = LLprime where M=mLet
Cl = LCLprime
Let U and D as ClU = UD
with D = diag(λ1 λp)Let
V = LprimeU
Then Coordinates of individuals in the principals components basis
CC = xcrV
Coordinates of variables in principals components
V C = CV Dminus12
Inertia I = D1p
Value
Returns lsquoinertiarsquo vector of size p with percent of inertia of each component (corresponding to I)lsquocasecoordrsquo matrix ntimes p (corresponding to matrix CC) lsquovarcoordrsquo matrix ptimes p (corresponding tomatrix V C)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
34 gini
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermappcamap
gini Calculates a Gini Index
Description
The function lsquoginirsquo calculates the Gini Index associated to the variable lsquovarrsquo
Usage
gini(var)
Arguments
var a vector of numerical values of size n
Details
Let xk k = 1 K be the distinct values taken by V ar For each site Ginir returns two pairs offrequencies The pair (f g) where f represents
fk =1n
sumi
1(V ari = xk)
(n is the length of lsquovarrsquo) and g represents
gk =xk
xfk
The pair (FG) represents the corresponding cumulative frequenciesThe Gini Index is calculated as
IG =12x
Ksumi=1
Ksumj=1
|xi minus xj |
Value
(f F g G gini) where f F g and G are vectors of size K and gini a numeric value
Note
This function is used in ginimapR but it is not an interactive function
ginimap 35
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
ginimap
ginimap Lorentz curve and map
Description
The function lsquoginimaprsquo computes a Lorentz curve from rsquovarrsquo and calculates the Gini Index associ-ated to var
Usage
ginimap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
dblehistomap 23
Usage
dblehistomap(long lat var1 var2 listvar = NULL listnomvar = NULLnbcol1 = 10 nbcol2 = 10 carte = NULL criteria = NULLsymbol = 0 color = 1 labvar = c( ) label = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
nbcol1 number of cells for histogram 1 (10 by default)
nbcol2 number of cells for histogram 2 (10 by default)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
24 densitymap
Details
The selection of sites by lsquopointsrsquo or lsquopolygonsrsquo on the map results in the drawing of the red his-tograms of the subdistributions corresponding to this subset of sites
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dblehistomap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785)))listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadblehistomap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
densitymap Kernel density estimates and map
Description
The function lsquodensitymaprsquo draws kernel density estimates of the variable var with rsquobkdeRrsquo anda map with sites of coordinate (long lat) Each site is associated to a value of var and there isinteractivity between the two windows
densitymap 25
Usage
densitymap(long lat varkernel=triweightlistvar=NULLlistnomvar=NULLcarte=NULL criteria=NULLlabel=symbol=0color=1 labvar=axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
labvar name of variable var
axis 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
26 densitymap
Details
The user can choose an interval on the density curve by mouse clicking on the graph on the extremi-ties of interval or by specifying directly values The sites selected by an interval are then representedon the map in red The selection of sites on the map by lsquopointsrsquo or lsquopolygonrsquo results in the draw-ing of the kernel densities of the subdistributions corresponding to this subset of sites Finally theuser can modify the bandwith parameter with a cursor in the tcltk window (parameter α) α is thesmoothing parameter for the kernel smooth it represents the mean percentage of sample pointsinvolved in the local averaging (example α = 20 means that on average ntimes 02 points are in anyinterval of length 2h where h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
library tcltk and KernSmooth data olcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)densitymap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadensitymap(colombuscontours$Xcolombuscontours$Ycolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)
distchi2 27
data(eirepolys)eirecontourslt-polylist2list(eirepolys)densitymap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
distchi2 It gives an euclidian distance matrix for factors using metric of χ2
Description
The function lsquodistchi2rsquo calculates an euclidian distance matrix for factors using metric of χ2
Usage
distchi2(mat)
Arguments
mat A matrix of factors given as numeric values
Details
The euclidian distance between two individuals i and k using the metric of χ2 is given by
d2χ2 =
n
p
sumj
p
mjsuml
δjlik
1nj
l
with n number of individuals p number of variables mj is the number of possibilities for variableY j nj
l is the number of individuals where l has been observed for Y j and δjlik = 1 if there is a
discordance between i and k for l and 0 otherwise It is not an interactive function
Value
It returns a dist object (see help(dist))
Author(s)
Laurent Thibault
References
Besse Philippe ldquoData mining 2 Modeacutelisation statistique et apprentissagerdquo Publication du LSPhttpwwwlspups-tlsefrBesse
See Also
clustermap
28 driftmap
driftmap Detection of an eventual trend
Description
The function lsquodriftmaprsquo creates a grid on the map and calculates the mean and median for each cellThe right plot (resp left plot) represents means and medians calculated by row (resp column)
Usage
driftmap(long lat var interpol = 1nuage = 0 carte = NULLlablong = lablat = labvar = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
interpol if 1 the mean and median calculated are linearly interpoled
nuage if 1 the individuals are also represented on the graphics
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
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
labvar name of variable lsquovarrsquo
Details
Possibility to change the number of cells in the grid with the tcltk window to interpolate the meansand medians calculated (by default) to work on a rotated map Notice that this is not an interactivefunction
Value
No values returned only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
eire 29
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmaprotation
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)driftmap(auckland$Eastingauckland$Northingauckland$Deaths197785interpol=0nuage=1lablong=Xlablat=Ylabvar=Deaths197785)
data afcondata(afcon)driftmap(afcon$xafcon$yafcon$totconinterpol=0nuage=1lablong=Xlablat=Ylabvar=Number of conflicts)
data meusedata(meuseall)data(meuseriv)driftmap(meuseall$xmeuseall$ymeuseall$coppernuage=1lablong=Xlablat=Ylabvar=Concentration de cuivre (en ppm))
eire Eire data sets
Description
The lsquoeirersquo data frame has 26 rows and 11 columns
Usage
data(eire)
Format
A data frame with 26 observations on the following 11 variables
V1 a vector x of size n
V2 a vector y of size n
A Percentage of sample with blood group A
towns Townsunit area
pale Beyond the Pale 0 within the Pale 1
size number of blood type samples
ROADACC arterial road network accessibility in 1961
30 eirepolys
OWNCONS percentage in value terms of gross agricultural output of each county consumed by itself
POPCHG 1961 population as percentage of 1926
RETSALE value of retail sales c000
INCOME total personal income c000
Details
This data provides from spdep package
Source
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
Examples
data(eire)
eirepolys Spatial polygonal contours of eire dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of eiredataset
Usage
data(eirepolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or rsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibility torepesent spatial polygonal contours as a backgroud map Thatrsquos why we create functions lsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of the polygons
Source
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
findneighbors 31
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
findneighbors Research of the m nearest neighbors for sites
Description
The function lsquofindneighborsrsquo gives for each site of coordinates (xc yc) the m nearest neighbors inthe set of sites
Usage
findneighbors(xc yc m)
Arguments
xc a numerical vector x of size n
yc a numerical vector y of size n
m number of nearest neighbors
Details
In case of ties the nearest neighbor is randomly chosen among the ties This function is called inmakeneighborswr
Value
A matrix of size ntimes n containing 1 on position (i j) if j is m-nearest neighbour to i
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakedistanceWmakeneighborsw
32 genpca
Examples
data(auckland)Wlt-findneighbors(auckland$Eastingauckland$Northing1)
genpca Generalized Principal Component Analysis (PCA)
Description
The function lsquogenpcarsquo computes a generalized Principal Component Analysis (PCA) It calculatesthe principal components the coordinates of the variables and in these principals components axesand the inertia of these principal components
Usage
genpca(data w=rep(1nrow(data)length=nrow(data)) m=diag(1ncol(data)ncol(data))center=TRUE reduc=TRUE)
Arguments
data matrix ntimes p
w vector of size n of weight (by default weight = t(1n 1n))
m matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centered PCA (by default center=TRUE)
reduc boolean if TRUE reduced PCA (by default reduce=TRUE)
Details
LetW = diag(w)
x = data = (xprime1 x
primen)prime
withxi = (x1
i xpi )
Let1n = (1 1)prime
with n rows and 1p = (1 1)prime
with p rows Normalization of weight
wi =wisumi wi
genpca 33
Vector of means x = (x1 xp)prime
withxj =
sumi
wixji
If center=Truexc = xminus 1nxprime
Standart deviation (σj)2 =
sumi
wi(xji )
2 minus (xj)2
Σ = diag((σ1)2 (σp)2)prime
If reduc=True xcr = xc times Σminus12
Variance-Covariance matrix
C = xprimecrWxcr
Cholesky decomposition M = LLprime where M=mLet
Cl = LCLprime
Let U and D as ClU = UD
with D = diag(λ1 λp)Let
V = LprimeU
Then Coordinates of individuals in the principals components basis
CC = xcrV
Coordinates of variables in principals components
V C = CV Dminus12
Inertia I = D1p
Value
Returns lsquoinertiarsquo vector of size p with percent of inertia of each component (corresponding to I)lsquocasecoordrsquo matrix ntimes p (corresponding to matrix CC) lsquovarcoordrsquo matrix ptimes p (corresponding tomatrix V C)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
34 gini
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermappcamap
gini Calculates a Gini Index
Description
The function lsquoginirsquo calculates the Gini Index associated to the variable lsquovarrsquo
Usage
gini(var)
Arguments
var a vector of numerical values of size n
Details
Let xk k = 1 K be the distinct values taken by V ar For each site Ginir returns two pairs offrequencies The pair (f g) where f represents
fk =1n
sumi
1(V ari = xk)
(n is the length of lsquovarrsquo) and g represents
gk =xk
xfk
The pair (FG) represents the corresponding cumulative frequenciesThe Gini Index is calculated as
IG =12x
Ksumi=1
Ksumj=1
|xi minus xj |
Value
(f F g G gini) where f F g and G are vectors of size K and gini a numeric value
Note
This function is used in ginimapR but it is not an interactive function
ginimap 35
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
ginimap
ginimap Lorentz curve and map
Description
The function lsquoginimaprsquo computes a Lorentz curve from rsquovarrsquo and calculates the Gini Index associ-ated to var
Usage
ginimap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
24 densitymap
Details
The selection of sites by lsquopointsrsquo or lsquopolygonsrsquo on the map results in the drawing of the red his-tograms of the subdistributions corresponding to this subset of sites
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)dblehistomap(auckland$Eastingauckland$Northingvar1=auckland$Deaths197785var2=auckland$Under51981carte=contoursaucklandlistvar=cbind(aucklandasnumeric(auckland$Deaths197785gtmean(auckland$Deaths197785)))listnomvar=c(names(auckland)sup to mean)labvar=c(Deaths197785Under51981)criteria=(auckland$Deaths197785gtmean(auckland$Deaths197785)))
data colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadblehistomap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
densitymap Kernel density estimates and map
Description
The function lsquodensitymaprsquo draws kernel density estimates of the variable var with rsquobkdeRrsquo anda map with sites of coordinate (long lat) Each site is associated to a value of var and there isinteractivity between the two windows
densitymap 25
Usage
densitymap(long lat varkernel=triweightlistvar=NULLlistnomvar=NULLcarte=NULL criteria=NULLlabel=symbol=0color=1 labvar=axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
labvar name of variable var
axis 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
26 densitymap
Details
The user can choose an interval on the density curve by mouse clicking on the graph on the extremi-ties of interval or by specifying directly values The sites selected by an interval are then representedon the map in red The selection of sites on the map by lsquopointsrsquo or lsquopolygonrsquo results in the draw-ing of the kernel densities of the subdistributions corresponding to this subset of sites Finally theuser can modify the bandwith parameter with a cursor in the tcltk window (parameter α) α is thesmoothing parameter for the kernel smooth it represents the mean percentage of sample pointsinvolved in the local averaging (example α = 20 means that on average ntimes 02 points are in anyinterval of length 2h where h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
library tcltk and KernSmooth data olcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)densitymap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadensitymap(colombuscontours$Xcolombuscontours$Ycolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)
distchi2 27
data(eirepolys)eirecontourslt-polylist2list(eirepolys)densitymap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
distchi2 It gives an euclidian distance matrix for factors using metric of χ2
Description
The function lsquodistchi2rsquo calculates an euclidian distance matrix for factors using metric of χ2
Usage
distchi2(mat)
Arguments
mat A matrix of factors given as numeric values
Details
The euclidian distance between two individuals i and k using the metric of χ2 is given by
d2χ2 =
n
p
sumj
p
mjsuml
δjlik
1nj
l
with n number of individuals p number of variables mj is the number of possibilities for variableY j nj
l is the number of individuals where l has been observed for Y j and δjlik = 1 if there is a
discordance between i and k for l and 0 otherwise It is not an interactive function
Value
It returns a dist object (see help(dist))
Author(s)
Laurent Thibault
References
Besse Philippe ldquoData mining 2 Modeacutelisation statistique et apprentissagerdquo Publication du LSPhttpwwwlspups-tlsefrBesse
See Also
clustermap
28 driftmap
driftmap Detection of an eventual trend
Description
The function lsquodriftmaprsquo creates a grid on the map and calculates the mean and median for each cellThe right plot (resp left plot) represents means and medians calculated by row (resp column)
Usage
driftmap(long lat var interpol = 1nuage = 0 carte = NULLlablong = lablat = labvar = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
interpol if 1 the mean and median calculated are linearly interpoled
nuage if 1 the individuals are also represented on the graphics
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
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
labvar name of variable lsquovarrsquo
Details
Possibility to change the number of cells in the grid with the tcltk window to interpolate the meansand medians calculated (by default) to work on a rotated map Notice that this is not an interactivefunction
Value
No values returned only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
eire 29
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmaprotation
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)driftmap(auckland$Eastingauckland$Northingauckland$Deaths197785interpol=0nuage=1lablong=Xlablat=Ylabvar=Deaths197785)
data afcondata(afcon)driftmap(afcon$xafcon$yafcon$totconinterpol=0nuage=1lablong=Xlablat=Ylabvar=Number of conflicts)
data meusedata(meuseall)data(meuseriv)driftmap(meuseall$xmeuseall$ymeuseall$coppernuage=1lablong=Xlablat=Ylabvar=Concentration de cuivre (en ppm))
eire Eire data sets
Description
The lsquoeirersquo data frame has 26 rows and 11 columns
Usage
data(eire)
Format
A data frame with 26 observations on the following 11 variables
V1 a vector x of size n
V2 a vector y of size n
A Percentage of sample with blood group A
towns Townsunit area
pale Beyond the Pale 0 within the Pale 1
size number of blood type samples
ROADACC arterial road network accessibility in 1961
30 eirepolys
OWNCONS percentage in value terms of gross agricultural output of each county consumed by itself
POPCHG 1961 population as percentage of 1926
RETSALE value of retail sales c000
INCOME total personal income c000
Details
This data provides from spdep package
Source
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
Examples
data(eire)
eirepolys Spatial polygonal contours of eire dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of eiredataset
Usage
data(eirepolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or rsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibility torepesent spatial polygonal contours as a backgroud map Thatrsquos why we create functions lsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of the polygons
Source
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
findneighbors 31
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
findneighbors Research of the m nearest neighbors for sites
Description
The function lsquofindneighborsrsquo gives for each site of coordinates (xc yc) the m nearest neighbors inthe set of sites
Usage
findneighbors(xc yc m)
Arguments
xc a numerical vector x of size n
yc a numerical vector y of size n
m number of nearest neighbors
Details
In case of ties the nearest neighbor is randomly chosen among the ties This function is called inmakeneighborswr
Value
A matrix of size ntimes n containing 1 on position (i j) if j is m-nearest neighbour to i
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakedistanceWmakeneighborsw
32 genpca
Examples
data(auckland)Wlt-findneighbors(auckland$Eastingauckland$Northing1)
genpca Generalized Principal Component Analysis (PCA)
Description
The function lsquogenpcarsquo computes a generalized Principal Component Analysis (PCA) It calculatesthe principal components the coordinates of the variables and in these principals components axesand the inertia of these principal components
Usage
genpca(data w=rep(1nrow(data)length=nrow(data)) m=diag(1ncol(data)ncol(data))center=TRUE reduc=TRUE)
Arguments
data matrix ntimes p
w vector of size n of weight (by default weight = t(1n 1n))
m matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centered PCA (by default center=TRUE)
reduc boolean if TRUE reduced PCA (by default reduce=TRUE)
Details
LetW = diag(w)
x = data = (xprime1 x
primen)prime
withxi = (x1
i xpi )
Let1n = (1 1)prime
with n rows and 1p = (1 1)prime
with p rows Normalization of weight
wi =wisumi wi
genpca 33
Vector of means x = (x1 xp)prime
withxj =
sumi
wixji
If center=Truexc = xminus 1nxprime
Standart deviation (σj)2 =
sumi
wi(xji )
2 minus (xj)2
Σ = diag((σ1)2 (σp)2)prime
If reduc=True xcr = xc times Σminus12
Variance-Covariance matrix
C = xprimecrWxcr
Cholesky decomposition M = LLprime where M=mLet
Cl = LCLprime
Let U and D as ClU = UD
with D = diag(λ1 λp)Let
V = LprimeU
Then Coordinates of individuals in the principals components basis
CC = xcrV
Coordinates of variables in principals components
V C = CV Dminus12
Inertia I = D1p
Value
Returns lsquoinertiarsquo vector of size p with percent of inertia of each component (corresponding to I)lsquocasecoordrsquo matrix ntimes p (corresponding to matrix CC) lsquovarcoordrsquo matrix ptimes p (corresponding tomatrix V C)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
34 gini
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermappcamap
gini Calculates a Gini Index
Description
The function lsquoginirsquo calculates the Gini Index associated to the variable lsquovarrsquo
Usage
gini(var)
Arguments
var a vector of numerical values of size n
Details
Let xk k = 1 K be the distinct values taken by V ar For each site Ginir returns two pairs offrequencies The pair (f g) where f represents
fk =1n
sumi
1(V ari = xk)
(n is the length of lsquovarrsquo) and g represents
gk =xk
xfk
The pair (FG) represents the corresponding cumulative frequenciesThe Gini Index is calculated as
IG =12x
Ksumi=1
Ksumj=1
|xi minus xj |
Value
(f F g G gini) where f F g and G are vectors of size K and gini a numeric value
Note
This function is used in ginimapR but it is not an interactive function
ginimap 35
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
ginimap
ginimap Lorentz curve and map
Description
The function lsquoginimaprsquo computes a Lorentz curve from rsquovarrsquo and calculates the Gini Index associ-ated to var
Usage
ginimap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
densitymap 25
Usage
densitymap(long lat varkernel=triweightlistvar=NULLlistnomvar=NULLcarte=NULL criteria=NULLlabel=symbol=0color=1 labvar=axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
kernel Smoothing kernel (see help(bkde) for list of options)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 choice of representation of selected points (if user has selected a barplotas an additionnal graph) If 0 sites are represented in blue if 1 sites are repre-sented with different colors for each factor
labvar name of variable var
axis 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
26 densitymap
Details
The user can choose an interval on the density curve by mouse clicking on the graph on the extremi-ties of interval or by specifying directly values The sites selected by an interval are then representedon the map in red The selection of sites on the map by lsquopointsrsquo or lsquopolygonrsquo results in the draw-ing of the kernel densities of the subdistributions corresponding to this subset of sites Finally theuser can modify the bandwith parameter with a cursor in the tcltk window (parameter α) α is thesmoothing parameter for the kernel smooth it represents the mean percentage of sample pointsinvolved in the local averaging (example α = 20 means that on average ntimes 02 points are in anyinterval of length 2h where h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
library tcltk and KernSmooth data olcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)densitymap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadensitymap(colombuscontours$Xcolombuscontours$Ycolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)
distchi2 27
data(eirepolys)eirecontourslt-polylist2list(eirepolys)densitymap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
distchi2 It gives an euclidian distance matrix for factors using metric of χ2
Description
The function lsquodistchi2rsquo calculates an euclidian distance matrix for factors using metric of χ2
Usage
distchi2(mat)
Arguments
mat A matrix of factors given as numeric values
Details
The euclidian distance between two individuals i and k using the metric of χ2 is given by
d2χ2 =
n
p
sumj
p
mjsuml
δjlik
1nj
l
with n number of individuals p number of variables mj is the number of possibilities for variableY j nj
l is the number of individuals where l has been observed for Y j and δjlik = 1 if there is a
discordance between i and k for l and 0 otherwise It is not an interactive function
Value
It returns a dist object (see help(dist))
Author(s)
Laurent Thibault
References
Besse Philippe ldquoData mining 2 Modeacutelisation statistique et apprentissagerdquo Publication du LSPhttpwwwlspups-tlsefrBesse
See Also
clustermap
28 driftmap
driftmap Detection of an eventual trend
Description
The function lsquodriftmaprsquo creates a grid on the map and calculates the mean and median for each cellThe right plot (resp left plot) represents means and medians calculated by row (resp column)
Usage
driftmap(long lat var interpol = 1nuage = 0 carte = NULLlablong = lablat = labvar = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
interpol if 1 the mean and median calculated are linearly interpoled
nuage if 1 the individuals are also represented on the graphics
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
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
labvar name of variable lsquovarrsquo
Details
Possibility to change the number of cells in the grid with the tcltk window to interpolate the meansand medians calculated (by default) to work on a rotated map Notice that this is not an interactivefunction
Value
No values returned only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
eire 29
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmaprotation
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)driftmap(auckland$Eastingauckland$Northingauckland$Deaths197785interpol=0nuage=1lablong=Xlablat=Ylabvar=Deaths197785)
data afcondata(afcon)driftmap(afcon$xafcon$yafcon$totconinterpol=0nuage=1lablong=Xlablat=Ylabvar=Number of conflicts)
data meusedata(meuseall)data(meuseriv)driftmap(meuseall$xmeuseall$ymeuseall$coppernuage=1lablong=Xlablat=Ylabvar=Concentration de cuivre (en ppm))
eire Eire data sets
Description
The lsquoeirersquo data frame has 26 rows and 11 columns
Usage
data(eire)
Format
A data frame with 26 observations on the following 11 variables
V1 a vector x of size n
V2 a vector y of size n
A Percentage of sample with blood group A
towns Townsunit area
pale Beyond the Pale 0 within the Pale 1
size number of blood type samples
ROADACC arterial road network accessibility in 1961
30 eirepolys
OWNCONS percentage in value terms of gross agricultural output of each county consumed by itself
POPCHG 1961 population as percentage of 1926
RETSALE value of retail sales c000
INCOME total personal income c000
Details
This data provides from spdep package
Source
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
Examples
data(eire)
eirepolys Spatial polygonal contours of eire dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of eiredataset
Usage
data(eirepolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or rsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibility torepesent spatial polygonal contours as a backgroud map Thatrsquos why we create functions lsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of the polygons
Source
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
findneighbors 31
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
findneighbors Research of the m nearest neighbors for sites
Description
The function lsquofindneighborsrsquo gives for each site of coordinates (xc yc) the m nearest neighbors inthe set of sites
Usage
findneighbors(xc yc m)
Arguments
xc a numerical vector x of size n
yc a numerical vector y of size n
m number of nearest neighbors
Details
In case of ties the nearest neighbor is randomly chosen among the ties This function is called inmakeneighborswr
Value
A matrix of size ntimes n containing 1 on position (i j) if j is m-nearest neighbour to i
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakedistanceWmakeneighborsw
32 genpca
Examples
data(auckland)Wlt-findneighbors(auckland$Eastingauckland$Northing1)
genpca Generalized Principal Component Analysis (PCA)
Description
The function lsquogenpcarsquo computes a generalized Principal Component Analysis (PCA) It calculatesthe principal components the coordinates of the variables and in these principals components axesand the inertia of these principal components
Usage
genpca(data w=rep(1nrow(data)length=nrow(data)) m=diag(1ncol(data)ncol(data))center=TRUE reduc=TRUE)
Arguments
data matrix ntimes p
w vector of size n of weight (by default weight = t(1n 1n))
m matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centered PCA (by default center=TRUE)
reduc boolean if TRUE reduced PCA (by default reduce=TRUE)
Details
LetW = diag(w)
x = data = (xprime1 x
primen)prime
withxi = (x1
i xpi )
Let1n = (1 1)prime
with n rows and 1p = (1 1)prime
with p rows Normalization of weight
wi =wisumi wi
genpca 33
Vector of means x = (x1 xp)prime
withxj =
sumi
wixji
If center=Truexc = xminus 1nxprime
Standart deviation (σj)2 =
sumi
wi(xji )
2 minus (xj)2
Σ = diag((σ1)2 (σp)2)prime
If reduc=True xcr = xc times Σminus12
Variance-Covariance matrix
C = xprimecrWxcr
Cholesky decomposition M = LLprime where M=mLet
Cl = LCLprime
Let U and D as ClU = UD
with D = diag(λ1 λp)Let
V = LprimeU
Then Coordinates of individuals in the principals components basis
CC = xcrV
Coordinates of variables in principals components
V C = CV Dminus12
Inertia I = D1p
Value
Returns lsquoinertiarsquo vector of size p with percent of inertia of each component (corresponding to I)lsquocasecoordrsquo matrix ntimes p (corresponding to matrix CC) lsquovarcoordrsquo matrix ptimes p (corresponding tomatrix V C)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
34 gini
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermappcamap
gini Calculates a Gini Index
Description
The function lsquoginirsquo calculates the Gini Index associated to the variable lsquovarrsquo
Usage
gini(var)
Arguments
var a vector of numerical values of size n
Details
Let xk k = 1 K be the distinct values taken by V ar For each site Ginir returns two pairs offrequencies The pair (f g) where f represents
fk =1n
sumi
1(V ari = xk)
(n is the length of lsquovarrsquo) and g represents
gk =xk
xfk
The pair (FG) represents the corresponding cumulative frequenciesThe Gini Index is calculated as
IG =12x
Ksumi=1
Ksumj=1
|xi minus xj |
Value
(f F g G gini) where f F g and G are vectors of size K and gini a numeric value
Note
This function is used in ginimapR but it is not an interactive function
ginimap 35
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
ginimap
ginimap Lorentz curve and map
Description
The function lsquoginimaprsquo computes a Lorentz curve from rsquovarrsquo and calculates the Gini Index associ-ated to var
Usage
ginimap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
26 densitymap
Details
The user can choose an interval on the density curve by mouse clicking on the graph on the extremi-ties of interval or by specifying directly values The sites selected by an interval are then representedon the map in red The selection of sites on the map by lsquopointsrsquo or lsquopolygonrsquo results in the draw-ing of the kernel densities of the subdistributions corresponding to this subset of sites Finally theuser can modify the bandwith parameter with a cursor in the tcltk window (parameter α) α is thesmoothing parameter for the kernel smooth it represents the mean percentage of sample pointsinvolved in the local averaging (example α = 20 means that on average ntimes 02 points are in anyinterval of length 2h where h is the usual bandwidth)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Venables W N and Ripley B D (2002) ldquoModern Applied Statistics with Srdquo New York Springer
Wand MP et Jones MC (1995) ldquoKernel Smoothingrdquo Chapman amp Hall
See Also
histomap histobarmap scattermap densitymap
Examples
library tcltk and KernSmooth data olcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)densitymap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcolcarte=contoursOLD listnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME)))
data columbusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdatadensitymap(colombuscontours$Xcolombuscontours$Ycolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
data eiredata(eire)
distchi2 27
data(eirepolys)eirecontourslt-polylist2list(eirepolys)densitymap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
distchi2 It gives an euclidian distance matrix for factors using metric of χ2
Description
The function lsquodistchi2rsquo calculates an euclidian distance matrix for factors using metric of χ2
Usage
distchi2(mat)
Arguments
mat A matrix of factors given as numeric values
Details
The euclidian distance between two individuals i and k using the metric of χ2 is given by
d2χ2 =
n
p
sumj
p
mjsuml
δjlik
1nj
l
with n number of individuals p number of variables mj is the number of possibilities for variableY j nj
l is the number of individuals where l has been observed for Y j and δjlik = 1 if there is a
discordance between i and k for l and 0 otherwise It is not an interactive function
Value
It returns a dist object (see help(dist))
Author(s)
Laurent Thibault
References
Besse Philippe ldquoData mining 2 Modeacutelisation statistique et apprentissagerdquo Publication du LSPhttpwwwlspups-tlsefrBesse
See Also
clustermap
28 driftmap
driftmap Detection of an eventual trend
Description
The function lsquodriftmaprsquo creates a grid on the map and calculates the mean and median for each cellThe right plot (resp left plot) represents means and medians calculated by row (resp column)
Usage
driftmap(long lat var interpol = 1nuage = 0 carte = NULLlablong = lablat = labvar = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
interpol if 1 the mean and median calculated are linearly interpoled
nuage if 1 the individuals are also represented on the graphics
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
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
labvar name of variable lsquovarrsquo
Details
Possibility to change the number of cells in the grid with the tcltk window to interpolate the meansand medians calculated (by default) to work on a rotated map Notice that this is not an interactivefunction
Value
No values returned only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
eire 29
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmaprotation
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)driftmap(auckland$Eastingauckland$Northingauckland$Deaths197785interpol=0nuage=1lablong=Xlablat=Ylabvar=Deaths197785)
data afcondata(afcon)driftmap(afcon$xafcon$yafcon$totconinterpol=0nuage=1lablong=Xlablat=Ylabvar=Number of conflicts)
data meusedata(meuseall)data(meuseriv)driftmap(meuseall$xmeuseall$ymeuseall$coppernuage=1lablong=Xlablat=Ylabvar=Concentration de cuivre (en ppm))
eire Eire data sets
Description
The lsquoeirersquo data frame has 26 rows and 11 columns
Usage
data(eire)
Format
A data frame with 26 observations on the following 11 variables
V1 a vector x of size n
V2 a vector y of size n
A Percentage of sample with blood group A
towns Townsunit area
pale Beyond the Pale 0 within the Pale 1
size number of blood type samples
ROADACC arterial road network accessibility in 1961
30 eirepolys
OWNCONS percentage in value terms of gross agricultural output of each county consumed by itself
POPCHG 1961 population as percentage of 1926
RETSALE value of retail sales c000
INCOME total personal income c000
Details
This data provides from spdep package
Source
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
Examples
data(eire)
eirepolys Spatial polygonal contours of eire dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of eiredataset
Usage
data(eirepolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or rsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibility torepesent spatial polygonal contours as a backgroud map Thatrsquos why we create functions lsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of the polygons
Source
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
findneighbors 31
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
findneighbors Research of the m nearest neighbors for sites
Description
The function lsquofindneighborsrsquo gives for each site of coordinates (xc yc) the m nearest neighbors inthe set of sites
Usage
findneighbors(xc yc m)
Arguments
xc a numerical vector x of size n
yc a numerical vector y of size n
m number of nearest neighbors
Details
In case of ties the nearest neighbor is randomly chosen among the ties This function is called inmakeneighborswr
Value
A matrix of size ntimes n containing 1 on position (i j) if j is m-nearest neighbour to i
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakedistanceWmakeneighborsw
32 genpca
Examples
data(auckland)Wlt-findneighbors(auckland$Eastingauckland$Northing1)
genpca Generalized Principal Component Analysis (PCA)
Description
The function lsquogenpcarsquo computes a generalized Principal Component Analysis (PCA) It calculatesthe principal components the coordinates of the variables and in these principals components axesand the inertia of these principal components
Usage
genpca(data w=rep(1nrow(data)length=nrow(data)) m=diag(1ncol(data)ncol(data))center=TRUE reduc=TRUE)
Arguments
data matrix ntimes p
w vector of size n of weight (by default weight = t(1n 1n))
m matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centered PCA (by default center=TRUE)
reduc boolean if TRUE reduced PCA (by default reduce=TRUE)
Details
LetW = diag(w)
x = data = (xprime1 x
primen)prime
withxi = (x1
i xpi )
Let1n = (1 1)prime
with n rows and 1p = (1 1)prime
with p rows Normalization of weight
wi =wisumi wi
genpca 33
Vector of means x = (x1 xp)prime
withxj =
sumi
wixji
If center=Truexc = xminus 1nxprime
Standart deviation (σj)2 =
sumi
wi(xji )
2 minus (xj)2
Σ = diag((σ1)2 (σp)2)prime
If reduc=True xcr = xc times Σminus12
Variance-Covariance matrix
C = xprimecrWxcr
Cholesky decomposition M = LLprime where M=mLet
Cl = LCLprime
Let U and D as ClU = UD
with D = diag(λ1 λp)Let
V = LprimeU
Then Coordinates of individuals in the principals components basis
CC = xcrV
Coordinates of variables in principals components
V C = CV Dminus12
Inertia I = D1p
Value
Returns lsquoinertiarsquo vector of size p with percent of inertia of each component (corresponding to I)lsquocasecoordrsquo matrix ntimes p (corresponding to matrix CC) lsquovarcoordrsquo matrix ptimes p (corresponding tomatrix V C)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
34 gini
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermappcamap
gini Calculates a Gini Index
Description
The function lsquoginirsquo calculates the Gini Index associated to the variable lsquovarrsquo
Usage
gini(var)
Arguments
var a vector of numerical values of size n
Details
Let xk k = 1 K be the distinct values taken by V ar For each site Ginir returns two pairs offrequencies The pair (f g) where f represents
fk =1n
sumi
1(V ari = xk)
(n is the length of lsquovarrsquo) and g represents
gk =xk
xfk
The pair (FG) represents the corresponding cumulative frequenciesThe Gini Index is calculated as
IG =12x
Ksumi=1
Ksumj=1
|xi minus xj |
Value
(f F g G gini) where f F g and G are vectors of size K and gini a numeric value
Note
This function is used in ginimapR but it is not an interactive function
ginimap 35
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
ginimap
ginimap Lorentz curve and map
Description
The function lsquoginimaprsquo computes a Lorentz curve from rsquovarrsquo and calculates the Gini Index associ-ated to var
Usage
ginimap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
distchi2 27
data(eirepolys)eirecontourslt-polylist2list(eirepolys)densitymap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
distchi2 It gives an euclidian distance matrix for factors using metric of χ2
Description
The function lsquodistchi2rsquo calculates an euclidian distance matrix for factors using metric of χ2
Usage
distchi2(mat)
Arguments
mat A matrix of factors given as numeric values
Details
The euclidian distance between two individuals i and k using the metric of χ2 is given by
d2χ2 =
n
p
sumj
p
mjsuml
δjlik
1nj
l
with n number of individuals p number of variables mj is the number of possibilities for variableY j nj
l is the number of individuals where l has been observed for Y j and δjlik = 1 if there is a
discordance between i and k for l and 0 otherwise It is not an interactive function
Value
It returns a dist object (see help(dist))
Author(s)
Laurent Thibault
References
Besse Philippe ldquoData mining 2 Modeacutelisation statistique et apprentissagerdquo Publication du LSPhttpwwwlspups-tlsefrBesse
See Also
clustermap
28 driftmap
driftmap Detection of an eventual trend
Description
The function lsquodriftmaprsquo creates a grid on the map and calculates the mean and median for each cellThe right plot (resp left plot) represents means and medians calculated by row (resp column)
Usage
driftmap(long lat var interpol = 1nuage = 0 carte = NULLlablong = lablat = labvar = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
interpol if 1 the mean and median calculated are linearly interpoled
nuage if 1 the individuals are also represented on the graphics
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
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
labvar name of variable lsquovarrsquo
Details
Possibility to change the number of cells in the grid with the tcltk window to interpolate the meansand medians calculated (by default) to work on a rotated map Notice that this is not an interactivefunction
Value
No values returned only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
eire 29
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmaprotation
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)driftmap(auckland$Eastingauckland$Northingauckland$Deaths197785interpol=0nuage=1lablong=Xlablat=Ylabvar=Deaths197785)
data afcondata(afcon)driftmap(afcon$xafcon$yafcon$totconinterpol=0nuage=1lablong=Xlablat=Ylabvar=Number of conflicts)
data meusedata(meuseall)data(meuseriv)driftmap(meuseall$xmeuseall$ymeuseall$coppernuage=1lablong=Xlablat=Ylabvar=Concentration de cuivre (en ppm))
eire Eire data sets
Description
The lsquoeirersquo data frame has 26 rows and 11 columns
Usage
data(eire)
Format
A data frame with 26 observations on the following 11 variables
V1 a vector x of size n
V2 a vector y of size n
A Percentage of sample with blood group A
towns Townsunit area
pale Beyond the Pale 0 within the Pale 1
size number of blood type samples
ROADACC arterial road network accessibility in 1961
30 eirepolys
OWNCONS percentage in value terms of gross agricultural output of each county consumed by itself
POPCHG 1961 population as percentage of 1926
RETSALE value of retail sales c000
INCOME total personal income c000
Details
This data provides from spdep package
Source
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
Examples
data(eire)
eirepolys Spatial polygonal contours of eire dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of eiredataset
Usage
data(eirepolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or rsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibility torepesent spatial polygonal contours as a backgroud map Thatrsquos why we create functions lsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of the polygons
Source
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
findneighbors 31
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
findneighbors Research of the m nearest neighbors for sites
Description
The function lsquofindneighborsrsquo gives for each site of coordinates (xc yc) the m nearest neighbors inthe set of sites
Usage
findneighbors(xc yc m)
Arguments
xc a numerical vector x of size n
yc a numerical vector y of size n
m number of nearest neighbors
Details
In case of ties the nearest neighbor is randomly chosen among the ties This function is called inmakeneighborswr
Value
A matrix of size ntimes n containing 1 on position (i j) if j is m-nearest neighbour to i
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakedistanceWmakeneighborsw
32 genpca
Examples
data(auckland)Wlt-findneighbors(auckland$Eastingauckland$Northing1)
genpca Generalized Principal Component Analysis (PCA)
Description
The function lsquogenpcarsquo computes a generalized Principal Component Analysis (PCA) It calculatesthe principal components the coordinates of the variables and in these principals components axesand the inertia of these principal components
Usage
genpca(data w=rep(1nrow(data)length=nrow(data)) m=diag(1ncol(data)ncol(data))center=TRUE reduc=TRUE)
Arguments
data matrix ntimes p
w vector of size n of weight (by default weight = t(1n 1n))
m matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centered PCA (by default center=TRUE)
reduc boolean if TRUE reduced PCA (by default reduce=TRUE)
Details
LetW = diag(w)
x = data = (xprime1 x
primen)prime
withxi = (x1
i xpi )
Let1n = (1 1)prime
with n rows and 1p = (1 1)prime
with p rows Normalization of weight
wi =wisumi wi
genpca 33
Vector of means x = (x1 xp)prime
withxj =
sumi
wixji
If center=Truexc = xminus 1nxprime
Standart deviation (σj)2 =
sumi
wi(xji )
2 minus (xj)2
Σ = diag((σ1)2 (σp)2)prime
If reduc=True xcr = xc times Σminus12
Variance-Covariance matrix
C = xprimecrWxcr
Cholesky decomposition M = LLprime where M=mLet
Cl = LCLprime
Let U and D as ClU = UD
with D = diag(λ1 λp)Let
V = LprimeU
Then Coordinates of individuals in the principals components basis
CC = xcrV
Coordinates of variables in principals components
V C = CV Dminus12
Inertia I = D1p
Value
Returns lsquoinertiarsquo vector of size p with percent of inertia of each component (corresponding to I)lsquocasecoordrsquo matrix ntimes p (corresponding to matrix CC) lsquovarcoordrsquo matrix ptimes p (corresponding tomatrix V C)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
34 gini
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermappcamap
gini Calculates a Gini Index
Description
The function lsquoginirsquo calculates the Gini Index associated to the variable lsquovarrsquo
Usage
gini(var)
Arguments
var a vector of numerical values of size n
Details
Let xk k = 1 K be the distinct values taken by V ar For each site Ginir returns two pairs offrequencies The pair (f g) where f represents
fk =1n
sumi
1(V ari = xk)
(n is the length of lsquovarrsquo) and g represents
gk =xk
xfk
The pair (FG) represents the corresponding cumulative frequenciesThe Gini Index is calculated as
IG =12x
Ksumi=1
Ksumj=1
|xi minus xj |
Value
(f F g G gini) where f F g and G are vectors of size K and gini a numeric value
Note
This function is used in ginimapR but it is not an interactive function
ginimap 35
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
ginimap
ginimap Lorentz curve and map
Description
The function lsquoginimaprsquo computes a Lorentz curve from rsquovarrsquo and calculates the Gini Index associ-ated to var
Usage
ginimap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
28 driftmap
driftmap Detection of an eventual trend
Description
The function lsquodriftmaprsquo creates a grid on the map and calculates the mean and median for each cellThe right plot (resp left plot) represents means and medians calculated by row (resp column)
Usage
driftmap(long lat var interpol = 1nuage = 0 carte = NULLlablong = lablat = labvar = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
interpol if 1 the mean and median calculated are linearly interpoled
nuage if 1 the individuals are also represented on the graphics
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
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
labvar name of variable lsquovarrsquo
Details
Possibility to change the number of cells in the grid with the tcltk window to interpolate the meansand medians calculated (by default) to work on a rotated map Notice that this is not an interactivefunction
Value
No values returned only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
eire 29
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmaprotation
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)driftmap(auckland$Eastingauckland$Northingauckland$Deaths197785interpol=0nuage=1lablong=Xlablat=Ylabvar=Deaths197785)
data afcondata(afcon)driftmap(afcon$xafcon$yafcon$totconinterpol=0nuage=1lablong=Xlablat=Ylabvar=Number of conflicts)
data meusedata(meuseall)data(meuseriv)driftmap(meuseall$xmeuseall$ymeuseall$coppernuage=1lablong=Xlablat=Ylabvar=Concentration de cuivre (en ppm))
eire Eire data sets
Description
The lsquoeirersquo data frame has 26 rows and 11 columns
Usage
data(eire)
Format
A data frame with 26 observations on the following 11 variables
V1 a vector x of size n
V2 a vector y of size n
A Percentage of sample with blood group A
towns Townsunit area
pale Beyond the Pale 0 within the Pale 1
size number of blood type samples
ROADACC arterial road network accessibility in 1961
30 eirepolys
OWNCONS percentage in value terms of gross agricultural output of each county consumed by itself
POPCHG 1961 population as percentage of 1926
RETSALE value of retail sales c000
INCOME total personal income c000
Details
This data provides from spdep package
Source
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
Examples
data(eire)
eirepolys Spatial polygonal contours of eire dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of eiredataset
Usage
data(eirepolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or rsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibility torepesent spatial polygonal contours as a backgroud map Thatrsquos why we create functions lsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of the polygons
Source
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
findneighbors 31
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
findneighbors Research of the m nearest neighbors for sites
Description
The function lsquofindneighborsrsquo gives for each site of coordinates (xc yc) the m nearest neighbors inthe set of sites
Usage
findneighbors(xc yc m)
Arguments
xc a numerical vector x of size n
yc a numerical vector y of size n
m number of nearest neighbors
Details
In case of ties the nearest neighbor is randomly chosen among the ties This function is called inmakeneighborswr
Value
A matrix of size ntimes n containing 1 on position (i j) if j is m-nearest neighbour to i
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakedistanceWmakeneighborsw
32 genpca
Examples
data(auckland)Wlt-findneighbors(auckland$Eastingauckland$Northing1)
genpca Generalized Principal Component Analysis (PCA)
Description
The function lsquogenpcarsquo computes a generalized Principal Component Analysis (PCA) It calculatesthe principal components the coordinates of the variables and in these principals components axesand the inertia of these principal components
Usage
genpca(data w=rep(1nrow(data)length=nrow(data)) m=diag(1ncol(data)ncol(data))center=TRUE reduc=TRUE)
Arguments
data matrix ntimes p
w vector of size n of weight (by default weight = t(1n 1n))
m matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centered PCA (by default center=TRUE)
reduc boolean if TRUE reduced PCA (by default reduce=TRUE)
Details
LetW = diag(w)
x = data = (xprime1 x
primen)prime
withxi = (x1
i xpi )
Let1n = (1 1)prime
with n rows and 1p = (1 1)prime
with p rows Normalization of weight
wi =wisumi wi
genpca 33
Vector of means x = (x1 xp)prime
withxj =
sumi
wixji
If center=Truexc = xminus 1nxprime
Standart deviation (σj)2 =
sumi
wi(xji )
2 minus (xj)2
Σ = diag((σ1)2 (σp)2)prime
If reduc=True xcr = xc times Σminus12
Variance-Covariance matrix
C = xprimecrWxcr
Cholesky decomposition M = LLprime where M=mLet
Cl = LCLprime
Let U and D as ClU = UD
with D = diag(λ1 λp)Let
V = LprimeU
Then Coordinates of individuals in the principals components basis
CC = xcrV
Coordinates of variables in principals components
V C = CV Dminus12
Inertia I = D1p
Value
Returns lsquoinertiarsquo vector of size p with percent of inertia of each component (corresponding to I)lsquocasecoordrsquo matrix ntimes p (corresponding to matrix CC) lsquovarcoordrsquo matrix ptimes p (corresponding tomatrix V C)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
34 gini
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermappcamap
gini Calculates a Gini Index
Description
The function lsquoginirsquo calculates the Gini Index associated to the variable lsquovarrsquo
Usage
gini(var)
Arguments
var a vector of numerical values of size n
Details
Let xk k = 1 K be the distinct values taken by V ar For each site Ginir returns two pairs offrequencies The pair (f g) where f represents
fk =1n
sumi
1(V ari = xk)
(n is the length of lsquovarrsquo) and g represents
gk =xk
xfk
The pair (FG) represents the corresponding cumulative frequenciesThe Gini Index is calculated as
IG =12x
Ksumi=1
Ksumj=1
|xi minus xj |
Value
(f F g G gini) where f F g and G are vectors of size K and gini a numeric value
Note
This function is used in ginimapR but it is not an interactive function
ginimap 35
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
ginimap
ginimap Lorentz curve and map
Description
The function lsquoginimaprsquo computes a Lorentz curve from rsquovarrsquo and calculates the Gini Index associ-ated to var
Usage
ginimap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
eire 29
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmaprotation
Examples
data aucklanddata(auckland)data(auckpolys)contoursaucklandlt-polylist2list(auckpolys)driftmap(auckland$Eastingauckland$Northingauckland$Deaths197785interpol=0nuage=1lablong=Xlablat=Ylabvar=Deaths197785)
data afcondata(afcon)driftmap(afcon$xafcon$yafcon$totconinterpol=0nuage=1lablong=Xlablat=Ylabvar=Number of conflicts)
data meusedata(meuseall)data(meuseriv)driftmap(meuseall$xmeuseall$ymeuseall$coppernuage=1lablong=Xlablat=Ylabvar=Concentration de cuivre (en ppm))
eire Eire data sets
Description
The lsquoeirersquo data frame has 26 rows and 11 columns
Usage
data(eire)
Format
A data frame with 26 observations on the following 11 variables
V1 a vector x of size n
V2 a vector y of size n
A Percentage of sample with blood group A
towns Townsunit area
pale Beyond the Pale 0 within the Pale 1
size number of blood type samples
ROADACC arterial road network accessibility in 1961
30 eirepolys
OWNCONS percentage in value terms of gross agricultural output of each county consumed by itself
POPCHG 1961 population as percentage of 1926
RETSALE value of retail sales c000
INCOME total personal income c000
Details
This data provides from spdep package
Source
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
Examples
data(eire)
eirepolys Spatial polygonal contours of eire dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of eiredataset
Usage
data(eirepolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or rsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibility torepesent spatial polygonal contours as a backgroud map Thatrsquos why we create functions lsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of the polygons
Source
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
findneighbors 31
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
findneighbors Research of the m nearest neighbors for sites
Description
The function lsquofindneighborsrsquo gives for each site of coordinates (xc yc) the m nearest neighbors inthe set of sites
Usage
findneighbors(xc yc m)
Arguments
xc a numerical vector x of size n
yc a numerical vector y of size n
m number of nearest neighbors
Details
In case of ties the nearest neighbor is randomly chosen among the ties This function is called inmakeneighborswr
Value
A matrix of size ntimes n containing 1 on position (i j) if j is m-nearest neighbour to i
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakedistanceWmakeneighborsw
32 genpca
Examples
data(auckland)Wlt-findneighbors(auckland$Eastingauckland$Northing1)
genpca Generalized Principal Component Analysis (PCA)
Description
The function lsquogenpcarsquo computes a generalized Principal Component Analysis (PCA) It calculatesthe principal components the coordinates of the variables and in these principals components axesand the inertia of these principal components
Usage
genpca(data w=rep(1nrow(data)length=nrow(data)) m=diag(1ncol(data)ncol(data))center=TRUE reduc=TRUE)
Arguments
data matrix ntimes p
w vector of size n of weight (by default weight = t(1n 1n))
m matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centered PCA (by default center=TRUE)
reduc boolean if TRUE reduced PCA (by default reduce=TRUE)
Details
LetW = diag(w)
x = data = (xprime1 x
primen)prime
withxi = (x1
i xpi )
Let1n = (1 1)prime
with n rows and 1p = (1 1)prime
with p rows Normalization of weight
wi =wisumi wi
genpca 33
Vector of means x = (x1 xp)prime
withxj =
sumi
wixji
If center=Truexc = xminus 1nxprime
Standart deviation (σj)2 =
sumi
wi(xji )
2 minus (xj)2
Σ = diag((σ1)2 (σp)2)prime
If reduc=True xcr = xc times Σminus12
Variance-Covariance matrix
C = xprimecrWxcr
Cholesky decomposition M = LLprime where M=mLet
Cl = LCLprime
Let U and D as ClU = UD
with D = diag(λ1 λp)Let
V = LprimeU
Then Coordinates of individuals in the principals components basis
CC = xcrV
Coordinates of variables in principals components
V C = CV Dminus12
Inertia I = D1p
Value
Returns lsquoinertiarsquo vector of size p with percent of inertia of each component (corresponding to I)lsquocasecoordrsquo matrix ntimes p (corresponding to matrix CC) lsquovarcoordrsquo matrix ptimes p (corresponding tomatrix V C)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
34 gini
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermappcamap
gini Calculates a Gini Index
Description
The function lsquoginirsquo calculates the Gini Index associated to the variable lsquovarrsquo
Usage
gini(var)
Arguments
var a vector of numerical values of size n
Details
Let xk k = 1 K be the distinct values taken by V ar For each site Ginir returns two pairs offrequencies The pair (f g) where f represents
fk =1n
sumi
1(V ari = xk)
(n is the length of lsquovarrsquo) and g represents
gk =xk
xfk
The pair (FG) represents the corresponding cumulative frequenciesThe Gini Index is calculated as
IG =12x
Ksumi=1
Ksumj=1
|xi minus xj |
Value
(f F g G gini) where f F g and G are vectors of size K and gini a numeric value
Note
This function is used in ginimapR but it is not an interactive function
ginimap 35
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
ginimap
ginimap Lorentz curve and map
Description
The function lsquoginimaprsquo computes a Lorentz curve from rsquovarrsquo and calculates the Gini Index associ-ated to var
Usage
ginimap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
30 eirepolys
OWNCONS percentage in value terms of gross agricultural output of each county consumed by itself
POPCHG 1961 population as percentage of 1926
RETSALE value of retail sales c000
INCOME total personal income c000
Details
This data provides from spdep package
Source
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
Examples
data(eire)
eirepolys Spatial polygonal contours of eire dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of eiredataset
Usage
data(eirepolys)
Format
The format is a list of polygons of class polylist
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or rsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibility torepesent spatial polygonal contours as a backgroud map Thatrsquos why we create functions lsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting from a spatial object only the vertices of the polygons
Source
Upton and Fingleton 1985 Bailey and Gatrell 1995 ch 1 for blood group data Cliff and Ord(1973) p 107 for remaining variables (also after OrsquoSullivan 1968) ldquoPolygon borders and Irishdata sourced from Michael Tiefelsdorfrsquos SPSS Saddlepointrdquo
findneighbors 31
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
findneighbors Research of the m nearest neighbors for sites
Description
The function lsquofindneighborsrsquo gives for each site of coordinates (xc yc) the m nearest neighbors inthe set of sites
Usage
findneighbors(xc yc m)
Arguments
xc a numerical vector x of size n
yc a numerical vector y of size n
m number of nearest neighbors
Details
In case of ties the nearest neighbor is randomly chosen among the ties This function is called inmakeneighborswr
Value
A matrix of size ntimes n containing 1 on position (i j) if j is m-nearest neighbour to i
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakedistanceWmakeneighborsw
32 genpca
Examples
data(auckland)Wlt-findneighbors(auckland$Eastingauckland$Northing1)
genpca Generalized Principal Component Analysis (PCA)
Description
The function lsquogenpcarsquo computes a generalized Principal Component Analysis (PCA) It calculatesthe principal components the coordinates of the variables and in these principals components axesand the inertia of these principal components
Usage
genpca(data w=rep(1nrow(data)length=nrow(data)) m=diag(1ncol(data)ncol(data))center=TRUE reduc=TRUE)
Arguments
data matrix ntimes p
w vector of size n of weight (by default weight = t(1n 1n))
m matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centered PCA (by default center=TRUE)
reduc boolean if TRUE reduced PCA (by default reduce=TRUE)
Details
LetW = diag(w)
x = data = (xprime1 x
primen)prime
withxi = (x1
i xpi )
Let1n = (1 1)prime
with n rows and 1p = (1 1)prime
with p rows Normalization of weight
wi =wisumi wi
genpca 33
Vector of means x = (x1 xp)prime
withxj =
sumi
wixji
If center=Truexc = xminus 1nxprime
Standart deviation (σj)2 =
sumi
wi(xji )
2 minus (xj)2
Σ = diag((σ1)2 (σp)2)prime
If reduc=True xcr = xc times Σminus12
Variance-Covariance matrix
C = xprimecrWxcr
Cholesky decomposition M = LLprime where M=mLet
Cl = LCLprime
Let U and D as ClU = UD
with D = diag(λ1 λp)Let
V = LprimeU
Then Coordinates of individuals in the principals components basis
CC = xcrV
Coordinates of variables in principals components
V C = CV Dminus12
Inertia I = D1p
Value
Returns lsquoinertiarsquo vector of size p with percent of inertia of each component (corresponding to I)lsquocasecoordrsquo matrix ntimes p (corresponding to matrix CC) lsquovarcoordrsquo matrix ptimes p (corresponding tomatrix V C)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
34 gini
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermappcamap
gini Calculates a Gini Index
Description
The function lsquoginirsquo calculates the Gini Index associated to the variable lsquovarrsquo
Usage
gini(var)
Arguments
var a vector of numerical values of size n
Details
Let xk k = 1 K be the distinct values taken by V ar For each site Ginir returns two pairs offrequencies The pair (f g) where f represents
fk =1n
sumi
1(V ari = xk)
(n is the length of lsquovarrsquo) and g represents
gk =xk
xfk
The pair (FG) represents the corresponding cumulative frequenciesThe Gini Index is calculated as
IG =12x
Ksumi=1
Ksumj=1
|xi minus xj |
Value
(f F g G gini) where f F g and G are vectors of size K and gini a numeric value
Note
This function is used in ginimapR but it is not an interactive function
ginimap 35
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
ginimap
ginimap Lorentz curve and map
Description
The function lsquoginimaprsquo computes a Lorentz curve from rsquovarrsquo and calculates the Gini Index associ-ated to var
Usage
ginimap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
findneighbors 31
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
findneighbors Research of the m nearest neighbors for sites
Description
The function lsquofindneighborsrsquo gives for each site of coordinates (xc yc) the m nearest neighbors inthe set of sites
Usage
findneighbors(xc yc m)
Arguments
xc a numerical vector x of size n
yc a numerical vector y of size n
m number of nearest neighbors
Details
In case of ties the nearest neighbor is randomly chosen among the ties This function is called inmakeneighborswr
Value
A matrix of size ntimes n containing 1 on position (i j) if j is m-nearest neighbour to i
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakedistanceWmakeneighborsw
32 genpca
Examples
data(auckland)Wlt-findneighbors(auckland$Eastingauckland$Northing1)
genpca Generalized Principal Component Analysis (PCA)
Description
The function lsquogenpcarsquo computes a generalized Principal Component Analysis (PCA) It calculatesthe principal components the coordinates of the variables and in these principals components axesand the inertia of these principal components
Usage
genpca(data w=rep(1nrow(data)length=nrow(data)) m=diag(1ncol(data)ncol(data))center=TRUE reduc=TRUE)
Arguments
data matrix ntimes p
w vector of size n of weight (by default weight = t(1n 1n))
m matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centered PCA (by default center=TRUE)
reduc boolean if TRUE reduced PCA (by default reduce=TRUE)
Details
LetW = diag(w)
x = data = (xprime1 x
primen)prime
withxi = (x1
i xpi )
Let1n = (1 1)prime
with n rows and 1p = (1 1)prime
with p rows Normalization of weight
wi =wisumi wi
genpca 33
Vector of means x = (x1 xp)prime
withxj =
sumi
wixji
If center=Truexc = xminus 1nxprime
Standart deviation (σj)2 =
sumi
wi(xji )
2 minus (xj)2
Σ = diag((σ1)2 (σp)2)prime
If reduc=True xcr = xc times Σminus12
Variance-Covariance matrix
C = xprimecrWxcr
Cholesky decomposition M = LLprime where M=mLet
Cl = LCLprime
Let U and D as ClU = UD
with D = diag(λ1 λp)Let
V = LprimeU
Then Coordinates of individuals in the principals components basis
CC = xcrV
Coordinates of variables in principals components
V C = CV Dminus12
Inertia I = D1p
Value
Returns lsquoinertiarsquo vector of size p with percent of inertia of each component (corresponding to I)lsquocasecoordrsquo matrix ntimes p (corresponding to matrix CC) lsquovarcoordrsquo matrix ptimes p (corresponding tomatrix V C)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
34 gini
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermappcamap
gini Calculates a Gini Index
Description
The function lsquoginirsquo calculates the Gini Index associated to the variable lsquovarrsquo
Usage
gini(var)
Arguments
var a vector of numerical values of size n
Details
Let xk k = 1 K be the distinct values taken by V ar For each site Ginir returns two pairs offrequencies The pair (f g) where f represents
fk =1n
sumi
1(V ari = xk)
(n is the length of lsquovarrsquo) and g represents
gk =xk
xfk
The pair (FG) represents the corresponding cumulative frequenciesThe Gini Index is calculated as
IG =12x
Ksumi=1
Ksumj=1
|xi minus xj |
Value
(f F g G gini) where f F g and G are vectors of size K and gini a numeric value
Note
This function is used in ginimapR but it is not an interactive function
ginimap 35
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
ginimap
ginimap Lorentz curve and map
Description
The function lsquoginimaprsquo computes a Lorentz curve from rsquovarrsquo and calculates the Gini Index associ-ated to var
Usage
ginimap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
32 genpca
Examples
data(auckland)Wlt-findneighbors(auckland$Eastingauckland$Northing1)
genpca Generalized Principal Component Analysis (PCA)
Description
The function lsquogenpcarsquo computes a generalized Principal Component Analysis (PCA) It calculatesthe principal components the coordinates of the variables and in these principals components axesand the inertia of these principal components
Usage
genpca(data w=rep(1nrow(data)length=nrow(data)) m=diag(1ncol(data)ncol(data))center=TRUE reduc=TRUE)
Arguments
data matrix ntimes p
w vector of size n of weight (by default weight = t(1n 1n))
m matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centered PCA (by default center=TRUE)
reduc boolean if TRUE reduced PCA (by default reduce=TRUE)
Details
LetW = diag(w)
x = data = (xprime1 x
primen)prime
withxi = (x1
i xpi )
Let1n = (1 1)prime
with n rows and 1p = (1 1)prime
with p rows Normalization of weight
wi =wisumi wi
genpca 33
Vector of means x = (x1 xp)prime
withxj =
sumi
wixji
If center=Truexc = xminus 1nxprime
Standart deviation (σj)2 =
sumi
wi(xji )
2 minus (xj)2
Σ = diag((σ1)2 (σp)2)prime
If reduc=True xcr = xc times Σminus12
Variance-Covariance matrix
C = xprimecrWxcr
Cholesky decomposition M = LLprime where M=mLet
Cl = LCLprime
Let U and D as ClU = UD
with D = diag(λ1 λp)Let
V = LprimeU
Then Coordinates of individuals in the principals components basis
CC = xcrV
Coordinates of variables in principals components
V C = CV Dminus12
Inertia I = D1p
Value
Returns lsquoinertiarsquo vector of size p with percent of inertia of each component (corresponding to I)lsquocasecoordrsquo matrix ntimes p (corresponding to matrix CC) lsquovarcoordrsquo matrix ptimes p (corresponding tomatrix V C)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
34 gini
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermappcamap
gini Calculates a Gini Index
Description
The function lsquoginirsquo calculates the Gini Index associated to the variable lsquovarrsquo
Usage
gini(var)
Arguments
var a vector of numerical values of size n
Details
Let xk k = 1 K be the distinct values taken by V ar For each site Ginir returns two pairs offrequencies The pair (f g) where f represents
fk =1n
sumi
1(V ari = xk)
(n is the length of lsquovarrsquo) and g represents
gk =xk
xfk
The pair (FG) represents the corresponding cumulative frequenciesThe Gini Index is calculated as
IG =12x
Ksumi=1
Ksumj=1
|xi minus xj |
Value
(f F g G gini) where f F g and G are vectors of size K and gini a numeric value
Note
This function is used in ginimapR but it is not an interactive function
ginimap 35
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
ginimap
ginimap Lorentz curve and map
Description
The function lsquoginimaprsquo computes a Lorentz curve from rsquovarrsquo and calculates the Gini Index associ-ated to var
Usage
ginimap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
genpca 33
Vector of means x = (x1 xp)prime
withxj =
sumi
wixji
If center=Truexc = xminus 1nxprime
Standart deviation (σj)2 =
sumi
wi(xji )
2 minus (xj)2
Σ = diag((σ1)2 (σp)2)prime
If reduc=True xcr = xc times Σminus12
Variance-Covariance matrix
C = xprimecrWxcr
Cholesky decomposition M = LLprime where M=mLet
Cl = LCLprime
Let U and D as ClU = UD
with D = diag(λ1 λp)Let
V = LprimeU
Then Coordinates of individuals in the principals components basis
CC = xcrV
Coordinates of variables in principals components
V C = CV Dminus12
Inertia I = D1p
Value
Returns lsquoinertiarsquo vector of size p with percent of inertia of each component (corresponding to I)lsquocasecoordrsquo matrix ntimes p (corresponding to matrix CC) lsquovarcoordrsquo matrix ptimes p (corresponding tomatrix V C)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
34 gini
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermappcamap
gini Calculates a Gini Index
Description
The function lsquoginirsquo calculates the Gini Index associated to the variable lsquovarrsquo
Usage
gini(var)
Arguments
var a vector of numerical values of size n
Details
Let xk k = 1 K be the distinct values taken by V ar For each site Ginir returns two pairs offrequencies The pair (f g) where f represents
fk =1n
sumi
1(V ari = xk)
(n is the length of lsquovarrsquo) and g represents
gk =xk
xfk
The pair (FG) represents the corresponding cumulative frequenciesThe Gini Index is calculated as
IG =12x
Ksumi=1
Ksumj=1
|xi minus xj |
Value
(f F g G gini) where f F g and G are vectors of size K and gini a numeric value
Note
This function is used in ginimapR but it is not an interactive function
ginimap 35
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
ginimap
ginimap Lorentz curve and map
Description
The function lsquoginimaprsquo computes a Lorentz curve from rsquovarrsquo and calculates the Gini Index associ-ated to var
Usage
ginimap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
34 gini
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermappcamap
gini Calculates a Gini Index
Description
The function lsquoginirsquo calculates the Gini Index associated to the variable lsquovarrsquo
Usage
gini(var)
Arguments
var a vector of numerical values of size n
Details
Let xk k = 1 K be the distinct values taken by V ar For each site Ginir returns two pairs offrequencies The pair (f g) where f represents
fk =1n
sumi
1(V ari = xk)
(n is the length of lsquovarrsquo) and g represents
gk =xk
xfk
The pair (FG) represents the corresponding cumulative frequenciesThe Gini Index is calculated as
IG =12x
Ksumi=1
Ksumj=1
|xi minus xj |
Value
(f F g G gini) where f F g and G are vectors of size K and gini a numeric value
Note
This function is used in ginimapR but it is not an interactive function
ginimap 35
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
ginimap
ginimap Lorentz curve and map
Description
The function lsquoginimaprsquo computes a Lorentz curve from rsquovarrsquo and calculates the Gini Index associ-ated to var
Usage
ginimap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
ginimap 35
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
ginimap
ginimap Lorentz curve and map
Description
The function lsquoginimaprsquo computes a Lorentz curve from rsquovarrsquo and calculates the Gini Index associ-ated to var
Usage
ginimap(long lat var listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0color = 1 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
36 ginimap
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
labvar name of var
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
axis a boolean with TRUEfor drawing axes on the map
Details
Users have the possibility to choose a threshold by mouse clicking on the Lorentz curve or byspecifying it in the menu The corresponding pair (FG) and the value of lsquovarrsquo are then printed onthe graph and the sites with a value of lsquovarrsquo lower or equal to the threshold are then selected on themap
Note
The Gini Index is given in the tcltk window (see function ginir for the formula used to calculate it)
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
gini
Examples
donneacutees eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)obslt-ginimap(eire$V1eire$V2eire$INCOMElistvar=eirelistnomvar=names(eire)carte=eirecontours)
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
graphique 37
graphique Drawing a graphic
Description
The function lsquographiquersquo draws a specific graphic Possibility to draw one of these graphics His-togram Barplot Boxplot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz MoranAngleplot Variocloud Cluster and PCA (graphics of individuals and variables) This function iscalled in most of the functions of GeoXp (this is not an interactive function)
Usage
graphique(var1 var2 var3 obsnumgraph=couleurs= symbol=0col=0 labvar=nbcol=10 alpha1 W Xpoly Ypoly F G opt1=1opt2=1 quantiles=05 labmod= directinertielabel=0kernel obsq locmoran=0bin=NULL)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
var3 3rd variable of size n (used for variocloudmap)
obs a vector of boolean of size n with sites selected
num number of windows which must be activated (3 ou 4)
graph name of graphic which must be drawn Histogram Barplot Boxplot Polybox-plot Scatterplot Densityplot1 Densityplot2 Neighbourplot Lorentz MoranQuadrant Angleplot Variocloud Cluster Acp1 Acp2
couleurs Possibilty to change colors (for admin only)
symbol 0 or 1 choice of representation of points selected (0 selected points are in redor 1 selectd points are stars)
col 0 or 1 choice of representation of points selected (0 sites are represented inblue and 1 sites are represented with different colors for each factor)
labvar name(s) of variable(s) studied
nbcol number of cells if the graphic choosen is the histogram (10 by default)
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
38 graphique
alpha1 regression smoothing paramater
W Spatial weight matrix
Xpoly x-coordinates of the vertices of selected polygon
Ypoly y-coordinates of the vertices of selected polygon
F Used for Ginimap
G Used for Ginimap
opt1 Option for scattermap (1 graphic only 2 drawing of the conditionnal medianregression spline 3 drawing of the conditionnal quantile regression spline (userhas to give option quantiles))
opt2 Option for drawing robust empirical variogram
quantiles vector which contains the values of α for conditionnal quantile
labmod names of factor if the graphic choosed is a barplot
direct Used for PCA
inertie Used for PCA
label Name of sites
kernel Name of the kernel choosed in densitymap
obsq Used for clustermap and barmap
locmoran Print local moran for each site
bin The bins chosen to calculte empirical variogram
Details
This function is called by any function which draws a graphic A lot of options are consideredbecause of the large number of graphics proposed
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
histobarmap 39
Value
No values only drawing of a graphic
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
histobarmap Histogram barplot and map
Description
The function lsquohistobarmaprsquo draws a bar plot (vertical bar) of the given variable var1 a histogramof the given variable var2 and a map with sites of coordinates (long lat)
Usage
histobarmap(long lat var1 var2 criteria = NULLcarte = NULL label = symbol = 0 color = 1nbcol = 10 labvar = c( ) labmod = listvar = NULL listnomvar = NULL axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
40 histobarmap
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var1
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
nbcol number of cells for histogram (10 by default)
labvar list of names for variable lsquovar1rsquo and lsquovar2rsquo
labmod names of factors lsquovarrsquo
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables in rsquolistvarrsquo
axis 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
Each site is associated to a factor of var1 and to a value of var2 There is interactivity betweenthe three windows created the sites selected by a bar on the bar plot or on the histogram arerepresented on the map in red and the value and factor of sites selected on the map are representedin red on the bar plot and on the histogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
histomap 41
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-histobarmap(colombuscontours$Xcolombuscontours$Ycolombus$CPcolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histobarmap(eire$V1eire$V2eire$paleeire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Appartenance agravela reacutegion du Palelabmod=c(Hors PalePale))
histomap Interactive Histogram and map
Description
The function lsquohistomaprsquo draws a histogram of the given variable var and a map with sites of coor-dinates (long lat) Each site is associated to a value of var and there is interactivity between thetwo windows
Usage
histomap(long lat var nbcol = 10 listvar = NULLlistnomvar = NULL criteria = NULL carte = NULL label = symbol = 0 color = 1 labvar = axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
listvar matrix of variables
listnomvar names of variables listvar
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
42 histomap
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
Sites selected by a bar on the histogram are represented on the map in red and the values of sitesselected on the map by lsquopointsrsquo or lsquopolygonrsquo are represented in red as a sub-histogram on thehistogram
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
histomap histobarmap scattermap densitymap
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
makedistanceW 43
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)histomap(oldcol$Xoldcol$Yoldcol$CRIMElistvar=oldcollistnomvar=names(oldcol)criteria=(oldcol$CRIMEgtmean(oldcol$CRIME))carte=contoursOLD)
data afcondata(afcon)histomap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)criteria=(afcon$totcongtmean(afcon$totcon))label=afcon$name)
data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)histomap(eire$V1eire$V2eire$Acarte=eirecontourslistvar=eirelistnomvar=names(eire)labvar=Taux dindividus au groupe sanguin A)
makedistanceW Spatial weight matrix based on distance threshold
Description
The function lsquomakedistanceWrsquo creates a spatial weight matrix based on a threshold distance as-signy 1 if the distance between the two sites is lower or equal to a given threshold and 0 otherwise
Usage
makedistanceW(x y distance)
Arguments
x a vector x of size n
y a vector y of size n
distance threshold point
Details
If site i is seperated from j by a distance lower or equal to a given threshold
Wij = 1
elseWij = 0
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
44 makeneighborsw
Value
A matrix W of size ntimes n containing 0 and 1
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswnormwfindneighbors
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)
makeneighborsw Spatial weight matrix based on nearest neighbors
Description
The function lsquomakeneighborswrsquo creates a spatial weight matrix based on a given number of nearestneighbors
Usage
makeneighborsw(xc yc m cum = TRUE)
Arguments
xc a vector x of size n
yc a vector y of size n
m number of nearest neighbors
cum if cum=TRUE W is the sum of spatial weight matrix based on k nearest neigh-bours (for k le m if FALSE W is the spatial weight matrix based only on mth
nearest neighbours
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
map2list 45
Details
For each site we order the other sites by their distance from this site If cum=TRUE for i if j isamong the mth nearest sites then
Wij = 1
elseWij = 0
If cum=FALSE for si if sj is the mth nearest site then
Wij = 1
elseWij = 0
In case of ties the nearest neighbour is randomly chosen
Value
A spatial weight matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapfindneighborsmakedistanceWnormw
Examples
data aucklanddata(auckland)Wlt-makeneighborsw(auckland$Eastingauckland$Northing5)
map2list Extract from a lsquoMaprsquo object the middle coordinates of boundary boxand the vertices of the polygons (in the case where polygons are given)
Description
The function lsquomap2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into the lsquoMaprsquo object it extracts the vertices of the polygons seperatingpolygons from each other by 3 rows of NaN
Usage
map2list(data)
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
46 meuseall
Arguments
data A lsquoMaprsquo object
Details
The user can then represent the coordinates of sites of a lsquoMaprsquo object as background map using theoption lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoMaprsquo object can be directly extract using $attdata
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe maptools packagersquo httpcranr-projectorgdocpackagesmaptoolspdf
See Also
polylist2listspdf2list
Examples
x lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdata
meuseall Meuse river data set - original full data set
Description
This data set gives locations and top soil heavy metal concentrations (ppm) along with a numberof soil and landscape variables collected in a flood plain of the river Meuse near the village SteinHeavy metal concentrations are bulk sampled from an area of approximately 15times 15m
Usage
data(meuseall)
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
meuseall 47
Format
A data frame with 164 observations on the following 17 variables
sample sample number
x a numeric vector x-coordinate (m) in RDM (Dutch topographical map coordinates)
y a numeric vector y-coordinate (m) in RDM (Dutch topographical map coordinates)
cadmium topsoil cadmium concentration ppm note that zero cadmium values in the originaldata set have been shifted to 02 (half the lowest non-zero value)
copper topsoil copper concentration ppm
lead lead topsoil lead concentration ppm
zinc topsoil zinc concentration ppm
elev elev relative elevation
distm distance to river Meuse (metres) as obtained during the field survey
om organic matter as percentage
ffreq flooding frequency class
soil soil type
lime lime class
landuse landuse class
inpit logical indicates whether this is a sample taken in a pit
inmeuse155 logical indicates whether the sample is part of the lsquomeusersquo (ie filtered) data setin addition to the samples in a pit an sample (139) with outlying zinc content was removed
inBMcD logical indicates whether the sample is used as part of the subset of 98 points in thevarious interpolation examples of Burrough amp McDonnell
Details
This data set provides from gstat package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseall)
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
48 moranplotmap
meuseriv River Meuse outline
Description
The lsquomeuserivrsquo data consists of an outline of the Meuse river in the area a few kilometers aroundthe meuse data set
Usage
data(meuseriv)
Format
This data frame contains a 176times 2 matrix with coordinates
Details
This data set provides from spdep package
Source
The actual field data were collected by Ruud van Rijn and Mathieu Rikken data compiled for R byEdzer J Pebesma
References
PA Burrough RA McDonnell 1998 Principles of Geographical Information Systems OxfordUniversity Press httpwwwgstatorg
Examples
data(meuseriv)
moranplotmap Moran scatterplot and map
Description
The function lsquomoranplotmaprsquo draws a graphic used to detect spatial autocorrelation in the variablevar On the x-absis is represented (var minus macrvar) and on the y-absis W (var minus macrvar) where W isthe spatial weight matrix It also calcultes also Moranrsquos I statistic (see nonnormoranr) and give ap-value associated to the autocorrelation test (gaussian version and permutation version)
Usage
moranplotmap(long lat var W flower = 0 opt1 = 1locmoran = 0 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = symbol = 0labvar = axis = FALSE lablong = lablat = )
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
moranplotmap 49
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
flower link neighbouring sites (0 no link (by default) and 1 link (for points or poly-gon))
opt1 2 for drawing regression line for model W (X minus X) = β(X minus X) + u else 1
locmoran prints local Moranrsquos I statistic (0 no draw (by default) and 1 draw (for pointsor polygon))
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of variable var
axis 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
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
50 moranplotmap
Details
For the permutation test for each drawing the values of the variable var are randomly assigned tothe sites We then calculate MoranrsquoI statistic associated to each drawing and we give the frequencyof drawings when MoranrsquoI statistic is lower or equal to the observed MoranrsquoI statistic Moreoverthe function gives the opportunity to link neighbouring sites and give Local Moranrsquos I statistic Fora site i
Ii = (vari minus (var))sum
j
Wij(varj minus macrvar)
with j not equal to i
Value
Returns obs vector of size n of boolean with selected sites and MoranrsquoI statistic MORAN
Note
The spatial weigth matrix has been normalized Like that the MoranrsquoI statistic is equal to β used inregression line for model W (X minus X) = β(X minus X) + u
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Jim Lesage ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
See Also
neighbourmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)moranplotmap(baltimore$Xbaltimore$Ybaltimore$PRICEWlabel=baltimore$STATIONcriteria=(baltimore$PRICEgtmean(baltimore$PRICE))listvar=baltimorelistnomvar=names(baltimore)axis=TRUElablong=Xlablat=Yflower=1locmoran=1opt1=2)
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
neighbourmap 51
neighbourmap Neighbour plot and map
Description
The function lsquoneighbourmaprsquo identifies spatial outliers by comparing a variable value for a partic-ular site with these of its neighbouring sites It draws a scatterplot of the values of the variable atneighbouring sites for a neighbourhood structure given by a binary weight matrix W and links thisscatterplot with a map
Usage
neighbourmap(long lat var Wlistvar=NULL listnomvar=NULLcarte=NULLcriteria=NULLlabel=symbol=0labvar=c()opt1=0axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
W A spatial weigth matrix of size ntimes n
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variable var
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
52 neighbourmap
opt1 0=graphic only 1=drawing of the linear predictor for lsquoresponsersquo in linear model
axis 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
For a selected site j on the map are represented on the map its neighbours and on the graph on thex-axis the value of var for this site and in y-axis the values of var for the neighbouring sites of jFor a selected point on the graph the corresponding pair of sites is represented on the map with alink
Value
Returns a matrix of size ntimes n of boolean with TRUE if pair (i j) was in the last selection
Note
When user select sites on the graph or on the map he cannot add a selection by using the othergraphic
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapmakeneighborswmakedistanceWnormwnonormmoran
Examples
data oldcoldata(oldcol)data(oldcolpolys)contoursOLDlt-polylist2list(oldcolpolys)W lt- makeneighborsw(oldcol$Xoldcol$Y4)obslt-neighbourmap(oldcol$Xoldcol$Yoldcol$CRIMEWcarte=contoursOLDcriteria=(oldcol$CRIMEgtmean(oldcol$CRIME))listvar=oldcollistnomvar=names(oldcol))
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
nonormmoran 53
nonormmoran Detection of spatial autocorrelation
Description
The function lsquononnormmoranrsquo is used to detect spatial autocorrelation in the residuals u from theleast squares model Y = β timesX + u It calculates Moranrsquos I statistic of the residuals based on thegaussian asymptotic distribution and give a p-value associated to the test of spatial autocorrelation(gaussian version)
Usage
nonormmoran(y x W)
Arguments
y vector of size n of dependent variable
x matrix ntimes p containing explanatory variables
W spatial weight matrix
Details
W is supposed standartized
I =uprimeWu
uprimeu
I sim N(E(I) var(I))
let M = (I minusX(X primeX)minus1X prime)
E(I) =tr(MW )
nminus k
d =nminus p
n + p + 2
V (I) = [tr(MWMW prime) + tr(MW )2 + (tr(MW ))2]dminus E(I)2
ZI =I minus E(I)v(I)12
Value
(nobsnvarmoraniimeanistativarprob) where lsquonobsrsquo is the number of observations lsquonvarrsquo thenumber of explanatory variables lsquomoranirsquo is the Moranrsquos I statistic estimate lsquoimeanrsquo is E(I)ivar is var(I) lsquoistatrsquo is the normalized Moranrsquos I statistic (corresponding to ZI ) and lsquoprobrsquo theassociated p-value
Author(s)
Translated into R from Jim Lessagersquos ldquoSpatial Econometrics Toolboxrdquo httpwwwspatial-econometricscom
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
54 normw
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
moranplotmapneighbourmapmakeneighborswmakedistanceWnormw
Examples
data baltimoredata(baltimore)W lt- makeneighborsw(baltimore$Xbaltimore$Y4)nonormmoran(baltimore$PRICEbaltimore[1415]W)
normw Normalize a spatial weight matrix
Description
The function lsquonormwrsquo normalizes a spatial weight matrix
Usage
normw(w)
Arguments
w A spatial weight matrix of size ntimes n
Details
Wij =Wijsumk Wik
Value
A matrix of size ntimes n
Author(s)
Aragon Y Thomas-Agnan C Ruiz-Gazen A Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
neighbourmap moranplotmapmakedistanceWmakeneighborsw
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
oldcol 55
Examples
data aucklanddata(auckland)Wlt-makedistanceW(auckland$Eastingauckland$Northing5)W2lt-normw(W)
oldcol Columbus OH spatial analysis data set
Description
The columbus data frame has 49 observations and 22 columns Unit of analysis 49 neighbourhoodsin Columbus OH 1980 data
Usage
data(oldcol)
Format
A data frame with 49 observations on the following 22 variables
PERIMETER Computed by ArcView
COLUMBUS internal polygon ID
COLUMBUSI another internal polygon ID
POLYID yet another internal polygon ID
NEIG neighbourhood id value (1-49) conforms to id value used in Spatial Econometrics book
HOVAL housing value (in 1000 dollars)
INC household income (in 1000 dollars)
CRIME residential burglaries and vehicle thefts per thousand households in the neighborhood
OPEN open space in the neighborhood
PLUMB percentage housing units without plumbing
DISCBD distance to CBD
X x coordinate
Y y coordinate
AREA neighborhood area
NSA north south dummy (North=1)
NSB north south dummy (North=1)
EW east west dummy (East=1)
CP core-periphery dummy (Core=1)
THOUS constant=1000
NEIGNO Neig+1000 alternative neighborhood id value
PERIM polygon perimeter
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
56 oldcolpolys
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcol)
oldcolpolys Spatial polygonal contours of oldcol dataset
Description
A lsquopolylistrsquo object for drawing spatial polygonal contours of oldcol dataset
Usage
data(oldcolpolys)
Format
The format is a list of polygons of class lsquopolylistrsquo
Details
This object is used in the lsquospdeprsquo package created by Roger Bivand In the lsquoGeoXprsquo packagewe donrsquot use lsquopolylistrsquo lsquoSpatialPolygonrsquo or lsquoMaprsquo object because a site can only be representedby a pair of coordinates and not by a polygonnal contour However users have the possibil-ity to repesent spatial polygonal contours as a backgroud map Thatrsquos why we create functionslsquosp2listrsquolsquopolylist2listrsquo and lsquomap2listrsquo for extracting of spatial object only the vertices of the poly-gons
Note
This data file prepared by Luc Anselin Spatial Analysis Laboratory Department of Agriculture andConsumer Economics University of Illinois Urbana-Champaign
Source
Anselin Luc (1988) ldquoSpatial econometrics methods and modelsrdquo Dordrecht Kluwer AcademicTable 121 p 189
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
pcamap 57
References
Bivand R (2006) ldquoThe spdep packagerdquo httpcranr-projectorgdocpackagesspdeppdf
Examples
data(oldcolpolys)
pcamap Generalized Principal Component Analysis and map
Description
The function lsquopcamaprsquo draws the plots summarizing a generalized Principal Component Analysis(PCA) made with lsquogenpcarrsquo It draws the scatterplot of the individuals projected on a chosenprincipal component plane (with their percentage of inertia) together with the scatterplot of thevariables projected into the same plane with the quality of representation in order to interpret theprincipal component axes The individuals scatterplot interacts with the map
Usage
pcamap(longlatdatasetdirect=c(12)weight=rep(1nrow(dataset)length=nrow(dataset))metric=diag(1ncol(dataset)ncol(dataset)) center=TRUE reduce=TRUEnamedata=NULLqualproj=0listvar=NULL listnomvar=NULLcriteria=NULLcarte=NULLlabel=symbol=0color=1axis=FALSElablong= lablat=)
Arguments
long a vector x of size n
lat a vector y of size n
dataset matrix ntimes p of variables
direct Number of component analysis to draw
weight vector of size n of weight (by default weight = t(1n 1n))
metric matrix ptimes p (by default metric=Identity matrix)
center boolean if TRUE centred PCA (by default center=TRUE)
reduce boolean if TRUE reduced PCA (by default reduce=TRUE)
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
58 pcamap
namedata List of Names of dataset
qualproj possibility to print the quality of representation of individuals (0 no print (bydefault) and 1 print)
listvar matrix of variables
listnomvar names of variables from listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
color 0 or 1 (by default) choice of representation of selected points (if user has se-lected a barplot as an additionnal graph) If 0 sites are represented in blue if 1sites are represented with different colors for each factor
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
axis 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
LetD = diag(λ1 λp)
1p = (1 1)prime
Let the coordinates of individuals in the principals components
CC = (C prime1 C
primen)prime
with Ci = (C1i Cp
i )Let the coordinates of variables in the principals components
CC = (V prime1 V prime
p)prime
with Vi = (V 1i V p
i )Part of inertia
(λ1sumi λi
λpsumi λi
)prime
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
pcamap 59
Quality of representation of individual k projected on plane (ij)
Qu =
radic(Ci
k)2 + (Cjk)2sum
l(Clk)2
Quality of representation of variable k projected on plane (ij)
V Qu =
radic(V i
k )2 + (V jk )2sum
l(Vlk)2
Value
Return lsquoobsrsquo vector of size n of boolean with sites selected lsquoinertiarsquo vector of size p with percentof inertia of each component lsquocasecoordrsquo matrix n times p of indivuduals lsquovarcoordrsquo matrix p times p ofprincipal components
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Caussinus H Fekri M Hakam S Ruiz-Gazen A (2003) ldquoA monitoring display of MultivariateOutliersrdquo Computational Statistics and Data Analysis vol 44 1-2 237-252
See Also
clustermapgenpca
Examples
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-pcamap(colombuscontours$Xcolombuscontours$Ycolombus[612]label=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)namedata=names(colombus[612]))
data bostondata(boston)obslt-pcamap(boston$xboston$yboston[1522]label=boston$TOWNlistvar=bostonlistnomvar=names(boston)namedata=names(boston[1522]))
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
60 polyboxplotmap
polyboxplotmap Interactive polyboxplot and map
Description
Parallel Boxplots of a numerical variable by levels of a factor It interacts with a map
Usage
polyboxplotmap(long lat var2 var1 listvar = NULL listnomvar = NULLcarte = NULL criteria = NULL label = labmod = labvar = symbol = 0 color = 1 axis = FALSElablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var2 a vector of factor of size n
var1 a vector of numerical values of size n
listvar matrix of variables fo size ntimes p for optional additional graph and bubbles
listnomvar list of character of size p with names of variables inluded in listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with name of each site
labmod names of factors var2
labvar list of names for variables var2 and var1
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor of var2
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
polyboxplotmap 61
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
axis 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
Each site is associated to a value of var1 and a level of var2 There is an interactivity only in onedirection the sites selected by quartile-intervals on one of the boxplots are then represented on themap in red (or colors according to the options)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap dbledensitymap
Examples
Data eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)polyboxplotmap(eire$V1eire$V2eire$paleeire$POPCHGlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=Appartenance ou non agrave la reacutegion du Palelabmod=c(Hors PalePale))
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
62 polylist2list
polylist2list Extract from a lsquopolylistrsquo object the vertices of the polygons
Description
The function lsquopolylist2listrsquo extracts the vertices of the polygons from a lsquopolylistrsquo object seperatingpolygons from each other by 3 rows of NaN
Usage
polylist2list(data)
Arguments
data A lsquopolylistrsquo object
Details
The user can then represent the coordinates of sites of a lsquopolylistrsquo object as background map usingthe option lsquocartersquo included in all interactive functions of GeoXp
Value
It returns a matrix of numeric values with 2 columns (x and y coordinates of the vertices of thepolygons) where polygons are seperated from each other by 3 rows of NaN
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe spdep packagersquo httpcranr-projectorgdocpackagesspdeppdf
See Also
spdf2listmap2list
Examples
data(eirepolys)eirecontourslt-polylist2list(eirepolys)
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
rotation 63
rotation Transform coordinates of sites using a rotation
Description
The function lsquorotationrsquo is used to modify coordinates of sites by a rotation with an angle equal toangle
Usage
rotation(coords angle)
Arguments
coords matrix ntimes 2 of coordinates
angle value of angle to use in rotation in degree
Details
Letx = (cos(θ)minussin(θ))
y = (sin(θ) cos(θ))
nlecoord = coordstimes cbind(x y)
Value
matrix ntimes 2 of new coordinates
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
angleplotmapvariocloudmap
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
64 scattermap
scattermap Interactive scatterplot and map
Description
The function lsquoscattermaprsquo draws a scatterplot of the given variables (var1 var2) and a map withsites of coordinates (long lat) Boxplots of each variable var1 and var2 are represented below thex-axis and y-axis
Usage
scattermap(long lat var1 var2 listvar = NULL listnomvar = NULLopt = 1 quantiles = 05 criteria = NULL carte = NULLlabel = symbol = 0 labvar = c( ) color = 1axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var1 a vector of numeric values of size n
var2 a vector of numeric values of size n
listvar matrix of variables
listnomvar names of variables listvar
opt 1=graphic only 2=drawing of the linear predictor for lsquoresponsersquo in linear model3=drawing of the conditionnal quantile regression spline (user has to give optionquantiles)
quantiles vector which contains a list of order (if opt = 3)
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
scattermap 65
color 0 or 1 choice of representation of selected points If 0 sites are represented inblue if 1 sites are represented with different colors for each factor
symbol 0 or 1 choice of representation of selected points If 0 selected points arecircles if 1 selected points are stars
labvar names of variables var1 and var2
axis 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
Each site is associated to a value of lsquovar1rsquo and a value of lsquovar2rsquo There is an interactivity betweenthe two windows the sites selected by lsquopointrsquo or lsquopolygonrsquo on the scatterplot are represented on themap in red sites selected on the map are then represented in red on the scatterplot Users have thepossibility to draw linear predictor for lsquoresponsersquo in linear model or conditionnal quantile regressionspline (option opt and quantiles)
Value
A vector of boolean of size n TRUE if the site was in the last selection
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
dblehistomap histobarmap scattermap densitymap
Examples
library tcltk and fields data baltimoredata(baltimore)scattermap(baltimore$Xbaltimore$Ybaltimore$PRICEbaltimore$SQFTlistvar=baltimore listnomvar=names(baltimore)labvar=c(SQFTPRICE)criteria=(baltimore$CITCOU==1)axis=TRUElablong=Xlablat=Yopt=2)
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
66 selectgraph
colombuscontourslt-map2list(x)colombuslt-x$attdatascattermap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALcolombus$CRIMElabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus))
Data Eiredata(eire)data(eirepolys)eirecontourslt-polylist2list(eirepolys)scattermap(eire$V1eire$V2eire$ROADACCeire$OWNCONSlistvar=eirelistnomvar=names(eire)carte=eirecontourslabvar=c(RoutesTaux de consomation)opt=2quantiles=095)
selectgraph Selection of an additionnal grah
Description
The function lsquoselectgraphrsquo is used in most of the GeoXp functions to choose an additional graphand the variables associated to this graph
Usage
selectgraph(listnomvar listgraph)
Arguments
listnomvar list of names of variables given
listgraph kind of graphics
Details
This function is not an interactive function
Value
Names of variables and graph chosen
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
selectmap 67
selectmap Selection of a point or polygon on a scatterplot
Description
The function lsquoselectmaprsquo is used to select a point or a polygon on the map or on a scatterplot Calledby any function which draws a scatterplot
Usage
selectmap(var1 var2 obs Xpoly Ypoly method = )
Arguments
var1 a vector x of size n
var2 a vector y of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method lsquopointrsquo if the selected area is a point lsquopolyrsquo if the selected area is a polygon
Details
This function is called by all the functions which draw a scatterplot such as scattermapr moran-plotmapr This is not an interactive function
Value
A vector of boolean of size n TRUE if a site has been selected FALSE otherwise
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
68 selectstat
selectstat Selection of values on a graphic
Description
The function lsquoselectstatrsquo is used to select sites on a graphic such as Histogram Barplot Box-plot Polyboxplot Scatterplot Densityplot Neighbourplot Lorentz Moran Angleplot VariocloudCluster or PCA Most of the GeoXp functions call selectstatr
Usage
selectstat(var1 var2 obs Xpoly Ypoly method nbcol W F long lat)
Arguments
var1 1st variable of size n
var2 2nd variable of size n
obs a boolean vector of size n TRUE if a site is already selectioned FALSE other-wise
Xpoly X-coordinates of the vertices of selected polygon
Ypoly Y-coordinates of the vertices of selected polygon
method name of the graph wich must be drawn among Histogram Barplot BoxplotPolyboxplot Densityplot Neighbourplot Lorentz Anglepoint Variopoint
nbcol nbcol number of cells for the histogram (10 by default)
W A spatial weight matrix of size ntimes n
F a numerical vector
long a vector of x-axis of size n
lat a vector of y-axis of size n
Details
This function is not an interactive function
Value
Return a vector of boolean of size n with TRUE if sites have been selected on a graph
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
slider1 69
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
slider1 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter
Usage
slider1(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
Value
Draws a tcltk window
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
70 slider2
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
slider2 Scroll bar
Description
Creates a scroll bar for modifying the value of a parameter (same as slider1r)
Usage
slider2(fenetre refreshcode names minima maxima resolutionsstarts no = 0)
Arguments
fenetre number of windows
refreshcode name of function called after modifying the value of a parameter
names title for scroll bar
minima minimum value of parameter
maxima maximum value of parameter
resolutions scale
starts Initial Value
no number of scroll bar
Details
This function is used in the functions which draw a curve to modify the smoothing parameter Thisis not an interactive function
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
spdf2list 71
Value
Drawing of a tcltk window
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
See Also
densitymapdbledensitymap
spdf2list Extract from a lsquoSpatialPolygonsDataFramersquo object the middle coor-dinates of boundary box and the vertices of the polygons (in the casewhere polygons are given)
Description
The function lsquospdf2listrsquo calculates the middle coordinates of boundary box and in the case wherepolygons are included into a lsquoSpatialPolygonsDataFramersquo object it extracts the vertices of the poly-gons seperating polygons from each other by 3 rows of NaN
Usage
spdf2list(data)
Arguments
data A lsquoSpatialPolygonsDataFramersquo object
Details
The user can then represent the coordinates of sites of a lsquoSpatialPolygonsDataFramersquo object asbackground map using the option lsquocartersquo included in all interactive functions
Value
It returns two vectors of middle coordinates for x-axis and y-axis cooresponding to middle of eachboundary box It returns a matrix of numeric values with 2 columns (x and y coordinates of thevertices of the polygons) where polygons are seperated from each other by 3 rows of NaN
Note
The data of a lsquoSpatialPolygonsDataFramersquo object can be directly extract using data
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
72 variocloudmap
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Bivand R (2006) lsquoThe rgdal packagersquo httpcranr-projectorgdocpackagesrgdalpdf
See Also
polylist2listmap2list
variocloudmap Interactive variocloud and map
Description
The function lsquovariocloudmaprsquo draws a semi-variocloud (directional or omnidirectional) and a mapIt is used to detect spatial autocorrelation Possibility to draw the empirical semi-variogram and arobust empirical semi-variogram
Usage
variocloudmap(long lat var bin = NULL quantiles = NULLlistvar = NULL listnomvar = NULL criteria = NULLcarte = NULL label = symbol = 0 labvar = axis = FALSE lablong = lablat = )
Arguments
long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
bin list of values where empirical variogram is evaluated
quantiles list of values of quantile orders (the regression quantile is obtained by splinesmoothing)
listvar matrix of variables
listnomvar names of variables listvar
criteria a vector of size n of boolean with TRUE on specific sites (these for non interac-tive selection)
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
variocloudmap 73
carte matrix with 2 columns for drawing spatial polygonal contours x and y coordi-nates of the vertices of the polygon
label vector of character of size n with names of sites
symbol 0 (by default) or 1 choice of representation of selected points If 0 selectedpoints are circles if 1 selected points are stars
labvar name of var
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
axis a boolean with TRUE for drawing axes on the map
Details
For some couple of sites (si sj) the graph represents on the y minus axis the semi squared differencebetween vari and varj
γij =12(vari minus varj)2
and on the x minus absis the distance hij between si and sj The semi Empirical variogram has beencalculated as
γ(h) =1
2|N(h)|sumN(h)
(Z(si)minus Z(sj))2
whereN(h) = (si sj) si minus sj = h i j = 1 n
and the robust version
γ(h) =1
2(0457 + 0494|N(h)| )
(1
|N(h)|sumN(h)
|Z(si)minus Z(sj)|12)4
The number N of points to evaluate the empirical variogram and the distance ε between points areset as follows
N =1
max(30n2 008 dD)
and ε =
D
N
with D = max(hij)minusmin(hij)
and d = max(h(l)
ij minus h(l+1)ij )
where h(l) is the vector of sorted distances In options possibility to represent a regression quantilesmoothing spline gα (in that case the points below this quantile curve are not drawn)
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
74 variocloudmap
Value
A matrix of boolean of size ntimes n TRUE if the couple of site was in the last selection of points
Author(s)
Thomas-Agnan C Aragon Y Ruiz-Gazen A Laurent T Robidou L
References
Aragon Yves Perrin Olivier Ruiz-Gazen Anne Thomas-Agnan Christine (2006) ldquoStatistique etEconomeacutetrie pour donneacutees geacuteoreacutefeacuterenceacutees modegraveles et eacutetudes de casrdquo
Cressie N and Hawkins D (1980) ldquoRobust estimation of the variogramrdquo in Journal of the interna-tional association for mathematical geology 13 115-125
See Also
angleplotmap driftmap
Examples
data afcondata(afcon)obslt-variocloudmap(afcon$xafcon$yafcon$totconlistvar=afconlistnomvar=names(afcon)label=afcon$namecriteria=(afcon$totcongtmean(afcon$totcon)))
Data Colombusx lt- readshape(systemfile(shapescolumbusshp package=maptools)[1])colombuscontourslt-map2list(x)colombuslt-x$attdataobslt-variocloudmap(colombuscontours$Xcolombuscontours$Ycolombus$HOVALlabel=colombus$NEIGNO carte=colombuscontours$polylistvar=colombuslistnomvar=names(colombus)quantiles=095)
data meusedata(meuseall)data(meuseriv)obslt-variocloudmap(meuseall$xmeuseall$ymeuseall$zincquantiles=095listvar=meusealllistnomvar=names(meuseall))points(meuseriv type = l asp = 1)
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
Index
lowastTopic datasetsafcon 3auckpolys 6auckland 7baltimore 8boston 11eire 28eirepolys 29meuseall 45meuseriv 47oldcol 54oldcolpolys 55
lowastTopic manipdistchi2 26map2list 44polylist2list 61spdf2list 70
lowastTopic multivariateclustermap 16dblehistomap 21densitymap 23genpca 31histobarmap 38pcamap 56polyboxplotmap 59scattermap 63
lowastTopic regressionscattermap 63
lowastTopic smoothdbledensitymap 19densitymap 23
lowastTopic spatialangleplotmap 4barmap 9boxplotmap 12carte 14clustermap 16dbledensitymap 19dblehistomap 21densitymap 23driftmap 27findneighbors 30genpca 31
GeoXp-package 2gini 33ginimap 34graphique 36histobarmap 38histomap 40makedistanceW 42makeneighborsw 43moranplotmap 47neighbourmap 50nonormmoran 52normw 53pcamap 56polyboxplotmap 59rotation 62scattermap 63selectgraph 65selectmap 66selectstat 67slider1 68slider2 69variocloudmap 71
lowastTopic univarbarmap 9boxplotmap 12densitymap 23ginimap 34histomap 40
lowastTopic utilitiescarte 14findneighbors 30graphique 36rotation 62selectgraph 65selectmap 66selectstat 67
afcon 3angleplotmap 4 28 62 73auckpolys 6auckland 7
baltimore 8barmap 9 18
75
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
76 INDEX
boston 11boxplotmap 12
carte 14clustermap 16 26 33 58
dbledensitymap 19 39 60 69 70dblehistomap 21 23 39 60 64densitymap 10 13 21 23 23 25 41 64
69 70distchi2 26driftmap 5 27 73
eire 28eirepolys 29
findneighbors 30 43 44
genpca 31 58GeoXp (GeoXp-package) 2GeoXp-package 2gini 33 35ginimap 34 34graphique 36
histobarmap 10 13 21 23 25 38 39 4160 64
histomap 10 13 21 25 40 41
makedistanceW 30 42 44 49 51 53makeneighborsw 30 43 43 49 51 53map2list 44 61 71meuseall 45meuseriv 47moranplotmap 30 43 44 47 51 53
neighbourmap 49 50 53nonormmoran 49 51 52normw 43 44 49 51 53 53
oldcol 54oldcolpolys 55
pcamap 18 33 56polyboxplotmap 59polylist2list 45 61 71
rotation 28 62
scattermap 10 13 21 23 25 39 41 6063 64
selectgraph 65selectmap 66selectstat 67slider1 68
slider2 69spdf2list 45 61 70
variocloudmap 5 28 62 71
Recommended