### Import Data

# install.packages("sp")
library(sp)
data(meuse)

### Build a Model using Simple Linear Regression

Linear regression is one of the most traditional way of examining the relationships among predictors and variables. As we discussed in a previous post about the general idea of modeling and machine learning, we may have the purpose of inference the relationships among variables.

We use the lm function over here:

m1<-lm(lead~cadmium,data = meuse)
m1
##
## Call:
##       71.44        25.24
lead = 25.24 * cadmium + 71.44 The model above shows that, on average, when cadmium increases 1 unit, lead increases 25.24 units.