How can I access the linear regression equation and evaluate it at given values?

Two functions make this straightforward: linRegrSlope and linRegrIntercept. Suppose, for example, that you have data about cars, including their weight and mpg. The equation would then be:

Below you can see one way to use this idea - a summary table and slider set up to show the value predicted from the current slider value.

How can I create an attribute that shows the residuals of a least squares regression?

Use a formula similar to the one shown below.