Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

model-quality

Compute model quality for a given dataset


Description

Three summaries are immediately interpretible on the scale of the response variable:

  • rmse() is the root-mean-squared-error

  • mae() is the mean absolute error

  • qae() is quantiles of absolute error.

Other summaries have varying scales and interpretations:

  • mape() mean absolute percentage error.

  • rsae() is the relative sum of absolute errors.

  • mse() is the mean-squared-error.

  • rsquare() is the variance of the predictions divided by the variance of the response.

Usage

mse(model, data)

rmse(model, data)

mae(model, data)

rsquare(model, data)

qae(model, data, probs = c(0.05, 0.25, 0.5, 0.75, 0.95))

mape(model, data)

rsae(model, data)

Arguments

model

A model

data

The dataset

probs

Numeric vector of probabilities

Examples

mod <- lm(mpg ~ wt, data = mtcars)
mse(mod, mtcars)
rmse(mod, mtcars)
rsquare(mod, mtcars)
mae(mod, mtcars)
qae(mod, mtcars)
mape(mod, mtcars)
rsae(mod, mtcars)

modelr

Modelling Functions that Work with the Pipe

v0.1.8
GPL-3
Authors
Hadley Wickham [aut, cre], RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.