prevR-class: Objects of class prevR.

Description Slots Objects from the Class Methods See Also Examples

Description

Class used by the package prevR

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 \

  • "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 \

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

boundary

object of class sp::SpatialPolygons, borders of the studied area.

proj

object of class sp::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 \

  • "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 \

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(), rings(), print(), plot(), summary(), kde(), krige(), idw(), export().

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
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)

## End(Not run)

prevR documentation built on Aug. 28, 2020, 5:08 p.m.