I am trying to add different reference lines based on groups in a variability chart, but there seem to be no straight forward way to do it.
I have different targets based on the groups and a column has the target data already in there.
How to make use of the available target column data and draw reference lines based on the different groups?
Is this the kind of plot you are after?

If so, for the Variability Chart you will need to use a graphics script. You can make the plot above by running this script:
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << Variability Chart(
Y( :height ),
X( :sex ),
Std Dev Chart( 0 ),
SendToReport(
Dispatch(
{"Variability Chart for height"},
"Variability Chart",
FrameBox,
{Add Graphics Script(
2,
Description( "" ),
Pen Color( "Red" );
// Females
H Line( 0, 1, 55 );
H Line( 0, 1, 65 );
// Males
H Line( 1, 2, 52 );
H Line( 1, 2, 67 );
), Grid Line Order( 1 ), Reference Line Order( 3 ),
DispatchSeg(
TopSeg( 1 ),
{Set Script(
Pen Color( "Red" );
// Females
H Line( 0, 1, 55 );
H Line( 0, 1, 65 );
// Males
H Line( 1, 2, 52 );
H Line( 1, 2, 67 );
)}
)}
)
)
);
Do a right click on the white area of the graph and select 'Customize...' to define the lines using 'HLine()' with the values you need.
You can add these lines as part of a bigger JSL script, and if you need to do this often you may want to look into this.
Thanks! That's indeed what I am looking for.
I have another question though. Can I use another table as a reference for the group names instead of drawing the lines based on x-axis points?
For example, another table will contain
Sex | Upper Limits | Lower Limits
M | 2 | 1 |
F | 4 | 5 |
and a script to use that table to create the reference lines. Is that possible?