Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Re: How do I create a shaded confidence interval on a Graph Builder plot?

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Apr 18, 2019 7:53 AM
(3364 views)

I would like to compare some results to a standard depletion curves. I would like to plot the expected value curve and shade the area between the two confidence interval curves. Does anyone know how I could do this?

Many thanks,

John

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Since @markbailey said he was busy, I thought I'd add another option:

- If you have columns for the standard and Prediction of the Mean Curve or the Prediction of the Individual values you can use Graph Builder Area element to build your graphic.
- You could also use a column transform to create the temporary columns, this is a little bit messier since the prediction curves require the Std Error formula which is a bit messy in a transform formula. Note the standard formula should limit the prediction range and use the proper degrees of freedom based upon the standard.

The example and script below are provided as a simple example of GraphBuilder features using option#1

```
Names Default to Here(1);
//Note the Elements order is important, the last one will be on top, the first in the background
dt = open("c:\temp\BigClass_StandardCI.jmp");
gb = dt << Graph Builder(
Size( 534, 454 ),
Show Control Panel( 0 ),
Variables(
X( :height ),
Y( :Standard ),
Y( :Lower 95% Standard, Position( 1 ) ),
Y( :Upper 95% Standard, Position( 1 ) ),
Y( :New Curve, Position( 1 ) ),
Y( :weight, Position( 1 ) )
),
Elements(
Line( X, Y( 1 ), Legend( 1 ) ),
Area( X, Y( 2 ), Y( 3 ), Legend( 2 ), Area Style( "Range" ) ),
Points( X, Y( 5 ), Legend( 3 ) ),
Line Of Fit( X, Y( 4 ), Legend( 4 ) )
),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
1,
Level Name( 0, "Standard", Item ID( "Mean(Standard)", 1 ) ),
Properties( 0, {Line Width( 3 )}, Item ID( "Mean(Standard)", 1 ) )
), Legend Model(
2,
Properties(
0,
{Transparency( 0.4 )},
Item ID(
"Mean(Lower 95% Standard)..Mean(Upper 95% Standard)",
1
)
)
), Legend Model(
4,
Properties( 0, {Line Width( 3 )}, Item ID( "New Curve", 1 ) )
)}
),
Dispatch(
{},
"Y title",
TextEditBox,
{Set Text( "Weight Curve vs Standard" )}
),
Dispatch(
{},
"400",
LegendBox,
{Legend Position( {1, [0], 2, [-1], 3, [2], 4, [1, -3]} ),
Position( {0, -1, 2, 1, -3} )}
)
)
);
```

5 REPLIES 5

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: How do I create a shaded confidence interval on a Graph Builder plot?

There are two ways.

1) On the left, check the box for "Prediction"

2) Right click the plot --> line of fit --> click "Prediction"

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: How do I create a shaded confidence interval on a Graph Builder plot?

NG,

Thanks for your reply. The standard curves I would like to reference would be formula columns that are independent of the data I am plotting against. So in the background of the graph I would like to show the standard expected value curve as well as the upper and lower confidence limits the standard curve. In front of this I would like to plot the data so that we can see how "is" compares to what "ought to be"

John

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: How do I create a shaded confidence interval on a Graph Builder plot?

I'm too busy at the moment to work on a complete solution, but not too busy to 'get the ball rolling.'

If the formulae are independent of the data and pre-determined, then it might be possible to add one or more graphics scripts to the frame box in Graph Builder to provide the visual reference that you want. I don't know if the graphics script is run before or after Graph Builder plots its own graphical elements.

Learn it once, use it forever!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Since @markbailey said he was busy, I thought I'd add another option:

- If you have columns for the standard and Prediction of the Mean Curve or the Prediction of the Individual values you can use Graph Builder Area element to build your graphic.
- You could also use a column transform to create the temporary columns, this is a little bit messier since the prediction curves require the Std Error formula which is a bit messy in a transform formula. Note the standard formula should limit the prediction range and use the proper degrees of freedom based upon the standard.

The example and script below are provided as a simple example of GraphBuilder features using option#1

```
Names Default to Here(1);
//Note the Elements order is important, the last one will be on top, the first in the background
dt = open("c:\temp\BigClass_StandardCI.jmp");
gb = dt << Graph Builder(
Size( 534, 454 ),
Show Control Panel( 0 ),
Variables(
X( :height ),
Y( :Standard ),
Y( :Lower 95% Standard, Position( 1 ) ),
Y( :Upper 95% Standard, Position( 1 ) ),
Y( :New Curve, Position( 1 ) ),
Y( :weight, Position( 1 ) )
),
Elements(
Line( X, Y( 1 ), Legend( 1 ) ),
Area( X, Y( 2 ), Y( 3 ), Legend( 2 ), Area Style( "Range" ) ),
Points( X, Y( 5 ), Legend( 3 ) ),
Line Of Fit( X, Y( 4 ), Legend( 4 ) )
),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
1,
Level Name( 0, "Standard", Item ID( "Mean(Standard)", 1 ) ),
Properties( 0, {Line Width( 3 )}, Item ID( "Mean(Standard)", 1 ) )
), Legend Model(
2,
Properties(
0,
{Transparency( 0.4 )},
Item ID(
"Mean(Lower 95% Standard)..Mean(Upper 95% Standard)",
1
)
)
), Legend Model(
4,
Properties( 0, {Line Width( 3 )}, Item ID( "New Curve", 1 ) )
)}
),
Dispatch(
{},
"Y title",
TextEditBox,
{Set Text( "Weight Curve vs Standard" )}
),
Dispatch(
{},
"400",
LegendBox,
{Legend Position( {1, [0], 2, [-1], 3, [2], 4, [1, -3]} ),
Position( {0, -1, 2, 1, -3} )}
)
)
);
```

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: How do I create a shaded confidence interval on a Graph Builder plot?

Georgia,

Thanks so much! That was exactly what I needed.

John