
Last chance! 50% off unlimited learning
Sale ends in
Compute root mean squared error for linear (mixed effects) models.
rmse(model, normalized = FALSE)
Linear model of class lm
, merMod
(lme4)
or lme
(nlme).
Logical, use TRUE
if normalized rmse should be returned.
Numeric, the root mean squared error.
The RMSE is the square root of the variance of the residuals and indicates the absolute fit of the model to the data (difference between observed data to model's predicted values). It can be interpreted as the standard deviation of the unexplained variance, and is in the same units as the response variable. Lower values indicate better model fit.
The normalized RMSE is the proportion of the RMSE related to the range of the response variable. Hence, lower values indicate less residual variance.
# NOT RUN {
library(nlme)
m <- lme(distance ~ age, data = Orthodont)
# RMSE
rmse(m, normalized = TRUE)
# normalized RMSE
rmse(m, normalized = TRUE)
# }
Run the code above in your browser using DataLab