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?


1 Answer 1


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$.

  • $\begingroup$ 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? $\endgroup$
    – Jdoe
    May 28, 2020 at 20:50
  • $\begingroup$ Let's call it fitted value. They are the same but maybe prediction is a word used more in time series. $\endgroup$
    – Ale
    May 29, 2020 at 7:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.