cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Discovery is online this week, April 16 and 18. Join us for these exciting interactive sessions.
Choose Language Hide Translation Bar
teng_yems
Level I

How to convert 'other' result tables to Data Table using JSL

I would like to know if there's a way to convert 'other' result tables to Data Table using JSL.

Given below is a sample script and sample analysis result I got from JMP to illustrate my concern.

 

JSL:

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
Contingency( Y( :Age ), X( :sex ), Make Into Data Table );

 

For the example given below, I would like to capture the analysis result under "TEST" (highlighted in red) and convert the result table to JMP Data Table.

Please help! Thanks!

jmp_question.JPG

2 ACCEPTED SOLUTIONS

Accepted Solutions
txnelson
Super User

Re: How to convert 'other' result tables to Data Table using JSL

Almost all objects in a report window generated by JMP Platforms are accessable.  The documentation on how to access the objects is documented in

     Help==>Books==>Scripting Index

In your specific case, there are 2 Table Box() objects contained in the "Tests" Outline Box();  The Make into Data Table message can be applied to the Table Boxes.

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
con = Contingency( Y( :Age ), X( :sex ), Make Into Data Table );
Report( con )["Tests"][Table Box( 1 )] << make into data table;
Report( con )["Tests"][Table Box( 2 )] << make into data table;

The messages available to the different objects are detailed in the Scripting Index.

     Help==>Scripting Index

Jim

View solution in original post

cwillden
Super User (Alumni)

Re: How to convert 'other' result tables to Data Table using JSL

Hi @teng_yems,

Do you know how to navigate the display tree structure in JSL?  The first step is going to be getting a handle on the table box that you want to convert to a data table.  This link shows you how to view the display tree: https://www.jmp.com/support/help/14/view-the-display-tree.shtml

Once you know which display box you want, you can attach a handle to it like so:

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

//cont_win is the window containing the contingency report.  You must use the  "<< Report" message to get the window instead of the Contingency object
cont_win = (dt << Contingency( Y( :Age ), X( :sex ), Make Into Data Table ))<< Report;

//table1 will reference the table with Rsquare(U) and -loglik
table1 = cont_win["Tests"][TableBox(1)];

In this example, I first navigate down to the outline box titled "Tests" to make sure I get the right table boxes.  Being more specific will make sure your code is more robust.  Then within the "Tests" outline box, I grab the first TableBox element.

Now, to make that table into a data table, check out the "Make Into Data Table" command in the Scripting Index (Help > Scripting Index).  I bet you can put the pieces together to get first table you are after and can then write the code to get the table with Loglikelihood and Pearson test results into a data table as well.

-- Cameron Willden

View solution in original post

4 REPLIES 4
txnelson
Super User

Re: How to convert 'other' result tables to Data Table using JSL

Almost all objects in a report window generated by JMP Platforms are accessable.  The documentation on how to access the objects is documented in

     Help==>Books==>Scripting Index

In your specific case, there are 2 Table Box() objects contained in the "Tests" Outline Box();  The Make into Data Table message can be applied to the Table Boxes.

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
con = Contingency( Y( :Age ), X( :sex ), Make Into Data Table );
Report( con )["Tests"][Table Box( 1 )] << make into data table;
Report( con )["Tests"][Table Box( 2 )] << make into data table;

The messages available to the different objects are detailed in the Scripting Index.

     Help==>Scripting Index

Jim
teng_yems
Level I

Re: How to convert 'other' result tables to Data Table using JSL

Thanks so much Jim for the help!

cwillden
Super User (Alumni)

Re: How to convert 'other' result tables to Data Table using JSL

Hi @teng_yems,

Do you know how to navigate the display tree structure in JSL?  The first step is going to be getting a handle on the table box that you want to convert to a data table.  This link shows you how to view the display tree: https://www.jmp.com/support/help/14/view-the-display-tree.shtml

Once you know which display box you want, you can attach a handle to it like so:

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

//cont_win is the window containing the contingency report.  You must use the  "<< Report" message to get the window instead of the Contingency object
cont_win = (dt << Contingency( Y( :Age ), X( :sex ), Make Into Data Table ))<< Report;

//table1 will reference the table with Rsquare(U) and -loglik
table1 = cont_win["Tests"][TableBox(1)];

In this example, I first navigate down to the outline box titled "Tests" to make sure I get the right table boxes.  Being more specific will make sure your code is more robust.  Then within the "Tests" outline box, I grab the first TableBox element.

Now, to make that table into a data table, check out the "Make Into Data Table" command in the Scripting Index (Help > Scripting Index).  I bet you can put the pieces together to get first table you are after and can then write the code to get the table with Loglikelihood and Pearson test results into a data table as well.

-- Cameron Willden
teng_yems
Level I

Re: How to convert 'other' result tables to Data Table using JSL

Thanks so much for the help, Cameron!