<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Help to put specs on a bivariate plot with grouping variables in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Help-to-put-specs-on-a-bivariate-plot-with-grouping-variables/m-p/876268#M103951</link>
    <description>&lt;P&gt;I find it more convenient to use this method to modify the output display&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1748173406967.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/76210i4D74B4F4E9169C30/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1748173406967.png" alt="txnelson_0-1748173406967.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Data Table( "Big Class_withSpecs" );
rep = dt &amp;lt;&amp;lt; Bivariate(
	SendToByGroup( Bygroup Default ),
	Y( :weight ),
	X( :height ),
	Fit Line( {Confid Curves Fit( 1 ), Confid Shaded Fit( 1 ), Line Color( {212, 73, 88} )} ),
	By( :age, :sex ),

);

summary = dt &amp;lt;&amp;lt; Summary(
	Group( :age, :sex, :LSL_Height,:USL_Height,:LSL_Weight,:USL_Weight ),
	Freq( "None" ),
	Weight( "None" ),
	output table name( "Summary of Big Class grouped by age, sex" )
);

For( i = 1, i &amp;lt;= N Rows( summary ), i++,
	// There is a separate output display for each by group
	// Set the report to modify 
	reprpt = report(rep[i]);
	// For each report AxisBox(1) is the Y axis and AxisBox(2) is the X axis
	reprpt[AxisBox(1)] &amp;lt;&amp;lt; add Ref Line(summary:LSL_Weight[i], "Solid","Red", "", 1  );
	reprpt[AxisBox(1)] &amp;lt;&amp;lt; add Ref Line(summary:USL_Weight[i], "Solid","Red", "", 1  );
	reprpt[AxisBox(2)] &amp;lt;&amp;lt; add Ref Line(summary:LSL_Height[i], "Solid","Red", "", 1  );
	reprpt[AxisBox(2)] &amp;lt;&amp;lt; add Ref Line(summary:USL_Height[i], "Solid","Red", "", 1  );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 25 May 2025 11:43:59 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2025-05-25T11:43:59Z</dc:date>
    <item>
      <title>Help to put specs on a bivariate plot with grouping variables</title>
      <link>https://community.jmp.com/t5/Discussions/Help-to-put-specs-on-a-bivariate-plot-with-grouping-variables/m-p/876244#M103947</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I’ll use Big Class as an example of what Im trying to do. Let’s say I want to plot weight (Y) vs height (X) , using age and sex as BY variables. But in my case, I cannot predict how many levels the BY variables will have.&amp;nbsp; For each bivariate plot, I fit a line. I want to add vertical reference lines at the lower and upper spec limits of “height”, and horizontal reference lines at the lower and upper spec limits of “weight”.&amp;nbsp; I have these spec limit values in columns of my table. Within each combination of age and sex the spec limits are constant (not varying row to row), but the spec limits vary between these combinations. How can I do this in JMP 18? &amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I thought to make a summary table with all of the values I need.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Data Table( "Big Class" );
rep=Bivariate(
	SendToByGroup( Bygroup Default ),
	Y( :weight ),
	X( :height ),
	Fit Line(
		{Confid Curves Fit( 1 ), Confid Shaded Fit( 1 ), Line Color( {212, 73, 88} )
		}
	),
	By( :age, :sex ),
);

summary = dt &amp;lt;&amp;lt; Summary(
	Group( :age, :sex, :LSL_Height,:USL_Height,:LSL_Weight,:USL_Weight ),
	Freq( "None" ),
	Weight( "None" ),
	output table name( "Summary of Big Class grouped by age, sex" )
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately this doesn't work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;
for (i=1,i&amp;lt;= n rows(summary), i++,
rep &amp;lt;&amp;lt;	EVAL(SendToByGroup(
		{:age == eval(age[i]), :sex == eval(sex[i])},
		SendToReport(
			Dispatch( {}, "height", ScaleBox,
				{Add Ref Line( eval(LSL_Height[i]), "Solid", "Red", "", 1 ),
				Add Ref Line( eval(uSL_Height[i]), "Solid", "Red", "", 1 )
				}
			)
		),
		SendToReport(
			Dispatch( {}, "Weight", ScaleBox,
				{Add Ref Line( eval(LSL_Weight[i]), "Solid", "Black", "", 1 ),
				Add Ref Line( eval(uSL_Weight[i]), "Solid", "Black", "", 1 )
				}
			)
		),
	);

)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thank you&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 25 May 2025 08:50:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-to-put-specs-on-a-bivariate-plot-with-grouping-variables/m-p/876244#M103947</guid>
      <dc:creator>Karen1</dc:creator>
      <dc:date>2025-05-25T08:50:02Z</dc:date>
    </item>
    <item>
      <title>Re: Help to put specs on a bivariate plot with grouping variables</title>
      <link>https://community.jmp.com/t5/Discussions/Help-to-put-specs-on-a-bivariate-plot-with-grouping-variables/m-p/876266#M103950</link>
      <description>&lt;P&gt;Do note that the axis do not auto-scale based on reference lines&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1); 

dt = open("$SAMPLE_DATA/Big Class.jmp");

dt_specs = dt &amp;lt;&amp;lt; Summary(
	Group(:sex),
	Quantiles(25, :height),
	Quantiles(25, :weight),
	Quantiles(75, :height),
	Quantiles(75, :weight),
	Freq("None"),
	Weight("None"),
	Link to original data table(0),
	output table name("spec limits by sex")
);
Column(dt_specs, "Quantiles25(height)") &amp;lt;&amp;lt; Set Name("LSL_Height");
Column(dt_specs, "Quantiles25(weight)") &amp;lt;&amp;lt; Set Name("LSL_Weight");
Column(dt_specs, "Quantiles75(height)") &amp;lt;&amp;lt; Set Name("USL_Height");
Column(dt_specs, "Quantiles75(weight)") &amp;lt;&amp;lt; Set Name("USL_Weight");


bivs = dt &amp;lt;&amp;lt; Bivariate(
	SendToByGroup(Bygroup Default),
	Y(:weight),
	X(:height),
	Fit Line({Confid Curves Fit(1), Confid Shaded Fit(1), Line Color({212, 73, 88})}),
	By(:age, :sex),
	Group Options(Return Group(0)) // makes this easier but can slighlty complicate other things
);

For Each({biv}, bivs,
	rep = Report(biv);
	biv_title = rep &amp;lt;&amp;lt; get title;
	cur_age = Word(-1, biv_title, "=");
	spec_row = dt_specs &amp;lt;&amp;lt; Get Rows Where(:sex == cur_age);
	
	// X-Axis
	rep[AxisBox(2)] &amp;lt;&amp;lt; Add Ref Line(dt_specs[spec_row, "LSL_Height"][1], "Dashed", blue, "LSL", 2);
	rep[AxisBox(2)] &amp;lt;&amp;lt; Add Ref Line(dt_specs[spec_row, "USL_Height"][1], "Dashed", blue, "USL", 2);
	
	// Y-Axis
	rep[AxisBox(1)] &amp;lt;&amp;lt; Add Ref Line(dt_specs[spec_row, "LSL_Weight"][1], "Dashed", blue, "LSL", 2);
	rep[AxisBox(1)] &amp;lt;&amp;lt; Add Ref Line(dt_specs[spec_row, "USL_Weight"][1], "Dashed", blue, "USL", 2);
);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 25 May 2025 11:10:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-to-put-specs-on-a-bivariate-plot-with-grouping-variables/m-p/876266#M103950</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-05-25T11:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: Help to put specs on a bivariate plot with grouping variables</title>
      <link>https://community.jmp.com/t5/Discussions/Help-to-put-specs-on-a-bivariate-plot-with-grouping-variables/m-p/876268#M103951</link>
      <description>&lt;P&gt;I find it more convenient to use this method to modify the output display&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1748173406967.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/76210i4D74B4F4E9169C30/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1748173406967.png" alt="txnelson_0-1748173406967.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Data Table( "Big Class_withSpecs" );
rep = dt &amp;lt;&amp;lt; Bivariate(
	SendToByGroup( Bygroup Default ),
	Y( :weight ),
	X( :height ),
	Fit Line( {Confid Curves Fit( 1 ), Confid Shaded Fit( 1 ), Line Color( {212, 73, 88} )} ),
	By( :age, :sex ),

);

summary = dt &amp;lt;&amp;lt; Summary(
	Group( :age, :sex, :LSL_Height,:USL_Height,:LSL_Weight,:USL_Weight ),
	Freq( "None" ),
	Weight( "None" ),
	output table name( "Summary of Big Class grouped by age, sex" )
);

For( i = 1, i &amp;lt;= N Rows( summary ), i++,
	// There is a separate output display for each by group
	// Set the report to modify 
	reprpt = report(rep[i]);
	// For each report AxisBox(1) is the Y axis and AxisBox(2) is the X axis
	reprpt[AxisBox(1)] &amp;lt;&amp;lt; add Ref Line(summary:LSL_Weight[i], "Solid","Red", "", 1  );
	reprpt[AxisBox(1)] &amp;lt;&amp;lt; add Ref Line(summary:USL_Weight[i], "Solid","Red", "", 1  );
	reprpt[AxisBox(2)] &amp;lt;&amp;lt; add Ref Line(summary:LSL_Height[i], "Solid","Red", "", 1  );
	reprpt[AxisBox(2)] &amp;lt;&amp;lt; add Ref Line(summary:USL_Height[i], "Solid","Red", "", 1  );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 25 May 2025 11:43:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-to-put-specs-on-a-bivariate-plot-with-grouping-variables/m-p/876268#M103951</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2025-05-25T11:43:59Z</dc:date>
    </item>
  </channel>
</rss>

