score_trajectory: Trajectory Measure for Count Data

Description Usage Arguments Details Value Examples

View source: R/count_metrics.R

Description

Calculates the ratio of the most current to previous period counts. Values greater than 1 indicate growing; less than one indicate shrinking. NOTE: Counts must have the same period (e.g. both summed over 7 consecutive days.) In order to avoid extreme values and dividing by zeros, the ratio uses an offset of 0.5 for both the numerator and denominator as pseudocounts and is capped at 5 (i.e. a 400% increase).

Usage

1
score_trajectory(curr, prev)

Arguments

curr

vector of counts for current period (must be non-negative integer)

prev

vector of counts for previous period (must be non-negative integer)

Details

The 0.5 offset was inspired by the bayes.poisson.test function from the BayesianFirstAid packages uses a non-informative prior distribution whose mean simplifies to approximately 0.5. For more information, see the reproducibility paper on the OHI Surveillance Team's SharePoint site.

Value

a numeric vector

Examples

1
traj <- score_trajectory(curr = 100L, prev = 80L)

lcrayton18/State_package_burdenandtrajectory documentation built on July 19, 2020, 12:37 a.m.