Learn R Programming

sjstats (version 0.14.3)

rmse: Compute model quality

Description

Compute root mean squared error, residual standard error or mean square error of fitted linear (mixed effects) models.

Usage

rmse(fit, normalized = FALSE)

rse(fit)

mse(fit)

Arguments

fit

Fitted linear model of class lm, merMod (lme4) or lme (nlme).

normalized

Logical, use TRUE if normalized rmse should be returned.

References

Grace-Martin K: Assessing the Fit of Regression Models

See Also

r2 for R-squared or pseude-R-squared values, and cv for the coefficient of variation.

Examples

Run this code
# 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