<?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 Need to display and pull x-intercept from a linear fit in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Need-to-display-and-pull-x-intercept-from-a-linear-fit/m-p/525419#M74988</link>
    <description>&lt;P&gt;I am taking a certain range of data points around the straight part of my curve, and attempting to extract an x-intercept out of it using a linear fit. I can display an equation for the line but can't seem to do much with it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At the very least, I want to grab that equation, solve for x when y = 0 and then display that number below the graph.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What would be the best way to go about pulling this information out?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In an ideal scenario, I could display the entire data range, but only fit the range of data points that I have currently shown as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks you for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What it ideally should look like:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Turn-onVoltage.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/44249iE86A61C8E2603F0E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Turn-onVoltage.png" alt="Turn-onVoltage.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;My Plot with the data filter:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="x-intercept.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/44248iA8AA2813F49F44D1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="x-intercept.png" alt="x-intercept.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;The code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Graph Builder(
	Size( 618, 525 ),
	Show Control Panel( 0 ),
	Show Legend( 0 ),
	Variables( X( :V1 ), Y( :I1 ), Page( :Sweep Name ), Overlay( :Test Count ) ),
	Elements(
		Line Of Fit( X, Y, Legend( 18 ), Confidence of Fit( 0 ) ),
		Points( X, Y, Legend( 19 ) )
	),
	Local Data Filter(
		Add Filter(
			columns( :I1, :Test Count ),
			Where( :I1 &amp;gt;= 0.003 &amp;amp; :I1 &amp;lt;= 0.008 ),
			Where( :Test Count == "1" ),
			Display( :Test Count, N Items( 15 ), Find( Set Text( "" ) ) )
		)
	),
	SendToReport(
		Dispatch(
			{},
			"I1",
			ScaleBox( 2 ),
			{Min( 0 ), Max( 0.008 ), Inc( 0.001 ), Minor Ticks( 1 )}
		),
		Dispatch( {}, "graph title", TextEditBox, {Set Text( "On Voltage" )} )
	)
);&lt;/CODE&gt;&amp;nbsp;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 11 Jun 2023 11:26:10 GMT</pubDate>
    <dc:creator>trevorphysics</dc:creator>
    <dc:date>2023-06-11T11:26:10Z</dc:date>
    <item>
      <title>Need to display and pull x-intercept from a linear fit</title>
      <link>https://community.jmp.com/t5/Discussions/Need-to-display-and-pull-x-intercept-from-a-linear-fit/m-p/525419#M74988</link>
      <description>&lt;P&gt;I am taking a certain range of data points around the straight part of my curve, and attempting to extract an x-intercept out of it using a linear fit. I can display an equation for the line but can't seem to do much with it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At the very least, I want to grab that equation, solve for x when y = 0 and then display that number below the graph.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What would be the best way to go about pulling this information out?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In an ideal scenario, I could display the entire data range, but only fit the range of data points that I have currently shown as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks you for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What it ideally should look like:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Turn-onVoltage.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/44249iE86A61C8E2603F0E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Turn-onVoltage.png" alt="Turn-onVoltage.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;My Plot with the data filter:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="x-intercept.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/44248iA8AA2813F49F44D1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="x-intercept.png" alt="x-intercept.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;The code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Graph Builder(
	Size( 618, 525 ),
	Show Control Panel( 0 ),
	Show Legend( 0 ),
	Variables( X( :V1 ), Y( :I1 ), Page( :Sweep Name ), Overlay( :Test Count ) ),
	Elements(
		Line Of Fit( X, Y, Legend( 18 ), Confidence of Fit( 0 ) ),
		Points( X, Y, Legend( 19 ) )
	),
	Local Data Filter(
		Add Filter(
			columns( :I1, :Test Count ),
			Where( :I1 &amp;gt;= 0.003 &amp;amp; :I1 &amp;lt;= 0.008 ),
			Where( :Test Count == "1" ),
			Display( :Test Count, N Items( 15 ), Find( Set Text( "" ) ) )
		)
	),
	SendToReport(
		Dispatch(
			{},
			"I1",
			ScaleBox( 2 ),
			{Min( 0 ), Max( 0.008 ), Inc( 0.001 ), Minor Ticks( 1 )}
		),
		Dispatch( {}, "graph title", TextEditBox, {Set Text( "On Voltage" )} )
	)
);&lt;/CODE&gt;&amp;nbsp;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jun 2023 11:26:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Need-to-display-and-pull-x-intercept-from-a-linear-fit/m-p/525419#M74988</guid>
      <dc:creator>trevorphysics</dc:creator>
      <dc:date>2023-06-11T11:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: Need to display and pull x-intercept from a linear fit</title>
      <link>https://community.jmp.com/t5/Discussions/Need-to-display-and-pull-x-intercept-from-a-linear-fit/m-p/525459#M74991</link>
      <description>&lt;P&gt;Since you are using a filter and then fitting a line to that small subset, use Fit Model to fit the line. That way you have the Inverse Prediction option from the red popup menu under Estimates &amp;gt; Inverse Prediction. Put your Y as 0 and JMP will find your X and even provide a 95% confidence interval for the X.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2022 22:21:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Need-to-display-and-pull-x-intercept-from-a-linear-fit/m-p/525459#M74991</guid>
      <dc:creator>Dan_Obermiller</dc:creator>
      <dc:date>2022-07-22T22:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: Need to display and pull x-intercept from a linear fit</title>
      <link>https://community.jmp.com/t5/Discussions/Need-to-display-and-pull-x-intercept-from-a-linear-fit/m-p/525477#M74993</link>
      <description>&lt;P&gt;Performing the great idea of&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/3194"&gt;@Dan_Obermiller&lt;/a&gt;&amp;nbsp;this may look as follows:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

// generate data
dt = New Table( "Characteristic curve",
	add rows( 21 ),
	New Column( "V", set values( Matrix( -10 :: 10 ) / 10 ) ),
	New Column( "I", set each value( If( Exp( :V ) &amp;lt; 1.5, 0, Exp( :V ) - 1.5 ) ) )
);
dt &amp;lt;&amp;lt; show window( 0 );

// create a dashboard to display all windows
nw = New Window( "Dashboard Inverse Prediction",
	H List Box( vlb_left = V List Box(), vlb_right = V List Box() ),
	&amp;lt;&amp;lt;on close(
		Close( dt, NoSave );
		Close( result_dt, NoSave );
	)
);

// fit model with inverse prediction and place into dashboard 
vlb_right &amp;lt;&amp;lt; append(
	fm_obj = dt &amp;lt;&amp;lt; Fit Model(
		Y( :I ),
		Effects( :V ),
		Personality( "Standard Least Squares" ),
		Emphasis( "Effect Leverage" ),
		Run(
			:I &amp;lt;&amp;lt; {Summary of Fit( 1 ), Analysis of Variance( 1 ), Parameter Estimates( 1 ), Lack of Fit( 0 ), Scaled Estimates( 0 ),
			Plot Actual by Predicted( 1 ), Plot Residual by Predicted( 1 ), Plot Studentized Residuals( 0 ), Plot Effect Leverage( 1 ),
			Plot Residual by Normal Quantiles( 0 ), Box Cox Y Transformation( 0 ), Inverse Prediction( Response( 0 ), Term Value( V( . ) ) )}
		),
		Local Data Filter( Conditional, Close Outline( 1 ), Add Filter( columns( :I ), Where( :I &amp;gt;= 0.2 ) ) )
	)
);

// get report and make into data table
tb_lst = Report( fm_obj ) &amp;lt;&amp;lt; xpath( "//TableBox" );
result_dt = tb_lst[N Items( tb_lst )] &amp;lt;&amp;lt; make data table;
result_dt &amp;lt;&amp;lt; show window( 0 );

// and fill into dashboard
vlb_left &amp;lt;&amp;lt; append( outline box("Inverse Prediction", dg1 = result_dt &amp;lt;&amp;lt; new data box()) );
dg1 &amp;lt;&amp;lt; close side panels( 1 );
dg1 &amp;lt;&amp;lt; set height( 30 );

// place GraphBuilder into dashboard
vlb_left &amp;lt;&amp;lt; append(// visualize
	dt &amp;lt;&amp;lt; Graph Builder(
		show control panel( 0 ),
		Variables( X( :V ), Y( :I ) ),
		Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) )
	)
);
vlb_left &amp;lt;&amp;lt; append( dg2 = dt &amp;lt;&amp;lt; new data box() );
dg2 &amp;lt;&amp;lt; close side panels( 1 );





&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 23 Jul 2022 08:57:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Need-to-display-and-pull-x-intercept-from-a-linear-fit/m-p/525477#M74993</guid>
      <dc:creator>Georg</dc:creator>
      <dc:date>2022-07-23T08:57:57Z</dc:date>
    </item>
  </channel>
</rss>

