Fit some models: how can i run and save all fits to the datatable?in JMP 17: I have completed a dsd with many outputs (over 100 outputs). I can use fit definitive screening to open an interface and enter all the inputs, all the outputs and it proceeds to fit a model for each output. What i want to do now is "Run Model" (for each model) and then "Save script to datatable" (for each fit model). How would i write a script to do this? chatgpt suggests the following, but i keep getting errors that it can't resolve
// Assume the Fit DSD platform is open and assigned to a variable
// Replace "FitDSDObj" with the actual variable holding your platform reference
FitDSDObj = Current Report();
// Loop through each response modeling section
ForEach(
FitDSDObj << Report As List,
ResponseSection,
// Check if this section has a "Run Model" button
If(
ResponseSection << Contains("Run Model"),
// Click "Run Model" button
(ResponseSection << Button Box("Run Model")) << Click,
// Wait briefly to allow model to fit
Wait(0.5);
// Click "Save Columns to Data Table" (could also be labeled "Save Prediction Formula" or similar)
If(
ResponseSection << Contains("Save Columns"),
(ResponseSection << Button Box("Save Columns")) << Click,
// Fallback if specific button names are known
If(
ResponseSection << Contains("Save Prediction Formula"),
(ResponseSection << Button Box("Save Prediction Formula")) << Click
)
)
)
);
Automation and ScriptingRe: Fit some models: how can i run and save all fits to the datatable?Hi @rk3,
Welcome in the Community !
I would recommend not using ChatGPT or other AI-assisted tools for JSL coding, as JSL is not a standard language that these assistants have encountered. Therefore, the syntax is very often (if not always) wrong/false by default.
You could perhaps run the analysis by "point and click" using the JMP platforms (and using CTRL + click to "Run model" for all the responses you have entered in the Fit DSD platform) and use the JSL script recorded by the JMP Log to create the script you need ?
Using the "Extraction Data" dataset from JMP, creating 2 responses so that several responses could be taken into consideration, here are the JSL parts created by the log recorder when fitting several models using Fit DSD, then running models, and finally saving prediction formula in datatable :
// Open Data Table: Extraction Data.jmp
Open( "$SAMPLE_DATA/Design Experiment/Extraction Data.jmp" );
// Creation of 2 new responses Y2 and Y3
// Launch platform: Fit Definitive Screening for 3 responses Yield, Y2 and Y3
New Window( "Extraction Data - Fit Definitive Screening",
Outline Box( "Fit Definitive Screening",
<<SETHORIZONTAL></SETHORIZONTAL>
This script won't be directly usable for your task, but it may help you understand the JSL structure. You can also look at JMP Scripting Index to better understand the language format used by JSL.
I'm sure other experienced JSL members of the Community will be able to provide a working script for your task.
Best,
Re: Fit some models: how can i run and save all fits to the datatable?Thank you! I'll try this.
Edit: on 2nd thought, this unfortunately looks just as tedious as I will have to manually go through and adjust all the term values.
I really need this to be rolled into some kind of for-loop.
Re: Fit some models: how can i run and save all fits to the datatable?My suggestion is to first evaluate the correlation between the numerous response variables. For the ones that correlate you will likely get similar models.
Really model building can't be done with just statistics. The statistics need to be interpreted in the context they were acquired. You need SME to evaluate the reasonableness of the model from a practical standpoint. I don't know how you "automate" this? The model needs to be practical, useful and as simple as possible following William of Occam's advice.