classifyCaseRegression: Create Case Flags based on regression slope

View source: R/library--analysis_tools--DHS_methods--classification_function.R

classifyCaseRegressionR Documentation

Create Case Flags based on regression slope

Description

Create Case Flags based on regression slope

Usage

classifyCaseRegression(
  DF,
  slopeThreshold = 5,
  minSize = 200,
  per_changed_column = modeled_percentchange,
  model_sig_column = lmreg_sig
)

Arguments

DF

dataframe that contains results of buildRegressionEstimateTable

slopeThreshold

number threshold for case_flag flagging

minSize

case threshold for case_flag_plus_comm.threshold flagging

per_changed_column

column name of estimated percent change of signal

model_sig_column

column name of significance of linear model that generated the percent change

Value

DF with an three extra column Category containing the case flags case_flag: when the 7 day slope is above slopeThreshold case_flag_plus_comm.threshold: when case flag and more then 200 cases slope_switch_flag: the first case flags in consecutive case flags

Examples

example_DF <- data.frame(site = "madison", lmreg_slope = 5, value = 300)
classifyCaseRegression(example_DF)

Covid19Wastewater documentation built on Aug. 25, 2023, 1:07 a.m.