class_trajectory: Classify Trajectory Measure for County Data

Description Usage Arguments Value Examples

View source: R/count_metrics.R

Description

This function tests to see if the count trajectory is statistically distinct from zero with a Poisson test for the ratio of two counts using poisson.test as.calculated by pval_trajectory at the two-sided p < .05 level. If it is and the percent change as calculated by score_trajectory is less than or equal to -10, the trajectory is classified as shrinking. If it is and the percent change is greater than or equal to 10, the trajectory is classified as growing. If the test fails to reject the null hypothesis, the trajectory is classified as not statistically significant.

Usage

1
class_trajectory(traj, pval)

Arguments

traj

trajectory as calculated by score_trajectory

pval

p-value as calculated by pval_trajectory

Value

an ordered factor "Shrinking" < "No statistically significant change" < "Growing"

Examples

1
2
3
4
traj <- score_trajectory(curr = 100L, prev = 80L)
traj_pval  <- pval_trajectory(curr = 100L, prev = 80L)

traj_class <- class_trajectory(traj, traj_pval)

carlbfrederick/ohiCovidMetrics documentation built on Jan. 10, 2022, 12:20 p.m.