predicting linear regression value for a variable in r using lm code example Example: how to do linear regression in r lm(y ~ . , data = ...)