<?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: Creating a flexible Bivariate script with n Conditions (example given) in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Creating-a-flexible-Bivariate-script-with-n-Conditions-example/m-p/567311#M77833</link>
    <description>&lt;P&gt;You need to use the &amp;lt;&amp;lt; Group By( column ) message with the Bivariate object before fitting the chosen model:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;platform = Data Table (dt3) &amp;lt;&amp;lt;
Bivariate(
	Y( :OD ),
	X( :"Assigned Cal"n ),
	By( :Lot )
);


platform &amp;lt;&amp;lt; Group By( :Condition );

platform &amp;lt;&amp;lt; Fit Special(
	Degree( 2 ),
	Centered Polynomial( 0 )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 09 Nov 2022 15:23:40 GMT</pubDate>
    <dc:creator>Mark_Bailey</dc:creator>
    <dc:date>2022-11-09T15:23:40Z</dc:date>
    <item>
      <title>Creating a flexible Bivariate script with n Conditions (example given)</title>
      <link>https://community.jmp.com/t5/Discussions/Creating-a-flexible-Bivariate-script-with-n-Conditions-example/m-p/567285#M77830</link>
      <description>&lt;P&gt;I am trying to write a script to automate the creation of a Bivariate graph. Below is an example of my data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jmp script 1.jpg" style="width: 527px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/47197i8375B10ECF55FD5E/image-size/large?v=v2&amp;amp;px=999" role="button" title="jmp script 1.jpg" alt="jmp script 1.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created the Bivariate output I wanted using the point-and-click method:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;assigning column OD to the Y response, column Assigned Cal for the X response, and column Lot for the By role&lt;/LI&gt;&lt;LI&gt;right-click on the red triangle, click Group By, selecting column Condition&lt;/LI&gt;&lt;LI&gt;right-click on the red triangle, click Fit Special, selecting 2 Quadratic from the dropdown and unchecking Centered Polynomial&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;and the resulting graph is what I want:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JMP script 3.jpg" style="width: 572px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/47201i2C3DE4D2A8A5C932/image-size/large?v=v2&amp;amp;px=999" role="button" title="JMP script 3.jpg" alt="JMP script 3.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The resulting script from making this via the point-and-click method is as follows:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;platform = Data Table (dt3) &amp;lt;&amp;lt;
Bivariate(
	Y( :OD ),
	X( :"Assigned Cal"n ),
	Fit Where(
		:Condition == "Vendor 4",
		Fit Special(
			Degree( 2 ),
			Centered Polynomial( 0 ),
			{Line Color( {212, 73, 88} )}
		)
	),
	Fit Where(
		:Condition == "Vendor 1",
		Fit Special(
			Degree( 2 ),
			Centered Polynomial( 0 ),
			{Line Color( {61, 174, 70} )}
		)
	),
	Fit Where(
		:Condition == "Vendor 2",
		Fit Special(
			Degree( 2 ),
			Centered Polynomial( 0 ),
			{Line Color( {66, 112, 221} )}
		)
	),
	Fit Where(
		:Condition == "Vendor 3",
		Fit Special(
			Degree( 2 ),
			Centered Polynomial( 0 ),
			{Line Color( {204, 121, 41} )}
		)
	),
	By( :Lot )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is well and good, but in my example I had 4 unique Condition values (Vendor 1, Vendor 2, Vendor 3, Vendor 4). When my coworkers use this script, their data may have a different number of conditions (2 or more) and their condition names may be different. In the script above, the 4 unique Condition values are referred to specifically, colors are assigned specifically, etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So my question is: how can I write a general script for this process that will do the same actions for &lt;STRONG&gt;n&lt;/STRONG&gt; unique Condition values with various names?&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:56:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Creating-a-flexible-Bivariate-script-with-n-Conditions-example/m-p/567285#M77830</guid>
      <dc:creator>jbolinger</dc:creator>
      <dc:date>2023-06-10T23:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a flexible Bivariate script with n Conditions (example given)</title>
      <link>https://community.jmp.com/t5/Discussions/Creating-a-flexible-Bivariate-script-with-n-Conditions-example/m-p/567311#M77833</link>
      <description>&lt;P&gt;You need to use the &amp;lt;&amp;lt; Group By( column ) message with the Bivariate object before fitting the chosen model:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;platform = Data Table (dt3) &amp;lt;&amp;lt;
Bivariate(
	Y( :OD ),
	X( :"Assigned Cal"n ),
	By( :Lot )
);


platform &amp;lt;&amp;lt; Group By( :Condition );

platform &amp;lt;&amp;lt; Fit Special(
	Degree( 2 ),
	Centered Polynomial( 0 )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 15:23:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Creating-a-flexible-Bivariate-script-with-n-Conditions-example/m-p/567311#M77833</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2022-11-09T15:23:40Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a flexible Bivariate script with n Conditions (example given)</title>
      <link>https://community.jmp.com/t5/Discussions/Creating-a-flexible-Bivariate-script-with-n-Conditions-example/m-p/567431#M77838</link>
      <description>&lt;P&gt;I figured the solution might be as simple as this, but I just lacked experience with how things like Group By() and Fit Special() work as direct messages. This solved my problem, thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 18:18:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Creating-a-flexible-Bivariate-script-with-n-Conditions-example/m-p/567431#M77838</guid>
      <dc:creator>jbolinger</dc:creator>
      <dc:date>2022-11-09T18:18:47Z</dc:date>
    </item>
  </channel>
</rss>

