dbledensitymap {GeoXp}R Documentation

Double Kernel density estimates and map

Description

The function `dbledensitymap' plots two kernel density estimates from $var1$ and $var2$, computed with `bkde.R', and a map with sites of coordinates $(long,lat)$. Each site is associated to a value of $var1$ and $var2$ and the two windows are interactive.

Usage

dbledensitymap(long, lat, var1, var2,kernel='triweight', listvar = NULL, 
               listnomvar = NULL, carte = NULL, criteria = NULL, label = "", 
               symbol = 0, color = 1, labvar = c("var1", "var2"), 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$
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 interactive selection)
carte matrix with 2 columns for drawing spatial polygonal contours : $x$ and $y$ coordinates 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 barplot as an additionnal graph). If 0, sites are represented in blue, 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 circles, 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 upper boundaries of the interval or by giving directly these values. The selected sites are then represented on the map in red. A selection by `points' or `polygon' on the map results in the drawing of the density of the corresponding sub-distribution on the density plot. Finally, the user can modify the bandwith parameter with a cursor in the tcltk window (parameter $α$). $α$ is the smoothing parameter for the kernel smooth : it represents the mean percentage of sample points involved in the local averaging (example : $α=20$ means that on average, $n times 0.2$ points are in any interval 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), ``Statistique et Econométrie pour données géoréférencées : modèles et études de cas''

Venables, W. N. and Ripley, B. D. (2002) ``Modern Applied Statistics with S''. New York: Springer.

Wand M.P. et Jones M.C. (1995), ``Kernel Smoothing'', Chapman & Hall.

See Also

histomap, histobarmap, scattermap, densitymap

Examples

# data auckland
data(auckland)
data(auck.polys)
contours.auckland<-polylist2list(auck.polys)
dbledensitymap(auckland$Easting,auckland$Northing,var1=auckland$Deaths.1977.85,
var2=auckland$Under.5.1981,carte=contours.auckland,
listvar=cbind(auckland,as.numeric(auckland$Deaths.1977.85>
mean(auckland$Deaths.1977.85))), listnomvar=c(names(auckland),"sup to mean"),
labvar=c("Deaths.1977.85","Under.5.1981"),
criteria=(auckland$Deaths.1977.85>mean(auckland$Deaths.1977.85)))

# data columbus
#x <- read.shape(system.file("shapes/columbus.shp", package="maptools")[1])
#colombus.contours<-map2list(x)
#colombus<-x$att.data
#obs<-dbledensitymap(colombus.contours$X,colombus.contours$Y,
#colombus$HOVAL,colombus$CRIME,label=colombus$NEIGNO, carte=colombus.contours$poly,
#listvar=colombus,listnomvar=names(colombus))

# data eire
data(eire)
data(eire.polys)
eire.contours<-polylist2list(eire.polys)
dbledensitymap(eire$V1,eire$V2,eire$A,eire$towns,
labvar=c("Taux d'individus au groupe sanguin A",
"Surface urbaine"),carte=eire.contours,kernel="normal",
listvar=eire,listnomvar=names(eire))


[Package GeoXp version 1.0 Index]