MATLAB can do this if you make your scatter plot and then in the figure window go to "Tools -> Basic Fitting". That will then allow you to draw a bunch of different data fits onto your diagram, output the residuals, output the formulae, etc.
I'm sure there is probably a way to call this all programatically but I don't know of it.
I know there are also fitting tools in some of the MATLAB licensed toolboxes, but I don't currently have access to any of those so I can't really be much help on those.
Perhaps somebody else might be able to help with the gaps here!