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
rahulsmils
Level III

statistics summary from jmp table

Dear all,

 

I have a jmp data table as shown in Input data table format below with multiple columns ~50

Also the number of rows is flexible it can vary from class1 to class 100

 

I intend to generate a statistics summary jmp table as shown in output table format.

Right now the way I am doing this is very cumbersome as I am hard coding each column name and that occupies much of code.

Is there a quicker way at arriving at the final statistics table.

//---Input data table
			A       B		C     ..............about 50 columns

class1     21.5		54.9
class2	   22.3		65.9
class3     29.2		58.5
class4     32.1		76.1
class5     54.7		87.1
class6     23.9		89.2


//---Output desired 


		Mean(of class1 to 6)    	Median(of class1 to 6)		Interquartile range(of class1 to 6)      standard deviation(of class1 to 6)   range(of class1 to 6)
A
B
C
.
.
.


//--Present approach----bad way: group, stack and then split----->>

		Grouped_Sum = dt <<
		Summary(
			Median(
				:Name("A"),:Name("B"),.......
			),
			
			Std Dev(
				:Name("A"),:Name("B"),.......
			),
			
			Mean(
				:Name("A"),:Name("B"),.......
			),
			
			Interquartile Range(
				:Name("A"),:Name("B"),.......
			),
			
			Range(
				:Name("A"),:Name("B"),.......
			),
			Freq( "None" ),
			Weight( "None" )
		);
	

Stack_me = Grouped_Sum <<
		Stack(
			columns(
				:Name("Median(A)"),:Name("Median(B)"),....,
				:Name("Std Dev(A)"),:Name("Std Dev(B)"),
				:Name("Interquartile Range(A)",),:Name("Interquartile Range(B)"),
				.......
			),
			Source Label Column( "Label" ),
			Stacked Data Column( "Data" ),
			Drop All Other Columns( 1 ),
			Output Table( "stacked_data" )
		);

Final = Stack_NMT << Split( 
	Split By( :handle ), 
	Split( :Data ), 
	Group( :something ), 
	Remaining Columns( Drop All ) 
	);

Thanks in advance.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: statistics summary from jmp table

2 responses

1. You should be able to go directly to the ouput display you want if you use

     Analyze==>Tabulate

2. You don't need to do any typing of the input for the approach you are taking.  If you just interactively run the summary, and create the summary data table, if you go to the table panel on the upper left side of the output data table, it will have a selection called "Source" and if you edit it, it has all of the code already generated that was used to create the summary output.  You can do the same for the Stack step and the Split step.  All you need to do is the copy and paste the JSL

 

Jim

View solution in original post

4 REPLIES 4
txnelson
Super User

Re: statistics summary from jmp table

2 responses

1. You should be able to go directly to the ouput display you want if you use

     Analyze==>Tabulate

2. You don't need to do any typing of the input for the approach you are taking.  If you just interactively run the summary, and create the summary data table, if you go to the table panel on the upper left side of the output data table, it will have a selection called "Source" and if you edit it, it has all of the code already generated that was used to create the summary output.  You can do the same for the Stack step and the Split step.  All you need to do is the copy and paste the JSL

 

Jim
rahulsmils
Level III

Re: statistics summary from jmp table

Thanks Jim. Tabulate works for me perfectly.
Is there a way I can send output table of tabulate to a jmp data table ?

txnelson
Super User

Re: statistics summary from jmp table

Yes, under the red triangle, is an option "Make into Data Table".    You need to get in the habit of exploring all of the red triangles etc.

Jim
rahulsmils
Level III

Re: statistics summary from jmp table

Thanks so much. I also figured it out by myself just now :)