building a statistical model in r error terms code example Example: how to do linear regression in r lm(y ~ . , data = ...)