f_auc | R Documentation |
These functions take a data frame with a binomial response "y" with unique values 1 and 0, and a continuous predictor "x", fit a univariate model, to return the Area Under the ROC Curve (AUC) of observations versus predictions:
f_auc_glm_binomial()
: AUC of a binomial response against the predictions of a GLM model with formula y ~ x
, family stats::quasibinomial(link = "logit")
, and weighted cases (see case_weights()
) to control for unbalanced data.
f_auc_glm_binomial_poly2()
: AUC of a binomial response against the predictions of a GLM model with formula y ~ stats::poly(x, degree = 2, raw = TRUE)
, family stats::quasibinomial(link = "logit")
, and weighted cases (see case_weights()
) to control for unbalanced data.
f_auc_gam_binomial()
: AUC of a GAM model with formula y ~ s(x)
, family stats::quasibinomial(link = "logit")
, and weighted cases.
f_auc_rpart()
: AUC of a Recursive Partition Tree with weighted cases.
f_auc_rf()
: AUC of a Random Forest model with weighted cases.
f_auc_glm_binomial(df)
f_auc_glm_binomial_poly2(df)
f_auc_gam_binomial(df)
f_auc_rpart(df)
f_auc_rf(df)
df |
(required, data frame) with columns:
|
Other preference_order_functions:
f_r2
,
f_r2_counts
,
f_v()
,
f_v_rf_categorical()
Other preference_order_functions:
f_r2
,
f_r2_counts
,
f_v()
,
f_v_rf_categorical()
Other preference_order_functions:
f_r2
,
f_r2_counts
,
f_v()
,
f_v_rf_categorical()
Other preference_order_functions:
f_r2
,
f_r2_counts
,
f_v()
,
f_v_rf_categorical()
Other preference_order_functions:
f_r2
,
f_r2_counts
,
f_v()
,
f_v_rf_categorical()
Other preference_order_functions:
f_r2
,
f_r2_counts
,
f_v()
,
f_v_rf_categorical()
#load example data
data(vi)
#reduce size to speed-up example
vi <- vi[1:1000, ]
#integer counts response and continuous predictor
#to data frame without NAs
df <- data.frame(
y = vi[["vi_binomial"]],
x = vi[["swi_max"]]
) |>
na.omit()
#AUC of GLM with binomial response and weighted cases
f_auc_glm_binomial(df = df)
#AUC of GLM as above plus second degree polynomials
f_auc_glm_binomial_poly2(df = df)
#AUC of binomial GAM with weighted cases
f_auc_gam_binomial(df = df)
#AUC of recursive partition tree with weighted cases
f_auc_rpart(df = df)
#AUC of random forest with weighted cases
f_auc_rf(df = df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.