<?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: How to remove summary statistics using JSL Part 3 in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-remove-summary-statistics-using-JSL-Part-3/m-p/281675#M54521</link>
    <description>&lt;P&gt;It did not do that in my testing of the code I submitted.&amp;nbsp; Can you post your data table.&amp;nbsp; I assume that the issue is a data issue, and if I had a copy of your data table I could look further.&lt;/P&gt;</description>
    <pubDate>Fri, 24 Jul 2020 02:52:40 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2020-07-24T02:52:40Z</dc:date>
    <item>
      <title>How to remove summary statistics using JSL Part 3</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-remove-summary-statistics-using-JSL-Part-3/m-p/281645#M54516</link>
      <description>&lt;P&gt;Hello Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had asked a related question to this yesterday and got great answers. However, I ran into problems when trying to implement the solution. After spending countless hours, I am asking for more help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the scenario.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data table (attached) with the following columns and rows:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="simon_2_0-1595548212819.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/25691i53935A1C16B2DE74/image-size/medium?v=v2&amp;amp;px=400" role="button" title="simon_2_0-1595548212819.png" alt="simon_2_0-1595548212819.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. I would like to loop through each column at a time starting from column "fruit" and plot a Logistic plot by "location" and send the output to a journal.&lt;/P&gt;&lt;P&gt;2. I would like to completely remove the summary statistics which come with the plots using JSL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can do step 1 with no issues. Below is my code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt=open("$\fruit_drink.jmp");

colList = dt &amp;lt;&amp;lt; Get Column Names();

For( i = 3, i &amp;lt;= Nitems( colList ), i++,
    obj = Logistic(
	Y( colList[i] ),
	X( :Day ),
	By( :location),
	SendToReport(
		Dispatch( {}, "1", ScaleBox, {Min( 35.2151394422311 )} ),
		Dispatch(
			{},
			"FitNom Plot",
			FrameBox,
			{Marker Size( 4 ), Row Legend(
				colList[i],
				Color( 1 ),
				Color Theme( "JMP Default" ),
				Marker( 1 ),
				Marker Theme( "Standard" ),
				Continuous Scale( 0 ),
				Reverse Scale( 0 ),
				Excluded Rows( 0 )
			)}
		)
	)
);
obj &amp;lt;&amp;lt; journal;
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I get this output (there are more graphs with summary statistics, I just can't fit all of them here):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="simon_2_1-1595548544302.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/25692iA42966DF505F4DD4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="simon_2_1-1595548544302.png" alt="simon_2_1-1595548544302.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to implement the following solution to remove the statistics (based on previous help I received from the JMP community).&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt=open("$\fruit_drink.jmp");

colList = dt &amp;lt;&amp;lt; Get Column Names();

For( i = 3, i &amp;lt;= Nitems( colList ), i++,
    obj = Logistic(
	Y( colList[i] ),
	X( :Day ),
	By( :location),
	SendToReport(
		Dispatch( {}, "1", ScaleBox, {Min( 35.2151394422311 )} ),
		Dispatch(
			{},
			"FitNom Plot",
			FrameBox,
			{Marker Size( 4 ), Row Legend(
				colList[i],
				Color( 1 ),
				Color Theme( "JMP Default" ),
				Marker( 1 ),
				Marker Theme( "Standard" ),
				Continuous Scale( 0 ),
				Reverse Scale( 0 ),
				Excluded Rows( 0 )
			)}
		)
	)
);
obj &amp;lt;&amp;lt; journal;
jrn = New Window( "The Journal", &amp;lt;&amp;lt;journal );
For( i = 1, i &amp;lt;= N Items( obj ), i++,
             obj[i] &amp;lt;&amp;lt; journal;);
obj &amp;lt;&amp;lt; close window;
For( i = 1, i &amp;lt;= N Items( obj ), i++,
	jrn["Iterations"] &amp;lt;&amp;lt; delete;
	jrn["Whole Model Test"] &amp;lt;&amp;lt; delete;
	jrn["Parameter Estimates"] &amp;lt;&amp;lt; delete;);

);

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;When I run this script, I get an infinite loop and had to terminate JMP. When I put the inner for loops on the outside, nothing happens, the summary statistics do not get removed.&lt;/P&gt;&lt;P&gt;Can someone help me?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:33:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-remove-summary-statistics-using-JSL-Part-3/m-p/281645#M54516</guid>
      <dc:creator>simon_2</dc:creator>
      <dc:date>2023-06-09T23:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove summary statistics using JSL Part 3</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-remove-summary-statistics-using-JSL-Part-3/m-p/281662#M54518</link>
      <description>&lt;P&gt;There are a few issues with your code&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;You should really be adding as the first line in your code&amp;nbsp;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );&lt;/CODE&gt;&lt;/PRE&gt;
it keeps your variables in this script from interfering with same named variables in other script&lt;/LI&gt;
&lt;LI&gt;You are attempting to use objects and variables before they are created or after they have been deleted
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;obj &amp;lt;&amp;lt; journal;
jrn = New Window( "The Journal", &amp;lt;&amp;lt;journal );&lt;/CODE&gt;&lt;/PRE&gt;
The above case is an illustration of attempting to send something to a journal, before you create the journal
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;obj &amp;lt;&amp;lt; close window;
For( i = 1, i &amp;lt;= N Items( obj ), i++,
	jrn["Iterations"] &amp;lt;&amp;lt; delete;
	jrn["Whole Model Test"] &amp;lt;&amp;lt; delete;
	jrn["Parameter Estimates"] &amp;lt;&amp;lt; delete;);

);&lt;/CODE&gt;&lt;/PRE&gt;
And in this case, you are referencing an object that you have just deleted&lt;/LI&gt;
&lt;LI&gt;I discovered that in some cases, there isn't an Iterations table, and the code would error out, so I have added a Try() function around some of the statements.
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For( i = 1, i &amp;lt;= N Items( obj ), i++,
		Try( jrn["Iterations"] &amp;lt;&amp;lt; delete );
		Try( jrn["Whole Model Test"] &amp;lt;&amp;lt; delete );
		Try( jrn["Parameter Estimates"] &amp;lt;&amp;lt; delete );
	);

	Try( obj &amp;lt;&amp;lt; close window );&lt;/CODE&gt;&lt;/PRE&gt;
&amp;nbsp; The Try() function does what it says, it just "Tries" to do the statement, but if it can't do it, it just keeps going.&lt;/LI&gt;
&lt;LI&gt;You also seemed to attempt a second way of adding your code to the journal.&amp;nbsp;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;obj &amp;lt;&amp;lt; journal;
jrn = New Window( "The Journal", &amp;lt;&amp;lt;journal );
For( i = 1, i &amp;lt;= N Items( obj ), i++,
             obj[i] &amp;lt;&amp;lt; journal;);&lt;/CODE&gt;&lt;/PRE&gt;
I assume it is not required, and is only there because of the issue of attempting to upload to the journal before it was created.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;So here is a rework of your code.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$\fruit_drink.jmp" );

colList = dt &amp;lt;&amp;lt; Get Column Names();

jrn = New Window( "The Journal", &amp;lt;&amp;lt;journal );

For( i = 3, i &amp;lt;= N Items( colList ), i++,
	obj = Logistic(
		Y( colList[i] ),
		X( :Day ),
		By( :location ),
		SendToReport(
			Dispatch( {}, "1", ScaleBox, {Min( 35.2151394422311 )} ),
			Dispatch(
				{},
				"FitNom Plot",
				FrameBox,
				{Marker Size( 4 ), Row Legend(
					colList[i],
					Color( 1 ),
					Color Theme( "JMP Default" ),
					Marker( 1 ),
					Marker Theme( "Standard" ),
					Continuous Scale( 0 ),
					Reverse Scale( 0 ),
					Excluded Rows( 0 )
				)}
			)
		)
	);
	obj &amp;lt;&amp;lt; journal;

	For( i = 1, i &amp;lt;= N Items( obj ), i++,
		Try( jrn["Iterations"] &amp;lt;&amp;lt; delete );
		Try( jrn["Whole Model Test"] &amp;lt;&amp;lt; delete );
		Try( jrn["Parameter Estimates"] &amp;lt;&amp;lt; delete );
	);

	Try( obj &amp;lt;&amp;lt; close window );
	
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Fri, 24 Jul 2020 01:14:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-remove-summary-statistics-using-JSL-Part-3/m-p/281662#M54518</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-07-24T01:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove summary statistics using JSL Part 3</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-remove-summary-statistics-using-JSL-Part-3/m-p/281674#M54520</link>
      <description>&lt;P&gt;Hi txnelson,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for taking your time to help me out. It looks like your solution is close to what I want. The only issue is that when running the script, JMP goes in an infinite loop. It keeps appending charts to the journal without stopping forcing me to kill the session.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 02:43:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-remove-summary-statistics-using-JSL-Part-3/m-p/281674#M54520</guid>
      <dc:creator>simon_2</dc:creator>
      <dc:date>2020-07-24T02:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove summary statistics using JSL Part 3</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-remove-summary-statistics-using-JSL-Part-3/m-p/281675#M54521</link>
      <description>&lt;P&gt;It did not do that in my testing of the code I submitted.&amp;nbsp; Can you post your data table.&amp;nbsp; I assume that the issue is a data issue, and if I had a copy of your data table I could look further.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 02:52:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-remove-summary-statistics-using-JSL-Part-3/m-p/281675#M54521</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-07-24T02:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove summary statistics using JSL Part 3</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-remove-summary-statistics-using-JSL-Part-3/m-p/281676#M54522</link>
      <description>&lt;P&gt;Hi txnelson,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached is my data table. That is strange that it runs fine for you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 03:00:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-remove-summary-statistics-using-JSL-Part-3/m-p/281676#M54522</guid>
      <dc:creator>simon_2</dc:creator>
      <dc:date>2020-07-24T03:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove summary statistics using JSL Part 3</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-remove-summary-statistics-using-JSL-Part-3/m-p/281677#M54523</link>
      <description>&lt;P&gt;simple solution.&amp;nbsp; The second For() loop in the script is located within the 1st For() loop, and they were both using "i" as the index variable.&amp;nbsp; So the second loop was continually setting the value of i back to a value less than the stopping value in the outside(first) loop.&lt;/P&gt;
&lt;P&gt;Here is the simple fix&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = data table( "fruit_drink" );

colList = dt &amp;lt;&amp;lt; Get Column Names();

jrn = New Window( "The Journal", &amp;lt;&amp;lt;journal );

For( i = 3, i &amp;lt;= N Items( colList ), i++,
	obj = Logistic(
		Y( colList[i] ),
		X( :Day ),
		By( :location ),
		SendToReport(
			Dispatch( {}, "1", ScaleBox, {Min( 35.2151394422311 )} ),
			Dispatch(
				{},
				"FitNom Plot",
				FrameBox,
				{Marker Size( 4 ), Row Legend(
					colList[i],
					Color( 1 ),
					Color Theme( "JMP Default" ),
					Marker( 1 ),
					Marker Theme( "Standard" ),
					Continuous Scale( 0 ),
					Reverse Scale( 0 ),
					Excluded Rows( 0 )
				)}
			)
		)
	);
	obj &amp;lt;&amp;lt; journal;
 
	For( k = 1,k &amp;lt;= N Items( obj ), k++,
		Try( jrn["Iterations"] &amp;lt;&amp;lt; delete );
		Try( jrn["Whole Model Test"] &amp;lt;&amp;lt; delete );
		Try( jrn["Parameter Estimates"] &amp;lt;&amp;lt; delete );
	);

	Try( obj &amp;lt;&amp;lt; close window );
	
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Jul 2020 03:18:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-remove-summary-statistics-using-JSL-Part-3/m-p/281677#M54523</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-07-24T03:18:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove summary statistics using JSL Part 3</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-remove-summary-statistics-using-JSL-Part-3/m-p/281678#M54524</link>
      <description>Beautiful solution. That is what I needed. Thanks txnelson for your quick response. Much appreciated!</description>
      <pubDate>Fri, 24 Jul 2020 03:42:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-remove-summary-statistics-using-JSL-Part-3/m-p/281678#M54524</guid>
      <dc:creator>simon_2</dc:creator>
      <dc:date>2020-07-24T03:42:10Z</dc:date>
    </item>
  </channel>
</rss>

