Subscribe Bookmark RSS Feed

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

andreas_scherer

Community Trekker

Joined:

Jan 18, 2015

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?

3 REPLIES
pmroz

Super User

Joined:

Jun 23, 2011

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;

andreas_scherer

Community Trekker

Joined:

Jan 18, 2015

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

Joined:

Jun 23, 2011

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