Compute root mean squared error, residual standard error or mean square error of fitted linear (mixed effects) models.
rmse(fit, normalized = FALSE)rse(fit)
mse(fit)
Fitted linear model of class lm
, merMod
(lme4)
or lme
(nlme).
Logical, use TRUE
if normalized rmse should be returned.
r2
for R-squared or pseude-R-squared values, and
cv
for the coefficient of variation.
# NOT RUN {
data(efc)
fit <- lm(barthtot ~ c160age + c12hour, data = efc)
rmse(fit)
rse(fit)
library(lme4)
fit <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy)
rmse(fit)
mse(fit)
# normalized RMSE
library(nlme)
fit <- lme(distance ~ age, data = Orthodont)
rmse(fit, normalized = TRUE)
# }
Run the code above in your browser using DataLab