AUC of Logistic GAM Model with Weighted Cases
f_gam_auc_unbalanced.Rd
Fits a quasibinomial logistic Generalized Additive Model (GAM) y ~ s(x, k = 3)
with weighted cases between a binary response and a numeric predictor and returns the Area Under the Curve of the observations versus the predictions.
Arguments
- x
(required, character string) name of the predictor variable.
- y
(required, character string) name of the binary response variable
- df
(required, data frame) data frame with the columns 'x' and 'y'.
Examples
data(vi)
#subset to limit example run time
vi <- vi[1:1000, ]
#this example requires "mgcv" installed
if(requireNamespace(package = "mgcv", quietly = TRUE)){
f_gam_auc_unbalanced(
x = "growing_season_length", #predictor
y = "vi_binary", #response
df = vi
)
}
#> [1] 0.9367964