Learn R Programming

prevR (version 2.2)

rings,prevR-method: Calculation of rings of equal number of observation and/or equal radius.

Description

For each cluster, this function determines a ring of equal number of observations and/or equal radius and calculates several indicators from observations located inside that ring.

Usage

rings(object, N = seq(100, 500, 50), R = Inf, progression = TRUE)

Arguments

object
object of class prevR.
N
minimum number of observations.
R
maximum rings radius (in kilometers if coordinates in decimal degrees, in the unit of the projection otherwise).
progression
show a progress bar?

Value

  • Return object with the slot rings completed for each couple (N,R). Each entry is composed of 3 elements: N, minimum number of observations per ring; R, maximum radius of rings and estimates, a data frame with the following variables:
    • "id" cluster ID.
    • "r.pos" number of positive cases inside the ring.
    • "r.n" number of valid observations inside the ring.
    • "r.prev" observed prevalence (in \%) inside the ring (r.pos/r.n).
    • "r.radius" ring radius (in kilometers if coordinates in decimal degrees, in the unit of the projection otherwise).
    • "r.clusters" number of clusters located inside the ring.
    • "r.wpos" (optional) sum of weights of positive cases inside the ring.
    • "r.wn" (optional) sum of weights of valid observations inside the ring.
    • "r.wprev" (optional) weighted observed prevalence (in \%) inside the ring (r.wpos/r.wn).
    Note: the list rings is named, the name of each element is NN_value.RR_value, for example N300.RInf. Note 2: r.wpos, r.wn and r.wprev are calculated only if the slot clusters of object contains weighted data.

encoding

utf8

Details

Pour each ligne of the data frame clusters of object, rings determines a ring, centred on the cluster. It could be:
  • rings of eaqul number of observations ifNis finite andR=Inf;
  • rings of equal radius ifN=InfandRis finite;
  • a combination of both (see below) ifNandRare finite.
For rings of equal number of observations, rings selects the smallest ring containing at least N valid observations. For rings of equal radius, rings selects all clusters located at a lower distance than R from the central cluster. For combination of both, rings calculates firts the ring with the minimum number of observations and test if its radius is lower than R or not. If so, the ring is kept, otherwise the ring of maximum radius is calculated. Different series of rings could be simultaneoulsy calculated by providing different values for N and R. rings will calculate rings corresponding to each couple (N,R).

References

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, http://cybergeo.revues.org/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, http://tel.archives-ouvertes.fr/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, http://www.uclouvain.be/13881.html.

See Also

prevR-class.

Examples

Run this code
print(fdhs)
dhs <- rings(fdhs,N=c(100,200,300,400,500))
print(dhs)

Run the code above in your browser using DataLab