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

Box plot mean point

Is there a way to add a mark for the mean value to a boxplot in JMP?
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Box plot mean point

As written above,

 

You'll need first to create a variability/gauge chart, then select the "show box plots" option to add the boxes. You should then find that the means are shown automatically, but if they're not, click on the small red triangle to the left of the "Variability Gauge" header and select "Show cell means". To join them up as well, check "Connect cell means".

The following script should create a set of box plots on a dummy data file and join the means as described above:

dt1 = New Table( "Data Table",
	add rows( 50 ),
	New Column( "Group", character ),
	New Column( "Data", numeric )
);
For( i = 1, i <= N Row( dt1 ), i++,
	Column( dt1, "Group" )[i] = Choose( Random Integer( 1, 5 ),
		"A",
		"B",
		"C",
		"D",
		"E"
	);
	Column( dt1, "Data" )[i] = Random Uniform( 0, 100 );
);
Variability Chart(
	Y( :Data ),
	X( :Group ),
	Analysis Type( Name( "Box Plot" ) ),
	Connect Cell Means( 1 ),
	Std Dev Chart( 1 ),
	Show Box Plots( 1 )
);

 

View solution in original post

4 REPLIES 4

Re: Box plot mean point

You'll need first to create a variability/gauge chart, then select the "show box plots" option to add the boxes. You should then find that the means are shown automatically, but if they're not, click on the small red triangle to the left of the "Variability Gauge" header and select "Show cell means". To join them up as well, check "Connect cell means".


The following script should create a set of box plots on a dummy data file and join the means as described above:

dt1 = New Table( "Data Table",
	add rows( 50 ),
	New Column( "Group", character ),
	New Column( "Data", numeric )
);
For( i = 1, i <= N Row( dt1 ), i++,
	Column( dt1, "Group" )[i] = Choose( Random Integer( 1, 5 ),
		"A",
		"B",
		"C",
		"D",
		"E"
	);
	Column( dt1, "Data" )[i] = Random Uniform( 0, 100 );
);
Variability Chart(
	Y( :Data ),
	X( :Group ),
	Analysis Type( Name( "Box Plot" ) ),
	Connect Cell Means( 1 ),
	Std Dev Chart( 1 ),
	Show Box Plots( 1 )
);

 

Re: Box plot mean point

Thank you! I tried it and it works.
Naama
rc_hertzy
Level III

Re: Box plot mean point

If you are considering ANOVA, then use One Way (e.g., from the JMP Starter window) on the data and select Display Options>Box Plots, and Display Options>Connect Means. It treats the x axis as categories, so if a continuous variable, the spacing is not correct. In this example with dose-response data, Dose is the X,Grouping variable. What I like is then the Oneway window is open so you can explore other analyses (e.g., equal variances).
Here is a script:

New Window(
"Dataset: Oneway of Response by Dose",
H List Box(
Oneway(
Y( :Response ),
X( :Name( "Dose" ) ),
Box Plots( 1 ),
Connect Means( 1 ),
Mean Diamonds( 0 ),
Points Jittered( 1 ),
Grand Mean( 0 )
), ) );

Re: Box plot mean point

As written above,

 

You'll need first to create a variability/gauge chart, then select the "show box plots" option to add the boxes. You should then find that the means are shown automatically, but if they're not, click on the small red triangle to the left of the "Variability Gauge" header and select "Show cell means". To join them up as well, check "Connect cell means".

The following script should create a set of box plots on a dummy data file and join the means as described above:

dt1 = New Table( "Data Table",
	add rows( 50 ),
	New Column( "Group", character ),
	New Column( "Data", numeric )
);
For( i = 1, i <= N Row( dt1 ), i++,
	Column( dt1, "Group" )[i] = Choose( Random Integer( 1, 5 ),
		"A",
		"B",
		"C",
		"D",
		"E"
	);
	Column( dt1, "Data" )[i] = Random Uniform( 0, 100 );
);
Variability Chart(
	Y( :Data ),
	X( :Group ),
	Analysis Type( Name( "Box Plot" ) ),
	Connect Cell Means( 1 ),
	Std Dev Chart( 1 ),
	Show Box Plots( 1 )
);