cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar

How to export values from "Fit group" regression analysis from many variables Y to one X variable?

Hi,

I am interested in testing and comparing the correlation of many (hundreds) of Y variables individually to a single X variable. The "fit Y by X" function seems appropriate.

How do I generate the statistics for each Y variable in a batch, and export them to a data table? Can I apply the saved script to the data table and add the values to the table for instance?

2 ACCEPTED SOLUTIONS

Accepted Solutions
pmroz
Super User

Re: How to export values from "Fit group" regression analysis from many variables Y to one X variable?

Ian's solution here will work.

 

Here's some sample code:

 

 

dt = open("$sample_data\Car Physical Data.jmp");

biv = dt << Fit Group(
     Bivariate( Y( :Weight ), X( :Turning Circle ), Fit Line( {Line Color( {213, 72, 87} )} ) ),
     Bivariate( Y( :Weight ), X( :Displacement ), Fit Line( {Line Color( {213, 72, 87} )} ) ),
     Bivariate( Y( :Weight ), X( :Horsepower ), Fit Line( {Line Color( {213, 72, 87} )} ) ),
     Bivariate( Y( :Weight ), X( :Gas Tank Size ), Fit Line( {Line Color( {213, 72, 87} )} ) ),
     <<{Arrange in Rows( 4 )}
);

// A reference to the report layer: bivRep is also a list
bivRep = biv << Report;

// 'Make Combined Data Table' avoids having to message to each item in 'bivRep'
dt2 = bivRep[1][TableBox(2)] << Make Combined Data Table;

dt4 = bivRep[1][TableBox(4)] << Make Combined Data Table;

 

View solution in original post

Jeff_Perkinson
Community Manager Community Manager

Re: How to export values from "Fit group" regression analysis from many variables Y to one X variable?

There's actually no scripting required here.

You can convert any table in a report into a data table by right clicking on it and choosing Make into Data Table.

9215_JMPScreenSnapz001.png9216_JMPScreenSnapz002.png

If, as in your case, you have lots of analyses in your report window, you can choose Make Combined Data Table which will make one data table that combines all the tables like the one you click on.

9217_JMPScreenSnapz003.png

Here in the it's sometimes easier to show how to do something by posting a script, but most everything you can do through a script you can do interactively.

-Jeff

-Jeff

View solution in original post

3 REPLIES 3
pmroz
Super User

Re: How to export values from "Fit group" regression analysis from many variables Y to one X variable?

Ian's solution here will work.

 

Here's some sample code:

 

 

dt = open("$sample_data\Car Physical Data.jmp");

biv = dt << Fit Group(
     Bivariate( Y( :Weight ), X( :Turning Circle ), Fit Line( {Line Color( {213, 72, 87} )} ) ),
     Bivariate( Y( :Weight ), X( :Displacement ), Fit Line( {Line Color( {213, 72, 87} )} ) ),
     Bivariate( Y( :Weight ), X( :Horsepower ), Fit Line( {Line Color( {213, 72, 87} )} ) ),
     Bivariate( Y( :Weight ), X( :Gas Tank Size ), Fit Line( {Line Color( {213, 72, 87} )} ) ),
     <<{Arrange in Rows( 4 )}
);

// A reference to the report layer: bivRep is also a list
bivRep = biv << Report;

// 'Make Combined Data Table' avoids having to message to each item in 'bivRep'
dt2 = bivRep[1][TableBox(2)] << Make Combined Data Table;

dt4 = bivRep[1][TableBox(4)] << Make Combined Data Table;

 

Re: How to export values from "Fit group" regression analysis from many variables Y to one X variable?

Thank you so much, PMroz, for having taken your time . I just wonder why JMP does not have a simpler way of saving results, especially for those who are not as scripting-savvy as you are, obviously.

Cheers.

Jeff_Perkinson
Community Manager Community Manager

Re: How to export values from "Fit group" regression analysis from many variables Y to one X variable?

There's actually no scripting required here.

You can convert any table in a report into a data table by right clicking on it and choosing Make into Data Table.

9215_JMPScreenSnapz001.png9216_JMPScreenSnapz002.png

If, as in your case, you have lots of analyses in your report window, you can choose Make Combined Data Table which will make one data table that combines all the tables like the one you click on.

9217_JMPScreenSnapz003.png

Here in the it's sometimes easier to show how to do something by posting a script, but most everything you can do through a script you can do interactively.

-Jeff

-Jeff