Graph Builder interval plotsHi,
When using Graph Builder in Bar graph mode, bar type set to Interval, we can show some good 2-sided confidence intervals and compare/contrast across various properties. In some cases, I would prefer to do the same but with 1-sided confidence. Setting the "other side" to a very large value, however, is undesirable as it messes up the Graph Builder's scale for the Y variable. We've currently converged on setting the "other side" of the 1-sided interval equal to the mean, but would prefer to not have the 'cross bar' show up in this case. So the following picture shows a 1-sided upper interval, but Graph Builder still shows the "lower interval cross bar" as both cross bars are required in the current implementation of the interval type.

Is there a better way to show a set of one-sided intervals in Graph Builder? Could be an option to set the color for the lower half of the interval to be different than the upper half of the interval - with one half as black and the other half as white (or graph background color if there's an easy way to do that)... Could be an option to control whether the cross bars are allowed to show... Don't know!
In short, we're looking for ideas but the wish is for some flexibility to show one-sided intervals!
Thanks,
Michael
GraphicsUser InterfaceRe: Graph Builder interval plots - Status changed to: In DevelopmentWe will add an option in JMP 17 to support one-sided intervals.
Re: Graph Builder interval plotsI can confirm we solved this in this particular use-case using @XanGregg 's script. I could see non-scripting experts benefiting from one-sided intervals in other scenarios and so it might still be good to look at options with the Interval property that would enable options one-sided upper and one-sided lower in addition to the manual-specified and the automatic two-sided calculations.
Re: Graph Builder interval plotsThis is very cool. Let me pass it along but I think it will work nicely in the project we want to use it with.
Re: Graph Builder interval plotsIf you have JMP 16 and are adventurous, you can try the new Shape Expression feature in the Points element, where you can replace the entire marker drawing with JSL commands. Here's an example that draws a T shape.
Graph Builder(
Size( 579, 502 ),
Variables( Y( :Column 1 ) ),
Elements(
Points(
Y,
Legend( 2 ),
Summary Statistic( "Mean" ),
Set Shape Expression(
Expr(
Function( {this seg, this row, x, y, size, row state},
Local( {se},
se = Col Std Dev( :column 1 ) /
Sqrt( Col Number( :column 1 ) );
Line(
Eval List( {x, y} ),
Eval List( {x, y + 2.576 * se} )
);
Line(
Eval List( {x - 0.2, y + 2.576 * se} ),
Eval List( {x + 0.2, y + 2.576 * se} )
);
)
)
)
)
),
Points( Y, Legend( 3 ) )
)
);
Re: Graph Builder interval plotsThanks for the detailed example, Michael. I don't have good answer, and I hope we can offer something better in the future.
For now, one idea is to overlay two intervals, one without endcaps and one with zero height (min==max). You can turn off the endcaps in the Customize settings for the error bar. To make a zero-height interval, you can make another synthetic column with a single value in it and set the marker size to dot.
For the graph below, I did that after calling the new column "One Sided Interval 2".
Another idea is to overlay two bar elements, one using the float style and one using the range style, with customizes widths.

Graph Builder(
Set α Level( 0.01 ),
Variables(
Y( :One Sided Interval ),
Y( :Column 1, Position( 1 ) ),
Y( :One Sided Interval 2, Position( 1 ) )
),
Elements(
Points(
Y( 1 ),
Legend( 2 ),
Summary Statistic( "Median" ),
Error Interval( "Range" )
),
Points( Y( 2 ), Legend( 3 ) ),
Points(
Y( 3 ),
Legend( 4 ),
Summary Statistic( "Mean" ),
Error Interval( "Range" )
)
),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
2,
Properties(
0,
{Line Color( 5 )},
Item ID( "Median(One Sided Interval)", 1 )
)
), Legend Model(
3,
Properties( 0, {Line Color( 0 )}, Item ID( "Column 1", 1 ) )
), Legend Model(
4,
Properties(
0,
{Line Color( 5 ), Marker Size( 0 )},
Item ID( "Mean(One Sided Interval 2)", 1 )
)
)}
),
Dispatch(
{},
"Graph Builder",
FrameBox,
{Reference Line Order( 3 ), DispatchSeg(
BarSeg( 1 ),
{Error Bar Cap( "None" )}
)}
)
)
)
Re: Graph Builder interval plotsHere is a sample data file that shows why this would be useful.
New Table( "one sided intervals are hard to make",
Add Rows( 13 ),
New Script(
"Two Sided Interval - easy!",
Graph Builder(
Set α Level( 0.01 ),
Variables( Y( :Column 1 ) ),
Elements(
Points(
Y,
Legend( 2 ),
Summary Statistic( "Mean" ),
Error Interval( "Confidence Interval" )
),
Points( Y, Legend( 3 ) )
),
SendToReport(
Dispatch(
{},
"Column 1",
ScaleBox,
{Add Ref Line( 0, "Solid", "Black", "", 1 )}
),
Dispatch(
{},
"Graph Builder",
FrameBox,
{Reference Line Order( 3 )}
)
)
)
),
New Script(
"Attempt at One Sided Interval",
Graph Builder(
Set α Level( 0.01 ),
Variables( Y( :One Sided Interval ), Y( :Column 1, Position( 1 ) ) ),
Elements(
Points(
Y( 1 ),
Legend( 2 ),
Summary Statistic( "Median" ),
Error Interval( "Range" )
),
Points( Y( 2 ), Legend( 3 ) )
),
SendToReport(
Dispatch(
{},
"Graph Builder",
FrameBox,
{Reference Line Order( 4 )}
)
)
)
),
New Script(
"Second Attempt at One-Sided Interval - Manually drawing white lines over the lower bound",
Graph Builder(
Set α Level( 0.01 ),
Variables( Y( :One Sided Interval ), Y( :Column 1, Position( 1 ) ) ),
Elements(
Points(
Y( 1 ),
Legend( 2 ),
Summary Statistic( "Median" ),
Error Interval( "Range" )
),
Points( Y( 2 ), Legend( 3 ) )
),
SendToReport(
Dispatch(
{},
"Graph Builder",
FrameBox,
{Reference Line Order( 4 ),
{Add Line Annotation(
Line( {237, 300}, {183, 300} ),
Color( "White" ),
Thick( 1 )
), Add Line Annotation(
Line( {244, 299}, {299, 299} ),
Color( "White" ),
Thick( 1 )
)}}
)
)
)
),
New Column( "Column 1",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[0.01, 0.02, 0.04, 0.07, 0.1, 0.13, 0.18, 0.25, 0.4, 0.67, 0.93, 1.25, 2
]
),
Set Display Width( 75 )
),
New Column( "One Sided Interval",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[0.4653846, 0.4653846, 0.913051508927084, ., ., ., ., ., ., ., ., ., .]
),
Set Display Width( 137 )
),
New Column( "Comment",
Character,
"Nominal",
Set Values(
{"Mean", "Mean",
"manually calculated upper bound: .4653846 + t Quantile(0.99,12) * 0.6020467/sqrt(13)",
"", "", "", "", "", "", "", "", "", ""}
),
Set Display Width( 430 )
)
)Re: Graph Builder interval plots - Status changed to: Delivered