<?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 How can show the slope in the graph? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-can-show-the-slope-in-the-graph/m-p/770437#M95153</link>
    <description>&lt;P&gt;Thanks!&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
Graph Builder(
	Variables( X( Transform Column( "rows", Formula( Row() ) ) ), Y( :height ) ),
	Elements( Points( X, Y, Legend( 3 ) ), Line Of Fit( X, Y, Legend( 5 ) ) )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-07-06_10-31-27.png" style="width: 638px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/65899iCAEBDA454E7EA5B2/image-size/large?v=v2&amp;amp;px=999" role="button" title="2024-07-06_10-31-27.png" alt="2024-07-06_10-31-27.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 06 Jul 2024 02:36:35 GMT</pubDate>
    <dc:creator>lala</dc:creator>
    <dc:date>2024-07-06T02:36:35Z</dc:date>
    <item>
      <title>How can show the slope in the graph?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-show-the-slope-in-the-graph/m-p/770437#M95153</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
Graph Builder(
	Variables( X( Transform Column( "rows", Formula( Row() ) ) ), Y( :height ) ),
	Elements( Points( X, Y, Legend( 3 ) ), Line Of Fit( X, Y, Legend( 5 ) ) )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-07-06_10-31-27.png" style="width: 638px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/65899iCAEBDA454E7EA5B2/image-size/large?v=v2&amp;amp;px=999" role="button" title="2024-07-06_10-31-27.png" alt="2024-07-06_10-31-27.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Jul 2024 02:36:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-show-the-slope-in-the-graph/m-p/770437#M95153</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2024-07-06T02:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: How can show the slope in the graph?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-show-the-slope-in-the-graph/m-p/770449#M95154</link>
      <description>&lt;P&gt;What do you mean by slope in this case and where you wish to see it? You can for example enable equation for line of fit&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1720243785600.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/65901iA48B61A697DC45ED/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1720243785600.png" alt="jthi_0-1720243785600.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Jul 2024 05:32:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-show-the-slope-in-the-graph/m-p/770449#M95154</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-07-06T05:32:54Z</dc:date>
    </item>
    <item>
      <title>Re: How can show the slope in the graph?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-show-the-slope-in-the-graph/m-p/770451#M95155</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P class=""&gt;How is this value obtained in JSL?&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;0.2326&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-07-06_15-29-00.png" style="width: 638px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/65902i7B4300EE1CCE3C58/image-size/large?v=v2&amp;amp;px=999" role="button" title="2024-07-06_15-29-00.png" alt="2024-07-06_15-29-00.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Jul 2024 08:19:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-show-the-slope-in-the-graph/m-p/770451#M95155</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2024-07-06T08:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: How can show the slope in the graph?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-show-the-slope-in-the-graph/m-p/770452#M95156</link>
      <description>&lt;P&gt;If you just need that value I would use Fit Y by X platform or Linear Regression matrix function&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

rows = (1::N Rows(dt))`;
ys = dt[0, "height"];

{Estimates, Std_Error, Diagnostics} = Linear Regression(ys, rows);

slope = Estimates[2];&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: Added other options&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp", Invisible);
dt &amp;lt;&amp;lt; New Column("R", Numeric, Continuous, Formula(Row()));


// Linear Regression()
{Estimates, Std_Error, Diagnostics} = Linear Regression(dt[0, "height"], dt[0, "R"],);
// lr_eq = Eval Insert("height = ^Estimates[1]^ + ^Estimates[2]^ * R");
lr_s1 = Estimates[2];


// Bivariate + Fit Line
biv = dt &amp;lt;&amp;lt; Bivariate(Y(:height), X(:R), &amp;lt;&amp;lt; Fit Line, Invisible);
biv_eq = Report(biv)[Outline Box("Linear Fit"), Text Edit Box(1)] &amp;lt;&amp;lt; get text;
biv &amp;lt;&amp;lt; close window;
biv_s1 = Regex(biv_eq, "\s([0-9\.]+)*\D+$", "\1");
//biv_s2 = Word(-2, eq, " +*");


// Graph Builder + Line Of Fit + Equation(1)
gb = dt &amp;lt;&amp;lt; Graph Builder(
	Size(525, 454),
	Show Control Panel(0),
	Variables(X(:R), Y(:height)),
	Elements(Points(X, Y, Legend(3)), Line Of Fit(X, Y, Legend(5), Equation(1))),
	Invisible
);
tseg = Report(gb)[FrameBox(1)] &amp;lt;&amp;lt; Find Seg(Text Seg(1));
gb_eq = tseg &amp;lt;&amp;lt; get text;
gb &amp;lt;&amp;lt; Close Window;
gb_s1 = Regex(gb_eq, "\s([0-9\.]+)*\D+$", "\1");
//gb_s2 = Word(-2, eq, " +*");

Close(dt, no save);
Show(lr_s1, biv_s1, gb_s1);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;</description>
      <pubDate>Sat, 06 Jul 2024 15:39:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-show-the-slope-in-the-graph/m-p/770452#M95156</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-07-06T15:39:49Z</dc:date>
    </item>
  </channel>
</rss>

