Arguments
- dfTransformed
data.frame
Transformed data for analysis. Data should have one record per site with expected columns:GroupID
,GroupLevel
,Numerator
,Denominator
, andMetric
. For more details see the Data Model vignette:vignette("DataModel", package = "gsm")
. For this function,dfTransformed
should typically be created usingTransform_Rate()
.
Value
data.frame
with one row per site with columns: GroupID, Numerator, Denominator, Metric, Score, and PredictedCount.
Details
Fits a Poisson model to site-level data and adds columns capturing Residual and Predicted Count for each site.
More information can be found in The Poisson Regression Method of the KRI Method vignette.
Statistical Methods
This function fits a Poisson model to site-level data and then calculates residuals for each site.
The Poisson model is run using standard methods in the stats
package by fitting a glm
model with family
set to poisson
using a "log" link. Site-level residuals are calculated using stats::predict.glm
via broom::augment
.
Examples
dfTransformed <- Transform_Rate(analyticsInput)
dfAnalyzed <- Analyze_Poisson(dfTransformed)
#> ℹ Fitting log-linked Poisson generalized linear model of [ Numerator ] ~ [ log( Denominator ) ].