cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • See how to interactively organize and restructure data for analysis. Register for May 29 webinar, 2pm US ET.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
alvin
Level I

How to have different reference line by groups in variability charts?

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?

1 ACCEPTED SOLUTION

Accepted Solutions
ian_jmp
Level X

Re: How to have different reference line by groups in variability charts?

Is this the kind of plot you are after?

Screenshot 2020-12-11 at 10.04.56.png

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 );
					)}
					)
				)
			);

To add horizontal lines by hand, do a right click on the white area of the graph and select 'Customize...'. Then hit the '+' sign to add them using 'HLine()' with the values you need:

Screenshot 2020-12-11 at 10.40.51.png

You can add such lines as part of a bigger JSL script, and if you need to do this often you may want to look into this.

View solution in original post

2 REPLIES 2
ian_jmp
Level X

Re: How to have different reference line by groups in variability charts?

Is this the kind of plot you are after?

Screenshot 2020-12-11 at 10.04.56.png

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 );
					)}
					)
				)
			);

To add horizontal lines by hand, do a right click on the white area of the graph and select 'Customize...'. Then hit the '+' sign to add them using 'HLine()' with the values you need:

Screenshot 2020-12-11 at 10.40.51.png

You can add such lines as part of a bigger JSL script, and if you need to do this often you may want to look into this.

alvin
Level I

Re: How to have different reference line by groups in variability charts?

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?

Recommended Articles