cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
XanGregg
Staff
How to create custom error bars in Graph Builder

Within Graph Builder, scatterplots, line charts and bar charts support four kinds of error bars, or you can add your own custom error bars. It's not a well-known feature, so I’m going to walk through the steps.

What Are Error Bars?

Error bars are graphical elements that represent uncertainty. There are many measures of uncertainty that can be represented, each with its own interpretation. Error bars can be useful to show:

  • Context for a summary statistic.
  • Degrees of overlap among uncertainty ranges.
  • Inclusion of a particular value, such as if a parameter estimate's error bar contains 0.

Built-In Error Bars

When you make a summary chart in Graph Builder with points, bars or lines, there is an option in the Properties area for adding Error Bars in one of four ways: 

  • Range
  • Standard Error
  • Standard Deviation
  • Confidence Interval

Choosing Confidence Interval uses the specified confidence level, which is 95% by default. Since there are many types of error bars, all error bar choices add a note to the bottom of the graph to indicate which option was chosen.

 ebauto.png

 

Custom Error Bars on Points

To make a dot chart with custom error bars, the trick is to think about it the other way around: Make a custom bar chart with points. The Bar element in Graph Builder has a style option for Interval bars. If you give it two variables, it draws an interval. If you give it three variables, it draws an interval with the first two and a circle with the third. Just what we want!

 

I'll demonstrate with this data table, which might have been produced by an analysis. You want a graph with error bars covering the Lower 95% and Upper 95% columns in the table.

 ebtable.png

 

Open Graph Builder and put Term on the X axis and Lower 95%, Upper 95% and Mean on the common Y axis, in that order.

 eb1.png

 

Choose the Bar element, and the default style is Side by Side.

 
eb2.png

 

In the Properties panel, change the Style option to Interval

 eb3.png

 

Then click Done, and customize the labels and styling as desired.

 

eb4.png

 

Custom Error Bars on Lines or Bars

The above technique is great for custom error bars with points, but what about with lines and bars? For those, you need to know two more things about Graph Builder:

  1. Multiple elements can be overlaid in the same graph.
  2. You can control which elements use which variables.

With that knowledge, the idea is to make a graph with both a Line element for the middle values and a Bar element in Interval mode for the interval bars.

 

The process starts from where we left off above. Next, click on the Line element and drag it into the graph to add lines without removing the interval bars. At this point, the Line element is showing all three variables, and so is the Bar element, which is only a starting point.


eb5.png

 

Go into the Variables section of the Line Properties and uncheck the Lower 95% and Upper 95% variables. Now the line only connects the middle values.

 eb6.png

 

Go into the Variables section of the Bar Properties to uncheck the Mean variable to remove the circle.

 eb7.png

 

Click Done, and make styling changes in the legend (right-click or use the Legend Settings dialog) for color and line thickness.

 
eb0.png

 

 Use the same sequence of steps for bars, dragging in the Bar element instead of the Line element at the start.

 

eb8.png 

 So, there you have it! Now you can make your error bars look just the way you want.

Last Modified: Feb 13, 2017 2:10 PM
Comments
wskamoun
Level II

I am trying to overlay error bars that already computed and stored in one of the column. Do you know if this is possible.

Thanks

Walid

David_Burnham
Super User (Alumni)

If I create custom error bars and then introduce an additional overlay variable, the positioning of the error bars with respect to the x-axis becomes staggered - as you would expect for a barchart but not something you want for error bars.  How do you get around that?  This is particularly confusing when the centre points are connected with a line, because the line connects to where the data points ought to be and not to where they actually are.

whitelampe
Level II
There is an easier option - even without the jitter-problem when you use an additional overlay variable.

 First create a column for lower and the upper value each (as descripted above). Then stack the data (central point, upper value, lower value). Open graph-builder and add the stacked data to the y-axis. Then choose summary statistic "mean" and Error bars "range". That's it. Even without the jitter problem! Good luck :)

Nick_PV_tech
Level II

I tried this solution from whitelampe and it worked. Thanks!

gridge
Level II

Looking forward to JMP 14 with the new Interval drop zone in graph builder. There should be an option in the report window to graph your output with the upper and lower 95% derived from your model or to bring the LS means plot into graph builder.

slight
Level I

Is it possible to do this with multiple separate datasets on the same graph? I'm able to do it beautifully with my first dataset but then when I try to add a different data series, I can only get the error bars to appear for one or the other and not both. This seems to be because the interval option only allows for the first two variables to be connected and all others will be shown as markers. 

Matt21
Level I

I agree with slight. Being able to drag and drop a pre-calculated standard error from a column to each dataset in graph builder would be really valuable. 

gail_massari
Community Manager

@Matt21  Fee free to post request to JMP Wish List