See the Scripting Guide and search for Scripting-Only Messages and Arguments by Platform. The messages and options are different by model.
Standard Least Squares
The following JSL messages return the requested item from the fitted model, such as variance components, p-values, parameter estimates, and so on:
fit_model_object << Get Variance Components( );
fit_model_object << Get Effect Names( );
fit_model_object << Get Effect PValues( );
fit_model_object << Get Estimates( );
fit_model_object << Get Parameter Names( );
fit_model_object << Get Random Effect Names( );
fit_model_object << Get Std Errors( );
fit_model_object << Get X Matrix( );
fit_model_object << Get XPX Inverse( );
fit_model_object << Get Y Matrix( );
The following message for Standard Least Squares objects is available only in JSL:
obj << Get SQL prediction expression;
___________________________________________________________________________________
For the last example, xx = FM << get prediction Formula; show(xx);
/*Log
xx = New Column("y", Numeric, Formula((-2.69577290612704) + Match(:Drug, "a", -1.18503653738055, "d", -1.07606520517145, "f", 2.261101742552, .) + 0.987183811129848 * :x), Set Property("Predicting", {:y, Creator("Fit Least Squares")}));
Are you asking how to write a script to get the formulas from an already created window with a fitted report? If yes, let's see if I can emulate that situation: Help> Scripting Index>Objects>Fit Model > Least Squares then run the sample script.
obj the reference to the Least Squares Fit is only recognized within that script. To be able to get the formula you needto get a handle to the model object. There might be another method, but here is my method:
- prompt for the window or use window name to create a handle to the report
- get its child and the first OutlIne Box
- get the scriptable Object
- get the formula.
If your script has multiple models, I recommend you use Xpath to get all instances. The attached script gets the formulas from the Scripting Index script. The report has 2 responses (2 models) and creates an associative array of formulas.
I am not sure this is what you were asking for. By the way, once you have a handle(reference) to the scrtiptable object you can send it messages to save the formulas to the table. One of the nice features of Xpath, and get scriptable object, it might find 20 models, but you can send the message once and it is applied to each of the models.
If this isn't your question, please clarify.