f_gam_auc_unbalanced {collinear} | R Documentation |
AUC of Logistic GAM Model with Weighted Cases
Description
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.
Usage
f_gam_auc_unbalanced(x, y, df)
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'. |
Value
Area Under the Curve
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
)
}
[Package collinear version 1.1.1 Index]