cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
nil
nil
Level III

Getting mode statistics in tabulate

Hi JMP user community,

I have periodic inprocess record for batches manufactured, monitoring frequency is every 15 mins.

I have to calculate batch specific mode for the respective in-process entry.

I can't see the option of mode statistics in Analyze > tabulate. I am using JMP 14.3.0.

Is there way to get Mode as statistics using tabulate.

Thanks!

nil_0-1591448022987.png

 

 

2 REPLIES 2
txnelson
Super User

Re: Getting mode statistics in tabulate

Mode is not available in Tabulate, however it is available in Distribution, and with a little JSL, it can be added to your Tabulate table.  All it takes is to precalculate the MODE and then add it as a new column into your data table.

mode.PNG

The missing values are because for those heights, multiple mode values were found.

Here is the JSL

names default to here(1);
dt=open("$SAMPLE_DATA/big class.jmp");
dis = dt << Distribution(invisible,
	Continuous Distribution(
		Column( :height ),
		Customize Summary Statistics( Mode( 1 ) )
	),by(:age)
);
dtstats = report(dis[1])["Summary Statistics"][TableBox(1)]<<make combined data table(invisible);
dis << close window;
dtstats << select where(:Column 1 != "Mode");
dtstats << delete rows;
dtstats << delete columns({"Y","Column 1"});
dtstats:Column 2 << set name ("Mode");
dtstats:age << data type(numeric)<<modeling type(ordinal);
dt << Update(
	With( dtstats ),
	Match Columns( :age = :age )
);
close( dtstats, nosave );

dt << Tabulate(
	Change Item Label( Statistics( Mean, "height" ) ),
	Show Control Panel( 0 ),
	Add Table(
		Column Table( Statistics( Mean ), Analysis Columns( :height ) ),
		Column Table( Statistics( Std Dev ), Analysis Columns( :height ) ),
		Column Table( Analysis Columns( :Mode ), Statistics( Mean ) ),
		Row Table( Grouping Columns( :age ) )
	)
);
Jim
nil
nil
Level III

Re: Getting mode statistics in tabulate

Thanks for the script!
This is helpful..