Learn R Programming

smacpod (version 1.0.0)

logrr: Log ratio of spatial densities

Description

logrr computes the log ratio of spatial density functions. This ratio is within an additive constant of the log relative risk. The numerator in this ratio is related to the "cases" and the denominator to the "controls".

Usage

logrr(f, g)

Arguments

f
An object from the spdensity function. Typically is related to the "cases".
g
An object from the spdensity function. Typically is related to the "controls".

Value

  • The function produces an object of the same type as the density.ppp function from the spatstat package, with the intensity values replaces by the log ratio of the spatial densities f and g.

References

Waller, L.A. and Gotway, C.A. (2005). Applied Spatial Statistics for Public Health Data. Hoboken, NJ: Wiley. Kelsall, Julia E., and Peter J. Diggle. "Kernel estimation of relative risk." Bernoulli (1995): 3-16. Kelsall, Julia E., and Peter J. Diggle. "Non-parametric estimation of spatial variation in relative risk." Statistics in Medicine 14.21-22 (1995): 2335-2342.

Examples

Run this code
data(grave)
cases = which(grave$marks == "affected")
f = spdensity(grave[cases,], sigma = 700)
g = spdensity(grave[-cases,], sigma = 700)
contour(logrr(f, g))

Run the code above in your browser using DataLab