Finding Mean Squared Error?

Try this:

mean((training.data - predict(training.model))^2)
#[1] 0.4467098

You can also use below mentioned code which is very clean to get mean square error

install.packages("Metrics")
library(Metrics)
mse(actual, predicted)

The first data set on which is actual one : training.data The second argument is the one which you will predict like :

pd <- predict(training.model , training.data) mse(training.data$,pd)

Seems you have not done prediction yet so first predict the data based on your model and then calculate mse


You can use the residual component from lm model output to find mse in this manner :

mse = mean(training.model$residuals^2)