<?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: Saving R-Square values from smoothing spline fit in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Saving-R-Square-values-from-smoothing-spline-fit/m-p/61945#M33375</link>
    <description>&lt;P&gt;All display data in an output table from a JMP platform is available to JSL.&amp;nbsp; Here is a simple example that retrieves the Smoother RSquare value&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );

biv = Bivariate(
	Y( :NPN1 ),
	X( :PNP1 ),
	Kernel Smoother( 1, 1, 0.343642611683849, 0 )
);

// Offset into the report object and get the RSquare value
RSquare = Num(Report(biv)["Local Smoother"][numberbox(1)]&amp;lt;&amp;lt;get text);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 30 Jun 2018 00:27:02 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2018-06-30T00:27:02Z</dc:date>
    <item>
      <title>Saving R-Square values from smoothing spline fit</title>
      <link>https://community.jmp.com/t5/Discussions/Saving-R-Square-values-from-smoothing-spline-fit/m-p/61944#M33374</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to save the R-Square value from the smoothing spline fit in JSL? I'd like to be able to reference it at a later point.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jun 2018 00:00:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Saving-R-Square-values-from-smoothing-spline-fit/m-p/61944#M33374</guid>
      <dc:creator>aserino</dc:creator>
      <dc:date>2018-06-30T00:00:09Z</dc:date>
    </item>
    <item>
      <title>Re: Saving R-Square values from smoothing spline fit</title>
      <link>https://community.jmp.com/t5/Discussions/Saving-R-Square-values-from-smoothing-spline-fit/m-p/61945#M33375</link>
      <description>&lt;P&gt;All display data in an output table from a JMP platform is available to JSL.&amp;nbsp; Here is a simple example that retrieves the Smoother RSquare value&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );

biv = Bivariate(
	Y( :NPN1 ),
	X( :PNP1 ),
	Kernel Smoother( 1, 1, 0.343642611683849, 0 )
);

// Offset into the report object and get the RSquare value
RSquare = Num(Report(biv)["Local Smoother"][numberbox(1)]&amp;lt;&amp;lt;get text);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 30 Jun 2018 00:27:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Saving-R-Square-values-from-smoothing-spline-fit/m-p/61945#M33375</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-06-30T00:27:02Z</dc:date>
    </item>
    <item>
      <title>Re: Saving R-Square values from smoothing spline fit</title>
      <link>https://community.jmp.com/t5/Discussions/Saving-R-Square-values-from-smoothing-spline-fit/m-p/62057#M33424</link>
      <description>&lt;P&gt;Thanks for the reply Jim. The example you gave helps&amp;nbsp;a bit, but it doesn't work exactly the same for a Fit Spline(). What's the problem with the syntax in the following..&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );

biv = Bivariate(
	Y( :NPN1 ),
	X( :PNP1 ),
	Fit Spline( 100000, {Line Color( {204, 121, 41} )}, {Save Predicteds})
);

// Offset into the report object and get the RSquare value
RSquare = Num(Report(biv)["Smoothing Spline Fit, lambda=100000"][numberbox(1)]&amp;lt;&amp;lt;get text);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error implies a problem with the numberbox(1).&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jul 2018 22:16:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Saving-R-Square-values-from-smoothing-spline-fit/m-p/62057#M33424</guid>
      <dc:creator>aserino</dc:creator>
      <dc:date>2018-07-02T22:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: Saving R-Square values from smoothing spline fit</title>
      <link>https://community.jmp.com/t5/Discussions/Saving-R-Square-values-from-smoothing-spline-fit/m-p/62059#M33426</link>
      <description>&lt;P&gt;The R-square value is contained in a number col box in this case, not a number box.&amp;nbsp; You find the container for the value you want by viewing the tree structure.&amp;nbsp; See this page for instructions on that:&amp;nbsp; &lt;A href="https://www.jmp.com/support/help/14/view-the-display-tree.shtml" target="_self"&gt;https://www.jmp.com/support/help/14/view-the-display-tree.shtml&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You just need to replace the last line with this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;RSquare = (Report(biv)["Smoothing Spline Fit, lambda=100000"][numbercolbox(1)]&amp;lt;&amp;lt; Get)[1];&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The &amp;lt;&amp;lt; Get message to the number col box will return a list of values.&amp;nbsp; You can alternatively use "&amp;lt;&amp;lt; Get As Matrix".&amp;nbsp; The [1] returns the first list item, which is the R-squared value.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jul 2018 22:42:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Saving-R-Square-values-from-smoothing-spline-fit/m-p/62059#M33426</guid>
      <dc:creator>cwillden</dc:creator>
      <dc:date>2018-07-02T22:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: Saving R-Square values from smoothing spline fit</title>
      <link>https://community.jmp.com/t5/Discussions/Saving-R-Square-values-from-smoothing-spline-fit/m-p/62061#M33428</link>
      <description>&lt;P&gt;The Output Display's Tree Structure for the output you are looking for, is different than the example I gave.&amp;nbsp; If you right click on the gray triangle beside the Bivariate Fit of NPN1 By PNP1 outline box(), and then select&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Edit==&amp;gt;Show Tree Structure&lt;/P&gt;
&lt;P&gt;You can see the Tree Structure for all of the output.&lt;/P&gt;
&lt;P&gt;Below is the script using your output&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );

biv = Bivariate(
	Y( :NPN1 ),
	X( :PNP1 ),
	Fit Spline( 100000, {Line Color( {204, 121, 41} )}, {Save Predicteds})
);

// Offset into the report object and get the RSquare value
RSquare = (Report(biv)["Smoothing Spline Fit, lambda=100000"][NumberColBox(1)]&amp;lt;&amp;lt;get)[1] ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 02 Jul 2018 22:47:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Saving-R-Square-values-from-smoothing-spline-fit/m-p/62061#M33428</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-07-02T22:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: Saving R-Square values from smoothing spline fit</title>
      <link>https://community.jmp.com/t5/Discussions/Saving-R-Square-values-from-smoothing-spline-fit/m-p/62065#M33432</link>
      <description>Thanks for the help!</description>
      <pubDate>Tue, 03 Jul 2018 00:02:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Saving-R-Square-values-from-smoothing-spline-fit/m-p/62065#M33432</guid>
      <dc:creator>aserino</dc:creator>
      <dc:date>2018-07-03T00:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: Saving R-Square values from smoothing spline fit</title>
      <link>https://community.jmp.com/t5/Discussions/Saving-R-Square-values-from-smoothing-spline-fit/m-p/62066#M33433</link>
      <description>Thanks for the help Jim!</description>
      <pubDate>Tue, 03 Jul 2018 00:02:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Saving-R-Square-values-from-smoothing-spline-fit/m-p/62066#M33433</guid>
      <dc:creator>aserino</dc:creator>
      <dc:date>2018-07-03T00:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: Saving R-Square values from smoothing spline fit</title>
      <link>https://community.jmp.com/t5/Discussions/Saving-R-Square-values-from-smoothing-spline-fit/m-p/84950#M38031</link>
      <description>&lt;P&gt;If I add a "by(:SITE)" in the "Bivariate" function, then I will have five plots in the report. How can I extract all five Rsquare value and save it as a new column in the table?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Zihao&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 20:29:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Saving-R-Square-values-from-smoothing-spline-fit/m-p/84950#M38031</guid>
      <dc:creator>Zihao</dc:creator>
      <dc:date>2018-12-04T20:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: Saving R-Square values from smoothing spline fit</title>
      <link>https://community.jmp.com/t5/Discussions/Saving-R-Square-values-from-smoothing-spline-fit/m-p/84957#M38035</link>
      <description>&lt;P&gt;The Bivariate Platform creates a separate tree structure for each of the By levels.&amp;nbsp; To access the RSquare value, all that has to be done, is to point to the RSquare value as in the single Bivariate execution, but to add a subscript for which one of the RSquares outputs you want.&amp;nbsp; Below is a simple modification to the script, to place the RSquare values for all 5 sites into a new data table&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );

biv = Bivariate(
	Y( :NPN1 ),
	X( :PNP1 ),
	Fit Spline( 100000, {Line Color( {204, 121, 41} )}, {Save Predicteds} ),
	by( :site )
);

// Offset into the report object and get the RSquare value
RSquare = {};
For( i = 1, i &amp;lt;= N Items( biv ), i++,
	Insert Into(
		RSquare,
		(Report( biv[i] )["Smoothing Spline Fit, lambda=100000"][Number Col Box( 1 )]
		 &amp;lt;&amp;lt; get)[1]
	)
);

dtRSquare = New Table( "RSquareTable", New Column( "RSquares", values( RSquare ) ) );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;To fully understand how to deal with the Output Display Trees created by JMP, strongly suggest that you read the section on&amp;nbsp;Display Trees in the Scripting Guide&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; Help==&amp;gt;Books==&amp;gt;Scripting Guide&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 21:45:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Saving-R-Square-values-from-smoothing-spline-fit/m-p/84957#M38035</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-12-04T21:45:08Z</dc:date>
    </item>
  </channel>
</rss>

