Add columns flagging sites that represent possible statistical outliers when the Fisher's Exact Test is used.
Value
data.frame
with one row per site with columns: GroupID
, Numerator
, Denominator
, Metric
, Score
, PredictedCount
, and Flag
.
Details
This function flags sites based on the Fisher's Exact Test result as part of the GSM data model (see vignette("DataModel")
).
Data Specification
Flag_Fisher
is designed to support the input data (dfAnalyzed
) generated from the Analyze_Fisher
function. At a minimum, the input must define a dfAnalyzed
data frame with Score
, Prop
, and Prop_Other
variables included and a vThreshold
. These inputs will be used to identify possible statistical outliers in a new Flag
column by comparing Score
, Prop
, and Prop_Other
values to the specified thresholds.
The following columns are considered required:
GroupID
- Group ID; default isSiteID
GroupLevel
- Group TypeScore
- P-value calculated from the rates of exposure provided toAnalyze_Fisher()
Prop
- Proportion of events of interest over days of exposureProp_Other
- Cumulative proportion of events of interest over days of exposure
Examples
dfTransformed <- Transform_Rate(analyticsInput)
dfAnalyzed <- Analyze_Poisson(dfTransformed)
#> ℹ Fitting log-linked Poisson generalized linear model of [ Numerator ] ~ [ log( Denominator ) ].
dfFlagged <- Flag(dfAnalyzed, vThreshold = c(-5, 5))