mean_squared_error <- function(lm_model){
fit <- fitted.values(lm_model)
actual <- lm_model$model[,1]
n <- length(fit)
sum((actual - fit)^2) / n
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.