<?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: JSL Bivariate analysis with &amp;quot;by&amp;quot;-argument, group-by + fit as loop (?) in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSL-Bivariate-analysis-with-quot-by-quot-argument-group-by-fit/m-p/553362#M76836</link>
    <description>&lt;P&gt;Here's a big class example that I think does what you want.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&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 &amp;lt;&amp;lt; Bivariate(
	Y( :weight ),
	X( :height ),
	GroupBy(:sex),
	By( :age ), 
	FitLine(1)
);&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Oct 2022 13:52:54 GMT</pubDate>
    <dc:creator>vince_faller</dc:creator>
    <dc:date>2022-10-06T13:52:54Z</dc:date>
    <item>
      <title>JSL Bivariate analysis with "by"-argument, group-by + fit as loop (?)</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Bivariate-analysis-with-quot-by-quot-argument-group-by-fit/m-p/553351#M76835</link>
      <description>&lt;P&gt;Dear Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently I am trying to automate several recurring JMP routines with JSL. My tables have after several hundred lines of code now the form I want to have and I fail in JSL on a supposedly simple bivariate analysis :(&lt;/img&gt;&lt;/P&gt;&lt;P&gt;As an example I have attached a simplified table. If you click through it is:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;X = :days,&amp;nbsp;Y = :Readout, By = :Classification&lt;/LI&gt;&lt;LI&gt;=&amp;gt; SHIFT Hot button =&amp;gt; Group by :Individuals =&amp;gt; SHIFT Hot button =&amp;gt; Fit each value&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The resulting code copied from the editor is:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Bivariate(
	SendToByGroup( {Is Missing( :Classification )} ),
	Y( :Readout ),
	X( :Days ),
	SendToByGroup(
		{Is Missing( :Classification )},
		Fit Where(
			:Individuals == "Ind7",
			Fit Each Value( {Line Color( {212, 73, 88} )} )
		),
		Fit Where(
			:Individuals == "Ind22",
			Fit Each Value( {Line Color( {66, 112, 221} )} )
		)
	),
	SendToByGroup(
		{:Classification == "A"},
		Fit Where(
			:Individuals == "Ind2",
			Fit Each Value( {Line Color( {212, 73, 88} )} )
		),
		Fit Where(
			:Individuals == "Ind4",
			Fit Each Value( {Line Color( {61, 174, 70} )} )
		),
		Fit Where(
			:Individuals == "Ind5",
			Fit Each Value( {Line Color( {66, 112, 221} )} )
		),
		Fit Where(
			:Individuals == "Ind6",
			Fit Each Value( {Line Color( {204, 121, 41} )} )
		),
		Fit Where(
			:Individuals == "Ind8",
			Fit Each Value( {Line Color( {40, 182, 143} )} )
		),
		Fit Where(
			:Individuals == "Ind9",
			Fit Each Value( {Line Color( {162, 43, 221} )} )
		),
		Fit Where(
			:Individuals == "Ind12",
			Fit Each Value( {Line Color( {196, 189, 43} )} )
		),
		Fit Where(
			:Individuals == "Ind14",
			Fit Each Value( {Line Color( {39, 174, 174} )} )
		),
		Fit Where(
			:Individuals == "Ind15",
			Fit Each Value( {Line Color( {197, 41, 201} )} )
		),
		Fit Where(
			:Individuals == "Ind24",
			Fit Each Value( {Line Color( {142, 176, 40} )} )
		),
		Fit Where(
			:Individuals == "Ind28",
			Fit Each Value( {Line Color( {40, 154, 190} )} )
		)
	),
	SendToByGroup(
		{:Classification == "B"},
		Fit Where(
			:Individuals == "Ind1",
			Fit Each Value( {Line Color( {212, 73, 88} )} )
		),
		Fit Where(
			:Individuals == "Ind11",
			Fit Each Value( {Line Color( {61, 174, 70} )} )
		),
		Fit Where(
			:Individuals == "Ind16",
			Fit Each Value( {Line Color( {66, 112, 221} )} )
		),
		Fit Where(
			:Individuals == "Ind17",
			Fit Each Value( {Line Color( {204, 121, 41} )} )
		),
		Fit Where(
			:Individuals == "Ind21",
			Fit Each Value( {Line Color( {40, 182, 143} )} )
		),
		Fit Where(
			:Individuals == "Ind23",
			Fit Each Value( {Line Color( {162, 43, 221} )} )
		),
		Fit Where(
			:Individuals == "Ind25",
			Fit Each Value( {Line Color( {196, 189, 43} )} )
		),
		Fit Where(
			:Individuals == "Ind26",
			Fit Each Value( {Line Color( {39, 174, 174} )} )
		),
		Fit Where(
			:Individuals == "Ind27",
			Fit Each Value( {Line Color( {197, 41, 201} )} )
		)
	),
	SendToByGroup(
		{:Classification == "C"},
		Fit Where(
			:Individuals == "Ind20",
			Fit Each Value( {Line Color( {212, 73, 88} )} )
		)
	),
	SendToByGroup(
		{:Classification == "D"},
		Fit Where(
			:Individuals == "Ind3",
			Fit Each Value( {Line Color( {212, 73, 88} )} )
		),
		Fit Where(
			:Individuals == "Ind10",
			Fit Each Value( {Line Color( {61, 174, 70} )} )
		),
		Fit Where(
			:Individuals == "Ind13",
			Fit Each Value( {Line Color( {66, 112, 221} )} )
		),
		Fit Where(
			:Individuals == "Ind18",
			Fit Each Value( {Line Color( {204, 121, 41} )} )
		),
		Fit Where(
			:Individuals == "Ind19",
			Fit Each Value( {Line Color( {40, 182, 143} )} )
		)
	),
	By( :Classification )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;My problem now is that this script if I hard code it like this will not work with new Indiviudals, which will be added to this table. And I also realize that I have to work with lists and a For()-loop in some form.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the lists, I started as follows:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//Writes only the different individual values of column :Classification into a variable
	classlist = dt:"Classification" &amp;lt;&amp;lt; Get values;
	classvalues = Associative Array(classlist) &amp;lt;&amp;lt; Get Keys;
	
//Writes only the different individual values of column :Individuals into a variable
	IDlist = dt:"Individuals" &amp;lt;&amp;lt; Get values;
	IDvalues = Associative Array(IDlist) &amp;lt;&amp;lt; Get Keys;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But how I now approach the For()-loop correctly, I unfortunately do not know...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have any ideas or can help me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 15:59:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Bivariate-analysis-with-quot-by-quot-argument-group-by-fit/m-p/553351#M76835</guid>
      <dc:creator>SteffiTryToJump</dc:creator>
      <dc:date>2023-06-09T15:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: JSL Bivariate analysis with "by"-argument, group-by + fit as loop (?)</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Bivariate-analysis-with-quot-by-quot-argument-group-by-fit/m-p/553362#M76836</link>
      <description>&lt;P&gt;Here's a big class example that I think does what you want.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&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 &amp;lt;&amp;lt; Bivariate(
	Y( :weight ),
	X( :height ),
	GroupBy(:sex),
	By( :age ), 
	FitLine(1)
);&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 13:52:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Bivariate-analysis-with-quot-by-quot-argument-group-by-fit/m-p/553362#M76836</guid>
      <dc:creator>vince_faller</dc:creator>
      <dc:date>2022-10-06T13:52:54Z</dc:date>
    </item>
    <item>
      <title>Re: JSL Bivariate analysis with "by"-argument, group-by + fit as loop (?)</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Bivariate-analysis-with-quot-by-quot-argument-group-by-fit/m-p/553376#M76838</link>
      <description>&lt;P&gt;I'm almost ashamed of my question.... I have no longer seen the forest for the trees.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 14:41:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Bivariate-analysis-with-quot-by-quot-argument-group-by-fit/m-p/553376#M76838</guid>
      <dc:creator>SteffiTryToJump</dc:creator>
      <dc:date>2022-10-06T14:41:55Z</dc:date>
    </item>
  </channel>
</rss>

