r_squared: Return actual R² for any model type, e.g. classic LMs as well...

r_squaredR Documentation

Return actual R² for any model type, e.g. classic LMs as well as GAMs or Boosted Tree models.

Description

This function returns a calculation of the R² of your model based on the squared correlation between actual and predicted values. This is much more stable than the classic lm() function of S and R, which fails already when you delete the intercept.

Usage

r_squared(model = model1)

Arguments

model

Input data. Just name the model you want to have the R² calculated for. Defaults to maRketingscience's "model1".

Examples

r_squared(model)
r_squared()

benetheking/maRketingscience documentation built on May 17, 2022, 5:57 a.m.