Skip to contents

[Stable]

Add columns flagging sites that represent possible statistical outliers when the Fisher's Exact Test is used.

Usage

Flag_Fisher(dfAnalyzed, vThreshold = NULL)

Arguments

dfAnalyzed

data.frame where flags should be added.

vThreshold

Vector of 2 numeric values representing lower and upper p-value thresholds.

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 is SiteID

  • GroupLevel - Group Type

  • Score - P-value calculated from the rates of exposure provided to Analyze_Fisher()

  • Prop - Proportion of events of interest over days of exposure

  • Prop_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))