Austin
Austin

Reputation: 75

pull out r squared from fit model to table in JSL JMP

I'm trying to figure out how to use JSL to write some of the analysis of variance variables values to a table in JMP. My idea is to write a script that runs different types of models with different parameters with R^2 and RSME logging to a table (maybe there is a better way to do this I'm on my second day of JMP). Going through the documentation it seems that different analysis have different ways of doing this and I can't find one for "fit model". I also will need to know how to do this for a neural network which I think I may have found the documentation for.

Upvotes: 0

Views: 1640

Answers (1)

Kardo Paska
Kardo Paska

Reputation: 584

If you're doing something like screening variables to determine an optimized model, you're in the right place with the fit model platform. However, running the fit model in a loop without human judgment in model selection as you've suggested isn't necessarily expedient.

So at the expense of trying to make JMP/JSL do something it's not really suited for, one way to achieve your generic goal of grabbing text from the fit model platform output is to send your platform to a "report" and then pull from that "report" the data you want, and then send it to a data table. From that data table, you can concatenate it with another data table and you would have your log. That's the idea, here's an example, for some dummy data "Ydata" and "Xdata":

thing = Fit Model(
    Y( :Ydata ),
    Effects( :Xdata ),
    Personality( Standard Least Squares ),
    Emphasis( Minimal Report ),
    Run(
        :Ydata << {Plot Actual by Predicted( 0 ),
        Plot Residual by Predicted( 0 ), Plot Effect Leverage( 0 )}
    )
);

thing_report = thing<<report;
thing_report_dt_ref = thing_report["Summary of Fit"][1] << make into data table;
//alternatively
//thing_report_dt_ref = thing_report[TableBox(1)] << make into data table;

thing_report_dt_ref << Set Name("Choose_a_name_for_your_new_data_table");

You'd have to handle the looping part, but if you can do it once, you can do it N times.

Because JMP/JSL is stupid, you can alternatively call the "Summary of Fit" directly if your know it's name in the tree structure. In my case, its name was "TableBox(1)". Do:

thing << show tree structure

To see where your data lives in the platform display box.

Upvotes: 1

Related Questions