# Finding residual and error term of a regression model [duplicate]

I am a bit confused on the difference between the residual term and the error term and how you go about finding each of these.

Suppose we have $$\hat{y_i}=\hat{\beta_0}+\hat{\beta_1}x_1+\hat{\beta_2}x_2+\hat{\beta_3}x_3+\hat{\beta_4}x_4+\hat{u_i}$$

Would the residual $\hat{u_i}$ just be: $$\hat{u_i}=\hat{y_i}-\hat{\beta_0}-\hat{\beta_1}x_1-\hat{\beta_2}x_2-\hat{\beta_3}x_3-\hat{\beta_4}x_4$$ ?

How would you then go about finding the error term $u_i$?

## marked as duplicate by whuber♦ regression StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Sep 25 '17 at 22:08

Well, technically what you wrote there is not correct, the term $u_i$ is on both sides of the equation, and from there I understand your perplexity. The Error term is one thing and the residuals are another. The error term is a random variable and the residuals are the outcome of this variable. You can find the residuals with the formula you wrote (removing the $u_i$ term of the second part) but you cannot find the error term (only it's outcomes).