prevR (version 3.3)

prevR-class: Objects of class prevR.

Description

Class used by the package prevR

Arguments

Slots

clusters

data.frame with observed data (one line per cluster). Columns names are:

  • "id" cluster ID.

  • "x" longitude.

  • "y" latitude.

  • "n" number of valid observations per cluster.

  • "pos" number of positive cases per cluster.

  • "prev" observed prevalence (in %) in the cluster (pos/n).

  • "wn" (optional) sum of weights of observations per cluster.

  • "wpos" (optional) sum of weights of positive cases per cluster.

  • "wprev" (optional) weighted observed prevalence (in %) in the cluster (wpos/wn).

  • "c.type" (optional) cluster type.

boundary

object of class SpatialPolygons, borders of the studied area.

proj

object of class CRS, map projection used.

rings

list of results returned by rings. 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.

Objects from the Class

Objects of this class could be created by the function as.prevR.

Methods

as.data.frame

signature(x = "prevR") converts an object of class prevR into a data frame.

as.SpatialGrid

signature(object = "prevR") generates a spatial grid.

export

signature(object = "prevR") exports a prevR object as a shapefile, a dbase file or a text file.

idw

signature(formula = "ANY", locations = "prevR") calculates a spatial interpolation using an inverse distance weighting.

kde

signature(object = "prevR") estimates a prevalence surface using kernel density estimators.

krige

signature(formula = "ANY", locations = "prevR") calculates a spatial interpolation by kriging.

plot

signature(x = "prevR", y = "ANY") plots data of a prevR object.

print

signature(x = "prevR") shows a summary of a prevR object.

rings

signature(object = "prevR") calculates rings of equal number of observations and/or equal radius.

show

signature(object = "prevR") shows a summary of a prevR object.

summary

signature(object = "prevR") shows a summary of the variables of a prevR object.

changeproj

signature(object = "prevR") changes the map projection used.

See Also

as.prevR, is.prevR, changeproj,prevR-method, rings,prevR-method, print,prevR-method, plot,prevR-method, summary,prevR-method, kde,prevR-method, krige,prevR-method, idw,prevR-method, export,prevR-method.

Examples

Run this code
# NOT RUN {
showClass("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)

# }
# NOT RUN {
 dhs <- rings(fdhs,N=c(100,300,500))
 str(dhs)
 print(dhs)
# }

Run the code above in your browser using DataCamp Workspace