I am trying to script a fit X by Y with a by variable, then fit each with a polynomial (degree = 2) and then extract the "summary of fit" data (specifically the R Square and number of observations) to a data table. As an example I was working with the Car Physical Data sample set. For example use Weight as the Y, Horsepower as the X, and Type as the By. Then fit with each group with a 2nd order poly. extract all summary of fit diagnostics using make combined data table. I know how to do it with the gui but need to script it to perform much larger operation.