Hi - I'm often writing scripts that perform runs of the Fit Model platform on multiple input variables, for example as shown below:
dt = open("C:\Program Files\SAS\JMPPRO\11\Samples\Data\Airline Delays.jmp");
yVars = {"Elapsed Time", "Arrival Delay", "Distance"};
fmo = Fit Model(
Y( eval(yVars) ),
Effects( :Month ),
Personality( Standard Least Squares ),
Emphasis( Effect Leverage ),
Run(
yVars[1] << {Lack of Fit( 0 ), Plot Actual by Predicted( 0 ),
Plot Regression( 0 ), Plot Residual by Predicted( 0 ),
Plot Effect Leverage( 0 ), {:age<<
{LSMeans Student's t(0.05, Crosstab Report( 0 ) )}}},
yVars[2] << {Lack of Fit( 0 ), Plot Actual by Predicted( 0 ),
Plot Regression( 0 ), Plot Residual by Predicted( 0 ),
Plot Effect Leverage( 0 ), {:age <<
{LSMeans Student's t(0.05, Crosstab Report( 0 ) )}}},
yVars[3] << {Lack of Fit( 0 ), Plot Actual by Predicted( 0 ),
Plot Regression( 0 ), Plot Residual by Predicted( 0 ),
Plot Effect Leverage( 0 ), {:age <<
{LSMeans Student's t(0.05, Crosstab Report( 0 ) )}}},
)
);
What I'd like to know is this: is there an easy way I can compact the various statements within the "Run" phrase into a single set of commands that will apply to all of the input variables? In the above example I've only had to do this three times, but often I've got dozens of variables being processed. I'd like to avoid the repetition of all the lack of fit, plot regression, leverage and letters reports etc if at all possible, not least because I could then make some of my function calls a lot more generic. I've tried an assortment of list constructions and for loops within the Run( ) phrase but to no avail - but I could easily just not have hit on the correct syntax yet.
Many thanks.