Fit X by Y with by group and 2-polynomial fitI 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.
ScriptingRe: Fit X by Y with by group and 2-polynomial fitI suggest that you actually get the result you want interactively. Then click the red triangle for the result for one of the By groups and select Save script > To Script Window. Now just change the Where( :by = xxx ) to By( :by ).