I have a doubt in calculating Residual values for a given regression model. Consider this case (first table with x and y values). As we know that residual values are (y-y_hat), I calculated them using the same formula and the values i got are same as mentioned in the website i linked. But, when i try to find the residuals using fitlm/LinearModel.fit methods, I get different values. please see the code and help me where I'm wrong.
y=[70 65 70 95 85]';
x=[60 70 80 85 95]';
The Output I'm getting for the above code is,
which doesn't match with the residuals given in the website