Learn R Programming

smacpod (version 1.2.3)

tolenv: Tolerance envelopes for log ratio of spatial densities.

Description

tolenv determines tolerance envelopes for the log ratio of spatial densities of cases and controls. Specifically, the function identifies where the observed log ratio of spatial densities exceeds what is expected under the random labeling hypothesis. Results can be easily plotted using the contour or image functions.

Usage

tolenv(object, level = 0.9, alternative = "two.sided")

Arguments

object
An im object from the logrr function.
level
Confidence level. Should be a number between 0 and 1. Default is 0.95.
alternative
Default is "two.sided". Can also be "greater" or "lower".

Value

  • Returns an tolenv object. This is just a list with components x, y, and z the can be used with the image or contour functions quite easily.

Details

alternative ="two.sided" identifies locations where the observed log ratio of spatial densities is below and above, respectively, the (1-level)/2 and 1 - (1-level)/2 quantiles of log ratios of spatial densities simulated under the random labeling hypothesis. "greater" finds where the observed ratio exceeds the "level" quantile. "lower" finds where the observed ratio exceeds the 1 - level quantile.

The z argument of the list returned has a -1 for locations where the observed log ratio of spatial densities is below the tolerance envelope, a 0 for locations within the tolerance envelope, and a 1 for locations where the log ratio of spatial densities exceeds the tolerance envelope.

References

Waller, L.A. and Gotway, C.A. (2005). Applied Spatial Statistics for Public Health Data. Hoboken, NJ: Wiley.