Learn R Programming

gsClusterDetect (version 1.0.0)

add_spline_threshold: Use spline lookup to restrict `ObservedExpectedGrid` to potential clusters

Description

Function takes a spline lookup table (or uses package default), and an object of class `ObservedExpectedGrid` and identifies which rows in each potential centroid have observed over expected values that exceed a threshold for that observed value

Usage

add_spline_threshold(oe_grid, spline_lookup = NULL)

Value

an object of class `ClusterAlertTable` which is simply a data frame containing rows of the input `oe_grid`` that represent the reduced set of candidate alert clusters

Arguments

oe_grid

An object of class `ObservedExpectedGrid` generated by generate_observed_expected()

spline_lookup

default NULL; either a spline lookup table, which is a data frame that has at least two columns: including "observed" and "spl_thresh", OR a string indicating to use one of the built in lookup tables: i.e. one of "001", "005", "01", "05". If NULL, the default table will be 01 (i.e. spline_01 dataset)

Examples

Run this code
case_grid <- generate_case_grids(
  example_count_data, example_count_data[, max(date)]
)
nci <- gen_nearby_case_info(
  cg = case_grid,
  distance_matrix = county_distance_matrix("OH")[["distance_matrix"]],
  distance_limit = 25
)
obs_exp_grid <- generate_observed_expected(
  nearby_counts = nci,
  case_grid = case_grid
)
add_spline_threshold(oe_grid = obs_exp_grid)
add_spline_threshold(oe_grid = obs_exp_grid, spline_lookup = "01")

Run the code above in your browser using DataLab