# What happens to the error term when create a linear model in R?

Suppose we have a linear model i.e

$$y_i = \alpha + \beta x_i + \epsilon_i$$

Now if I try lm(y ~ x) in R, what happens to my $$\epsilon_i$$ term? Or would there be no error since it is estimated by the residuals?

The error term $$\epsilon_i$$ is something that you don't observe.
You assume a linear model $$y_i = \alpha + \beta x_i + \epsilon_i$$ for some $$y$$ and $$x$$, then you can estimate $$\alpha$$ and $$\beta$$ using lm(y ~ x), you can then compute the predictions $$\hat{y}_i=\hat{\alpha}+\hat{\beta}x_i$$ and the residuals $$e_i = y_i-\hat{y}_i$$.
• Thanks for the answer! Just a question relating to the $\hat{y}_i$. Now is this a fitted value or a predicted value or is there any difference? – Jdoe May 28 '20 at 20:50