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

Show means on box plot in graph builder

Is there any way to show and connect means on a box plot in graph builder? Is there also a way to show the diamonds that point to the mean without bottom and top 5% of outliers?

1 ACCEPTED SOLUTION

Accepted Solutions
Jeff_Perkinson
Community Manager Community Manager

Re: Show means on box plot in graph builder

This is easily done interactively.

 

Start with the box plots turned on. Then click and drag the points element into the graph. Change the summary statistic for the points to mean. Then drag the line element into the graph.

 

ScreenFlow.gif

-Jeff

View solution in original post

19 REPLIES 19
gzmorgan0
Super User (Alumni)

Re: Show means on box plot in graph builder

Right click on the graph builder frame box and select Customize. Then select a box and there is a check box for Confidence Interval.

 

Via the UI you have to edit each box. Below is a picture with several options that you can select.

image.png

However, it is much easier to do this via a script. The script to create the picture below is attached.

 image.png

 

Thomas1
Level V

Re: Show means on box plot in graph builder

I'm also interested in this topic. What is the best way to show the numeric mean of each box at the corresponding box?

gzmorgan0
Super User (Alumni)

Re: Show means on box plot in graph builder

The attached script has been updated. Note this script shows hardcoded column names and rounding units, it does not  include data prep etc. Both the mean and n has been added 

image.png  

Thomas1
Level V

Re: Show means on box plot in graph builder

Thanks. That is a great solution. Is there a way to do this without scripting, by using default built in features in JMP?

gzmorgan0
Super User (Alumni)

Re: Show means on box plot in graph builder

Right click on the Graph Builder Frame Box. Select Customize.  Select the  plus sign (+)  above the list of boxplots.

Select the  Templates menu above the Script Box, and select Text, then fill in the information. Select Text again and add the information for the next box.  Note there is an option available in JMP 14 Graph Builder boxplots to show the 5 number summay for the box, but that does not include the mean.

image.png

image.png

Thomas1
Level V

Re: Show means on box plot in graph builder

Thanks for your advice on how to customize graphs. What are the 5 numbers within the 5 Numbers Summary in JMP 14? Could you display an example? Unfortunately I don't have access to JMP 14 yet.

gzmorgan0
Super User (Alumni)

Re: Show means on box plot in graph builder

I am learning on the fly. JMP 14 already has a feature that fulfilled my wish list: the CaptionBox has a factor checkbox so it work for each category displayed on the X-Axis.

This displays the 5 number summary (min, Q1, Median, Q3, max) and the means as a caption box.

 

image.pngHere is the script showing the customization, for just the first boxplot.

Graph Builder(
	Size( 1029, 608 ),
	Show Control Panel( 0 ),
	Variables( X( :Month ), Y( :Sales ) ),
	Elements(
		Box Plot( X, Y, Legend( 6 ), Name( "5 Number Summary" )(1) ),
		Line( X, Y, Legend( 7 ) ),
		Caption Box(
			X,
			Y,
			Legend( 9 ),
			X Position( "Middle" ),
			Y Position( "Bottom" ),
			Per Factor( 1 )
		)
	),
	SendToReport(
		Dispatch(
			{},
			"Sales",
			ScaleBox,
			{Min( 50 ), Max( 700 ), Inc( 100 ), Minor Ticks( 1 )}
		),
		Dispatch(
			{},
			"Graph Builder",
			FrameBox,
			{DispatchSeg(
				Box Plot Seg( "Box Plot (June)" ),
				{Box Style( "Solid" ), Confidence Diamond( 1 ), Fences( 0 ),
				Fill Color( {162, 43, 221} )}
.....

Re: Show means on box plot in graph builder

I think the easiest way to get the mean labeled on the boxplot graph is to add another element. Use the Shift-click on the bar chart icon. Make sure that the summary statistic for the bar chart is the Mean. Change the bar style to "Float". You then have the option to "Label by Value". All interactive and provides the label. Enclosed is an example using Big Class Families (with the control panel still on so you can see those options).Boxplot with Labeled Mean.PNG

 

 

 

Dan Obermiller
Thomas1
Level V

Re: Show means on box plot in graph builder

Thanks Dan. That is great way to show the mean right at the box plot.