prevR-package | R Documentation |

prevR allows spatial estimation of a prevalence surface or a relative risks surface, using data from a Demographic and Health Survey (DHS) or an analog survey.

Package: | prevR |

Type: | Package |

Licence: | CeCILL-C - https://cecill.info/licences/Licence_CeCILL-C_V1-en.html |

Website: | https://larmarange.github.io/prevR/ |

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 bandwidths of equal number of persons surveyed (a variant of the nearest neighbor technique) or with fixed bandwidths. 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 objects 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 visualization*

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 visualizing 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 bandwidths.

`krige()`

executes a spatial interpolation using an
ordinary kriging.

`idw()`

executes a spatial interpolation using an inverse
distance weighting (idw) technique.

prevR has been developed with funding from the French National Agency for Research on AIDS and Viral Hepatitis (ANRS - http://www.anrs.fr) and the French Research Institute for Sustainable Development (IRD - https://www.ird.fr), and technical support from LYSIS (info@lysis-consultants.fr).

To cite prevR:

Larmarange Joseph, Vallo Roselyne, Yaro Seydou, Msellati Philippe and
Meda Nicolas (2011) "Methods for mapping regional trends of HIV prevalence
from Demographic and Health Surveys (DHS)",
*Cybergeo: European Journal of Geography*, no 558,
https://journals.openedition.org/cybergeo/24606,
DOI: 10.4000/cybergeo.24606.

Joseph Larmarange joseph.larmarange@ird.fr

IRD - CEPED (UMR 196 Université Paris Descartes Ined IRD)

Larmarange Joseph and Bendaud Victoria (2014) "HIV estimates at second
subnational level from national population-based survey",
*AIDS*, n° 28, p. S469-S476, DOI: 10.1097/QAD.0000000000000480

Larmarange Joseph, Vallo Roselyne, Yaro Seydou, Msellati Philippe and Meda
Nicolas (2011) "Methods for mapping regional trends of HIV prevalence from
Demographic and Health Surveys (DHS)",
*Cybergeo: European Journal of Geography*, n° 558,
https://journals.openedition.org/cybergeo/24606,
DOI: 10.4000/cybergeo.24606

Larmarange Joseph (2007) *Prévalences du VIH en Afrique : validité
d'une mesure*, PhD thesis in demography, directed by Benoît Ferry,
université Paris Descartes,
https://theses.hal.science/tel-00320283.

Larmarange Joseph, Vallo Roselyne, Yaro Seydou, Msellati Philippe Meda
Nicolas and Ferry Benoît (2006), "Cartographier les données des enquêtes
démographiques et de santé à partir des coordonnées des zones d'enquête",
*Chaire Quételet, 29 novembre au 1er décembre 2006*, Université
Catholique de Louvain, Louvain-la-Neuve, Belgique.

```
## Not run:
par(ask = TRUE)
# Creating an object of class prevR
col <- c(
id = "cluster",
x = "x",
y = "y",
n = "n",
pos = "pos",
c.type = "residence",
wn = "weighted.n",
wpos = "weighted.pos"
)
dhs <- as.prevR(fdhs.clusters, col, fdhs.boundary)
str(dhs)
print(dhs)
plot(dhs, main = "Clusters position")
plot(dhs, type = "c.type", main = "Clusters by residence")
plot(dhs, type = "count", main = "Observations by cluster")
plot(dhs, type = "flower", main = "Positive cases by cluster")
# Changing coordinates projection
plot(dhs, axes = TRUE)
dhs <- changeproj(
dhs,
"+proj=utm +zone=30 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"
)
print(dhs)
plot(dhs, axes = TRUE)
# Calculating rings of equal number of observations for different values of N
dhs <- rings(dhs, N = c(100, 200, 300, 400, 500))
print(dhs)
summary(dhs)
# Prevalence surface for N=300
prev.N300 <- kde(dhs, N = 300, nb.cells = 200)
plot(
prev.N300["k.wprev.N300.RInf"],
pal = prevR.colors.red,
lty = 0,
main = "Regional trends of prevalence (N=300)"
)
# Smoothing ring radii surface (spatial interpolation by kriging)
radius.N300 <- krige("r.radius", dhs, N = 300, nb.cells = 200)
plot(
radius.N300,
pal = prevR.colors.blue,
lty = 0,
main = "Radius of circle (N=300)"
)
par(ask = FALSE)
## End(Not run)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.