Calculate Predicted Bounds for Analyze_TimeZFunnel Visualization
PredictBounds_TimeZFunnel.RdApplies gsm.core::Analyze_NormalApprox_PredictBounds() to each month of
dfAnalyzed, producing funnel plot bounds for each month.
Usage
PredictBounds_TimeZFunnel(
dfAnalyzed,
vThreshold = c(-3, -2, 2, 3),
nMinSiteFraction = 0.2
)Arguments
- dfAnalyzed
A data frame output from
Analyze_TimeZFunnel(). Must contain columns:NMonth,GroupID,GroupLevel,Numerator,Denominator, andMetric.- vThreshold
Numeric vector of threshold values for bounds. Default is
c(-3, -2, 2, 3). A threshold of 0 (for the mean line) is automatically included bygsm.core::Analyze_NormalApprox_PredictBounds.- nMinSiteFraction
Minimum fraction of peak site count required to return non-
NAbounds for a month. Months where the number of distinctGroupIDs is below this fraction of the maximum are returned withMetric = NA. Default is0.2(20%).
Value
A data frame with columns:
NMonth: Time point (month number).Threshold: Threshold value (e.g., -3, -2, 0, 2, 3).Denominator: Sample size / exposure value.LogDenominator: Log of Denominator.Numerator: Predicted numerator at this threshold.Metric: Predicted Metric value at this threshold.
Multiple rows are returned per month per threshold, covering the range of Denominator values observed in the data.
See also
Analyze_TimeZFunnel() for calculating funnel scores,
gsm.core::Analyze_NormalApprox_PredictBounds for the underlying
bounds calculation.