kde-prevR-method: Kernel density estimation for prevR object.

Description Usage Arguments Details Value Note References See Also Examples

Description

This function allows to calculate a prevalence surface (ratio of two intensity surfaces) and/or a relative risks surface (ratio of two density surfaces) using gaussian kernel estimators with adaptative bandwiths of equal number of observations or equal radius.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## S4 method for signature 'prevR'
kde(
  object,
  N = NULL,
  R = NULL,
  weighted = TRUE,
  risk.ratio = FALSE,
  keep.details = FALSE,
  nb.cells = 100,
  cell.size = NULL,
  progression = TRUE,
  short.names = FALSE
)

Arguments

object

object of class prevR.

N

integer or list of integers corresponding to the rings to use.

R

integer or list of integers corresponding to the rings to use.

weighted

use weighted data (TRUE, FALSE or "2")?

risk.ratio

calculate a relative risks surface instead of a prevalence surface (TRUE, FALSE or "2")?

keep.details

return surface of positive cases and surface of observed cases?

nb.cells

number of cells on the longuest side of the studied area (unused if cell.size is defined).

cell.size

size of each cell (in the unit of the projection).

progression

show a progress bar?

short.names

should names of the output be short?

Details

This function calculates a prevalence surface as the ratio of the intensity surface (expressed in cases per surface unit) of positive cases on the intensity surface of observed cases and could also calculate a relative risks surface corresponding to the ratio of the density surface (whose integral has been normalized to one) of positive cas on density surface of observed cases.

This method is a variant of the nearest neighbour technique. Surfaces are estimated using gaussian kernel estimators with adaptative bandwiths, bandwith size being determined by a minimum number of observations in the neighbourhood (see rings() for more details). Fixed bandwiths could also be used. More precisely, the bandwith used is half the radius of rings of equal number of observations or equal radius (parameters N and R) calculated by the function rings().
See referenes for a detailed explanation of the implemented methodology.

N and R determine the rings to use for the estimation. If they are not defined, surfaces will be estimated for each available couples (N,R). Several estimations could be simultaneously calculated if several values of N and R are defined.

A suggested value of N could be computed with Noptim().

Value

Object of class sp::SpatialPixelsDataFrame. Surfaces are named according to the name of the corresponding variable, N and R (for example: k.prev.N300.RInf). If short.names is TRUE and if there is only one combination of couples (N, R), variable names will not be suffixed by the value of N and R.

Estimated variables are (depending on the function parameters) :

NA value is applied to cells of the grid located outside of the studied area
(see NA.outside.SpatialPolygons()).

Note

Results could be plotted with 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().

See the package sparr for another methodology to estimate relative risks surfaces, adapted for other kind of data than Demographic and Helath Surveys (DHS).

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, https://journals.openedition.org/cybergeo/24606, DOI: 10.4000/cybergeo.24606.

See Also

GenKern::KernSur(), rings(), Noptim().

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## Not run: 
  dhs <- rings(fdhs, N=c(100,200,300,400,500))
  
  prev.N300 <- kde(dhs, N=300, nb.cells=200)
  
  library(sp)
  spplot(prev.N300, 'k.wprev.N300.RInf',
         cuts=100, col.regions=prevR.colors.red(101),
         main="Regional trends of prevalence (N=300)"
  )
  
  prev.krige <- kde(dhs, N=c(100,300,500), R=Inf,
                    nb.cells=200, risk.ratio=2, keep.details=FALSE
  )
  str(prev.krige)
  spplot(prev.krige,
         c('k.wprev.N100.RInf','k.wprev.N300.RInf','k.wprev.N500.RInf'),
         cuts=100, col.regions=prevR.colors.red(101)
  )

## End(Not run)

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