f_gam_deviance {collinear} | R Documentation |
Explained Deviance from univariate GAM model
Description
Computes the explained deviance of a response against a predictor via Generalized Additive Model (GAM). This option is slower than f_rsquared()
, but suitable if you will be fitting GAMs with the resulting preference order.
Usage
f_gam_deviance(x, y, df)
Arguments
x |
(required, character string) name of the predictor variable. |
y |
(required, character string) name of the response variable |
df |
(required, data frame) data frame with the columns 'x' and 'y'. |
Value
Explained deviance
Examples
data(vi)
#subset to limit example run time
vi <- vi[1:1000, ]
#this example requires "mgcv" installed in the system
if(requireNamespace(package = "mgcv", quietly = TRUE)){
f_gam_deviance(
x = "growing_season_length", #predictor
y = "vi_mean", #response
df = vi
)
}
[Package collinear version 1.1.1 Index]