This package performs a methodological approach for spatial estimation of regional trends
of a prevalence using data from surveys using a stratified two-stage sample design
(as Demographic and Health Surveys). In these kind of surveys, positive and control cases
are spatially positioned at the centre of their corresponding surveyed cluster.
This package provides functions to estimate a prevalence surface using a kernel estimator
with adaptative bandwiths of equal number of persons surveyed (a variant of the nearest
neighbour technique) or with fixed bandwiths. The prevalence surface could also be calculated
using a spatial interpolation (kriging or inverse distance weighting) after a moving average
smoothing based on circles of equal number of observed persons or circles of equal radius.
With the kernel estimator approach, it's also possible to estimate a surface of relative risks.
For a quick demo, enter quick.prevR(fdhs)
.
For a full demo, enter demo(prevR)
.
The content of prevR can be broken up as follows:
Datasets
fdhs is a fictive dataset used for testing the package.
TMWorldBorders provides national borders of every countries in the World and
could be used to define the limits of the studied area.
Creating objects
prevR functions takes as input ojects of class '>prevR.
import.dhs()
allows to import easily, through a step by step procedure,
data from a DHS (Demographic and Health Surveys) downloaded from
http://www.measuredhs.com.
as.prevR()
is a generic function to create an object of class
'>prevR.
create.boundary()
could be used to select borders of a country and
transfer them to as.prevR()
in order to define the studied area.
Data visualisation
Methods show()
, print()
and summary()
display a summary of a object of class
'>prevR.
The method plot()
could be used on a object of class
'>prevR for visualising the studied area, spatial position
of clusters, number of observations or number of positive cases by cluster.
Data manipulation
The method changeproj()
changes the projection
of the spatial coordinates.
The method as.data.frame()
converts an object of
class '>prevR into a data frame.
The method export()
export data and/or the studied
area in a text file, a dbf file or a shapefile.
Data analysis
rings()
calculates rings of equal number of
observations and/or equal radius.
kde()
calculates a prevalence surface or a relative
risks surface using gaussian kernel density estimators (kde) with adaptative bandwiths.
krige()
executes a spatial interpolation using an
ordinary kriging.
idw()
executes a spatial interpolation using an inverse
distance weighting (idw) technique.
Results visualisation and export
Outputs of kde()
, krige()
and idw()
are objects of class
sp::SpatialPixelsDataFrame.
Results could be plotted using the function sp::spplot()
.
prevR provides several continuous color palettes (see prevR.colors)
compatible with sp::spplot()
.
Calculated surfaces could be export using the function
maptools::writeAsciiGrid()
.