Learn R Programming

performance (version 0.1.0)

mse: Mean Square Error of Linear Models

Description

Compute mean square error of linear models.

Usage

mse(model)

Arguments

model

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

Value

Numeric, the mean square error of model.

Details

The mean square error is the mean of the sum of squared residuals, i.e. it measures the average of the squares of the errors. Lower values (closer to zero) indicate better fit.

Examples

Run this code
# NOT RUN {
data(mtcars)
m <- lm(mpg ~ hp + gear, data = mtcars)
mse(m)

# }

Run the code above in your browser using DataLab