cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
LiG
LiG
Level I

how do i create a summary table with means and the signifcantly different letters ?

Hello

I use jmp to analyze experiments and than i need to show the means in a summary table with the signifcantly different letters (using one of the compare means test such as student t or tukey kramer)

i don't know how to do it in one table with jmp so what i do is to export each table (for each parameter separately) to excel and than sort it out there but it takes a lot of time

is there a way to do it in an easy way with jmp?

what i want in the end is a table that looks like this 

treatmentparamter 1paramter 2paramter 3paramter 4paramter 5
treatment 1100 A     32 A  98 A   54 AB 95 A  
treatment 275     E 23   C79   C 45   C68   C
treatment 397 AB    31 A  98 A   58 A  96 A  
treatment 494  BC   30 AB 95 AB  56 A  95 A  
treatment 591   CD  30 AB 94 AB  51 ABC93 A  
treatment 689    D  27 ABC93  B  48  BC82  B 
treatment 771      F25  BC58    D47   C64   C
treatment 895  B    28 ABC96 AB  54 AB 93 A  

or if it's not possible than maybe one table for the means and another for the letters or something like that 

 

someone have an easy way to do it ?

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: how do i create a summary table with means and the signifcantly different letters ?

Go to the pull down menus and select
File==>New==>Script
Then cut and paste the script from the webpage to the script window

Click on the Run icon run.PNG to run the script.  

Make sure it gives you the same results and that it is what you want. 

Concerning the Student t vs. the Kramer's etc.  that can be changed in the script. "All Pairs" in the line

ow = dt << Oneway( invisible, Y( Column( dt, colNames[p] ) ), X( Column( dt, factor ) ), All Pairs( 1 ) );

refers to Tukey

"Each Pair" in the below line refers to Student t

ow = dt << Oneway( invisible, Y( Column( dt, colNames[p] ) ), X( Column( dt, factor ) ), Each Pair( 1 ) );

The JSL I provided is a good start to get you where you want to go.  The expectation, is that what is provided will give you a good "leg up" in getting your problem solved.  Just as you have done with Excel, there is learning that needs to take place.  

The Community is here to help make the learning curve as easy as it can.

I strongly suggest that you take the time to go through some of the JMP Documentation.  In particular, the documents, Discovering JMP, Using JMP and then after that, the Scripting Guide.

     Help==>JMP Documentation Library

 

Everything that is done in the script, can be done interactively too.

  1. Run the Fit Y by X analysis you want, and generate the Letters Comparisons
  2. Right click on the Letters Table, and select Columns.
  3. Uncheck all of the columns called --Letters Column A-O
  4. Check the column called "Letters"
  5. Right click again on the Letters table, and select "Make into data table"
  6. To put the Mean column and the Letters column together, just create a new character column giving it the current parameters name.  The specify the following formula for the column
    char(:Mean) || " " || :Letters
  7. Now delete the 2 unnecessary columns, Mean and Letters
  8. If this is the 1st parameter, then just keep the table.  If this is a 2nd or later parameter, you just need to run    Tables==>Update   to put the current parameter table together with the initial table
Jim

View solution in original post

3 REPLIES 3
txnelson
Super User

Re: how do i create a summary table with means and the signifcantly different letters ?

Here is a start for creating the report table you want

letters.PNG

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );

// Specify the parameters to be analyzed and the Factor column
colNames = {"height", "weight"};
factor = "age";

// Create the beginnings of the final data table
Summarize( dt, levelGroup = by( As Column( factor ) ) );
dtFinal = New Table( "Final", New Column( "Level", character, set values( levelGroup ) ) );

// Loop across all of the parameters and gather the data
For( p = 1, p <= N Items( colNames ), p++,
	ow = dt << Oneway( invisible, Y( Column( dt, colNames[p] ) ), X( Column( dt, factor ) ), All Pairs( 1 ) );
	// Add the combined letters column
	Report( ow )["Connecting Letters Report"][String Col Box( 17 )] << visibility( "Visible" );
	// Delete all of the individual letters columns
	For( i = 2, i <= 16, i++,
		Report( ow )["Connecting Letters Report"][String Col Box( i )] << visibility( "Collapse" )
	);
	// Create a data table from the Means/Letters table
	dtLetters = Report( ow )["Connecting Letters Report"][Table Box( 1 )] << make into data table;
	// Combine the Means and Letters
	dtLetters:Mean << data type(character);
	for each row(
		dtLetters:Mean = dtLetters:Mean || " " || dtLetters:Letters;
	);
	// Change the name of the column to the parameter name
	dtLetters:Mean << set name( ColNames[p] );
	dtLetters << delete columns("letters");
	// Add the current table to the overall table
	dtFinal <<Update( With( dtLetters ), Match Columns( :Level = :Level ) );
	// Clean up the report window and temporary table
	ow << close window;
	Close( dtLetters, nosave );
);
Jim
LiG
LiG
Level I

Re: how do i create a summary table with means and the signifcantly different letters ?

Thank you

but... i am not a very sophisticated user of the software so it will help me a lot if you can please explain in more details what do i do with the code you posted?

where do i paste it and how do i choose which statiastical test to use (for example tukey kramer or student t)

Thank you very much

txnelson
Super User

Re: how do i create a summary table with means and the signifcantly different letters ?

Go to the pull down menus and select
File==>New==>Script
Then cut and paste the script from the webpage to the script window

Click on the Run icon run.PNG to run the script.  

Make sure it gives you the same results and that it is what you want. 

Concerning the Student t vs. the Kramer's etc.  that can be changed in the script. "All Pairs" in the line

ow = dt << Oneway( invisible, Y( Column( dt, colNames[p] ) ), X( Column( dt, factor ) ), All Pairs( 1 ) );

refers to Tukey

"Each Pair" in the below line refers to Student t

ow = dt << Oneway( invisible, Y( Column( dt, colNames[p] ) ), X( Column( dt, factor ) ), Each Pair( 1 ) );

The JSL I provided is a good start to get you where you want to go.  The expectation, is that what is provided will give you a good "leg up" in getting your problem solved.  Just as you have done with Excel, there is learning that needs to take place.  

The Community is here to help make the learning curve as easy as it can.

I strongly suggest that you take the time to go through some of the JMP Documentation.  In particular, the documents, Discovering JMP, Using JMP and then after that, the Scripting Guide.

     Help==>JMP Documentation Library

 

Everything that is done in the script, can be done interactively too.

  1. Run the Fit Y by X analysis you want, and generate the Letters Comparisons
  2. Right click on the Letters Table, and select Columns.
  3. Uncheck all of the columns called --Letters Column A-O
  4. Check the column called "Letters"
  5. Right click again on the Letters table, and select "Make into data table"
  6. To put the Mean column and the Letters column together, just create a new character column giving it the current parameters name.  The specify the following formula for the column
    char(:Mean) || " " || :Letters
  7. Now delete the 2 unnecessary columns, Mean and Letters
  8. If this is the 1st parameter, then just keep the table.  If this is a 2nd or later parameter, you just need to run    Tables==>Update   to put the current parameter table together with the initial table
Jim