<?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: Extract factor range from bivariate graph in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Extract-factor-range-from-bivariate-graph/m-p/425799#M67528</link>
    <description>&lt;P&gt;You can adjust the factor grid (reset factor grid from the red triangle) to only get one limit or the other.&lt;/P&gt;</description>
    <pubDate>Tue, 12 Oct 2021 18:30:35 GMT</pubDate>
    <dc:creator>ih</dc:creator>
    <dc:date>2021-10-12T18:30:35Z</dc:date>
    <item>
      <title>Extract factor range from bivariate graph</title>
      <link>https://community.jmp.com/t5/Discussions/Extract-factor-range-from-bivariate-graph/m-p/423684#M67278</link>
      <description>&lt;P&gt;How do I efficiently extract the crossing points of this curve and its 95% CI with an arbitrary Y value.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pauldeen_0-1633446305758.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/36316iBA763833A493F749/image-size/medium?v=v2&amp;amp;px=400" role="button" title="pauldeen_0-1633446305758.png" alt="pauldeen_0-1633446305758.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$sample_data/Growth.jmp" );
biv = Bivariate(
	Y( :age ),
	X( :ratio ),
	Fit Line( {Line Color( {204, 121, 41} )}, save studentized residuals ),
	SendToReport(
		Dispatch(
			{},
			"Bivar Plot",
			FrameBox,
			{Grid Line Order( 3 ), Reference Line Order( 4 )}
		)
	)
);
biv &amp;lt;&amp;lt; (Curve[1] &amp;lt;&amp;lt; Save Studentized Residuals);

biv2 = Bivariate(
	Y( :Studentized Residuals age ),
	X( :ratio ),
	Fit Polynomial( 2, {Confid Shaded Fit( 1 ), Line Color( {212, 73, 88} )} ),
	SendToReport(
		Dispatch(
			{},
			"ratio",
			ScaleBox,
			{Min( 0.2796875 ), Max( 1.2666259765625 ), Inc( 0.2 ), Minor Ticks( 1 )}
		),
		Dispatch(
			{},
			"Studentized Residuals age",
			ScaleBox,
			{Add Ref Line( 1.96, "Solid", "Black", "", 1 ),
			Add Ref Line( -1.96, "Solid", "Black", "", 1 )}
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So I would like to get the Ratio values where the curve and its 95%CI crosses +/- 1.96 (so 6 values in total). Are there any better solutions than the brute force I can think of: dumping the predicteds and the mean confidence limit formula into a table and adding rows with values to the table to see when it crosses the limits?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 19:58:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Extract-factor-range-from-bivariate-graph/m-p/423684#M67278</guid>
      <dc:creator>pauldeen</dc:creator>
      <dc:date>2023-06-09T19:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: Extract range from graph</title>
      <link>https://community.jmp.com/t5/Discussions/Extract-factor-range-from-bivariate-graph/m-p/423850#M67305</link>
      <description>&lt;P&gt;I don't know of a direct method but here are a few ideas.&amp;nbsp; Some would be a bit of work to script and probably I suspect none would be much faster for small problems.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Save a formula for each of those lines to the data table by pulling the parameters and standard errors from the table in the bivariate report and then creating a column with the appropriate formula.&amp;nbsp; Then use the optimizer built into the profiler to solve for each.&lt;/LI&gt;
&lt;LI&gt;Save relatively few points using the brute force method and then fit a new curve to them using fit model, and&amp;nbsp;&lt;EM&gt;then&lt;/EM&gt; save the prediction formula and solve with the optimizer.&lt;/LI&gt;
&lt;LI&gt;Fit using fit model instead where you should be able to extract the prediction formula directly, but maybe not the CI.&lt;/LI&gt;
&lt;LI&gt;Use the brute force method and interpolate between the closest few points, either linear between the last two, or for this problem quadratic between the closest three.&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 06 Oct 2021 11:54:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Extract-factor-range-from-bivariate-graph/m-p/423850#M67305</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2021-10-06T11:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: Extract factor range from bivariate graph</title>
      <link>https://community.jmp.com/t5/Discussions/Extract-factor-range-from-bivariate-graph/m-p/424320#M67346</link>
      <description>&lt;P&gt;You might be able to use the Minimize() function and the expression for the confidence boundary. See the Help for &lt;A href="https://www.jmp.com/support/help/en/16.1/#page/jmp/optimization-functions.shtml" target="_self"&gt;optimization methods&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2021 13:25:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Extract-factor-range-from-bivariate-graph/m-p/424320#M67346</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2021-10-07T13:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: Extract factor range from bivariate graph</title>
      <link>https://community.jmp.com/t5/Discussions/Extract-factor-range-from-bivariate-graph/m-p/424420#M67350</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/5358"&gt;@Mark_Bailey&lt;/a&gt;&amp;nbsp;thanks, I tried giving that a shot but the syntax is unclear to me.&lt;/P&gt;&lt;P&gt;This is as far as I got, but now I need to figure out how to feed it it the right optimization constraints:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

dt = Open( "$sample_data/Growth.jmp" );
biv = Bivariate(
	Y( :age ),
	X( :ratio ),
	Fit Line( {Line Color( {204, 121, 41} )}, save studentized residuals ),
	SendToReport(
		Dispatch(
			{},
			"Bivar Plot",
			FrameBox,
			{Grid Line Order( 3 ), Reference Line Order( 4 )}
		)
	)
);
biv &amp;lt;&amp;lt; (Curve[1] &amp;lt;&amp;lt; Save Studentized Residuals);
biv &amp;lt;&amp;lt; close window();

biv2 = Bivariate(
	Y( :Studentized Residuals age ),
	X( :ratio ),
	Fit Polynomial( 2, {Confid Shaded Fit( 1 ), Line Color( {212, 73, 88} )} ),
	SendToReport(
		Dispatch(
			{},
			"ratio",
			ScaleBox,
			{Min( 0.2796875 ), Max( 1.2666259765625 ), Inc( 0.2 ), Minor Ticks( 1 )}
		),
		Dispatch(
			{},
			"Studentized Residuals age",
			ScaleBox,
			{Add Ref Line( 1.96, "Solid", "Black", "", 1 ),
			Add Ref Line( -1.96, "Solid", "Black", "", 1 )}
		)
	)
);
biv &amp;lt;&amp;lt; (Curve[1] &amp;lt;&amp;lt; Mean Confidence Limit Formula);
f =column(dt, n cols(dt)) &amp;lt;&amp;lt; Get Formula;
fs = substitute(name expr(f), expr(:ratio), expr(x1));
/*A = [1 5];
b = [-1.96, 1.96];
minFun = Constrained Maximize(
	f,
	{x1( 0, 5 )},
	&amp;lt;&amp;lt;lessthanEQ( {A, b} )/*and/or &amp;lt;&amp;lt;GreaterThanEQ({A,b}) and/or &amp;lt;&amp;lt;EqualTo({A,b}),
	&amp;lt;&amp;lt;StartingValues( [1, .5] )
);
Eval List( {x1, minFun} );*/&lt;BR /&gt;
minimize(name expr(f), {})&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The last part doesn't work. Thanks for your help!&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2021 06:42:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Extract-factor-range-from-bivariate-graph/m-p/424420#M67350</guid>
      <dc:creator>pauldeen</dc:creator>
      <dc:date>2021-10-08T06:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: Extract factor range from bivariate graph</title>
      <link>https://community.jmp.com/t5/Discussions/Extract-factor-range-from-bivariate-graph/m-p/424466#M67352</link>
      <description>&lt;P&gt;I wonder about another approach. What if you use the Prediction Profiler and a Match Target desirability function with your target response? Then you can just pick off the predicted mean and the 95% confidence interval estimate of the mean.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I might have strayed from your original goal...&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2021 17:25:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Extract-factor-range-from-bivariate-graph/m-p/424466#M67352</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2021-10-07T17:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: Extract factor range from bivariate graph</title>
      <link>https://community.jmp.com/t5/Discussions/Extract-factor-range-from-bivariate-graph/m-p/424468#M67353</link>
      <description>&lt;P&gt;Your code was a bit messy. I cleaned it up and finished the example, though I might still be going after the wrong goal.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

// example data set
dt = Open( "$sample_data/Growth.jmp" );

// fit first-order polynomial model to response
biv = Bivariate(
	Y( :age ),
	X( :ratio ),
	Fit Line
);

// save residuals for next step
biv &amp;lt;&amp;lt; (Curve[1] &amp;lt;&amp;lt; Save Studentized Residuals);
biv &amp;lt;&amp;lt; Close Window();

// fit second-order polynomial model to residuals
biv = Bivariate(
	Y( :Studentized Residuals age ),
	X( :ratio ),
	Fit Polynomial( 2, {Confid Shaded Fit( 1 ), Line Color( {212, 73, 88} )} )
);

// save formulas for lower / upper 95% confidence bound
biv &amp;lt;&amp;lt; (Curve[1] &amp;lt;&amp;lt; Mean Confidence Limit Formula);

// get upper formula
f = Column( dt, N Cols( dt ) ) &amp;lt;&amp;lt; Get Formula;

// replace predictor name with x
fs = Substitute( Name Expr( f ), Expr( :ratio ), Expr( x ) );

// initialize x, could get x that predicts mean residual = 0
x = 0.5;

// minimize expression that is Abs( residual ), or mean = 0
fa = Insert( Expr( Abs() ), Name Expr( fs ) );

Minimize( fa, { x } );
Show( x );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Oct 2021 17:45:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Extract-factor-range-from-bivariate-graph/m-p/424468#M67353</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2021-10-07T17:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: Extract factor range from bivariate graph</title>
      <link>https://community.jmp.com/t5/Discussions/Extract-factor-range-from-bivariate-graph/m-p/424618#M67374</link>
      <description>&lt;P&gt;Yeah the problem with that one is that there are usually multiple crossings with the target value (one on the left and one on the right) and with the desirability maximizer you randomly get one of the two.&lt;/P&gt;&lt;P&gt;I tried Inverse predictions under fit model but that does not support quadratic terms.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2021 06:47:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Extract-factor-range-from-bivariate-graph/m-p/424618#M67374</guid>
      <dc:creator>pauldeen</dc:creator>
      <dc:date>2021-10-08T06:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: Extract factor range from bivariate graph</title>
      <link>https://community.jmp.com/t5/Discussions/Extract-factor-range-from-bivariate-graph/m-p/424620#M67376</link>
      <description>&lt;P&gt;Yeah, exactly this works for finding the local minimum but it still is hard to get to the next crossing with 1.96 from there. You would still need to walk up the curve untill values exceed 1.96.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To temperoraly solve this, I built function for it that just takes little steps and goes out in both directions untill the value exceeds the limits (or the max number of steps) but I had expected there to be a solver function in JMP that would implement a better algorithm (like what is built into the non-linear platform). I guess for now I have what I need but I'm always open for nicer ways to do it.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2021 06:53:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Extract-factor-range-from-bivariate-graph/m-p/424620#M67376</guid>
      <dc:creator>pauldeen</dc:creator>
      <dc:date>2021-10-08T06:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: Extract factor range from bivariate graph</title>
      <link>https://community.jmp.com/t5/Discussions/Extract-factor-range-from-bivariate-graph/m-p/424693#M67384</link>
      <description>&lt;P&gt;You can do this using the optimizer built into the profiler.&amp;nbsp; Set response limits to match target and then to find the upper and lower values just use reset factor grid to define the range of values to search, either above or below the minimum.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Profiler(
	Y( :Lower 95% Mean Studentized Residuals age ),
	Profiler(
		1,
		Desirability Functions( 1 ),
		Lower 95% Mean Studentized Residuals age &amp;lt;&amp;lt;
		Response Limits(
			{Lower( -0.04, 0.0183 ), Middle( 1.96, 1 ), Upper( 3.96, 0.0183 ),
			Goal( "Match Target" ), Importance( 1 )}
		),
		Term Value( ratio( 0.8, Min( 0 ), Max( 0.8 ), Lock( 0 ), Show( 1 ) ) )
	),
	SendToReport(
		Dispatch(
			{"Prediction Profiler"},
			"1",
			ScaleBox,
			{Min( 0 ), Max( 0.8 ), Inc( 0.2 ), Minor Ticks( 0 )}
		)
	)
) &amp;lt;&amp;lt; Maximize Desirability;

Profiler(
	Y( :Lower 95% Mean Studentized Residuals age ),
	Profiler(
		1,
		Desirability Functions( 1 ),
		Lower 95% Mean Studentized Residuals age &amp;lt;&amp;lt;
		Response Limits(
			{Lower( -0.04, 0.0183 ), Middle( 1.96, 1 ), Upper( 3.96, 0.0183 ),
			Goal( "Match Target" ), Importance( 1 )}
		),
		Term Value( ratio( 1.52, Min( 0.8 ), Max( 2 ), Lock( 0 ), Show( 1 ) ) )
	),
	SendToReport(
		Dispatch(
			{"Prediction Profiler"},
			"1",
			ScaleBox,
			{Min( 0.8 ), Max( 2 ), Inc( 0.2 ), Minor Ticks( 0 )}
		)
	)
) &amp;lt;&amp;lt; Maximize Desirability;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You should also be able to modify the expression you send to the minimize function by just subtracting 1.96 and minimizing the residual to get the same result.&amp;nbsp; For some reason I get slightly different values though even after adjusting tolorances (1.07 in profiler v 1.03 with minimize).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;fa = Insert( Expr( Abs() ), parse( "abs( " || char( Name Expr( fs ) ) || " - 1.96 )" ) );

// find lower value
x = 0.2;
Minimize( fa, { x(0.2,0.8) } );
Show( x );

// find upper value
x = 1;
Minimize( fa, { x(0.8,1.5) } );
Show( x );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2021 11:53:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Extract-factor-range-from-bivariate-graph/m-p/424693#M67384</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2021-10-08T11:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: Extract factor range from bivariate graph</title>
      <link>https://community.jmp.com/t5/Discussions/Extract-factor-range-from-bivariate-graph/m-p/424765#M67396</link>
      <description>&lt;P&gt;minor variation&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;offset = 1.96;

// (I do not know how to pick these without a visual examination of the result.)
startingPoint = 1.1; // or 0.5 (trial and error. pick something close and check.)

// example data set
dt = Open( "$sample_data/Growth.jmp" );

// fit first-order polynomial model to response
biv = Bivariate( Y( :age ), X( :ratio ), Fit Line );

// save residuals for next step
biv &amp;lt;&amp;lt; (Curve[1] &amp;lt;&amp;lt; Save Studentized Residuals);
biv &amp;lt;&amp;lt; Close Window();

// fit second-order polynomial model to residuals
biv = Bivariate( Y( :Studentized Residuals age ), X( :ratio ), Fit Polynomial( 2, {Confid Shaded Fit( 1 ), Line Color( {212, 73, 88} )} ) );

// save formulas for lower / upper 95% confidence bound
biv &amp;lt;&amp;lt; (Curve[1] &amp;lt;&amp;lt; save predicteds);
biv &amp;lt;&amp;lt; (Curve[1] &amp;lt;&amp;lt; Mean Confidence Limit Formula);
// get formulas, using order columns were saved
fupper = Column( dt, N Cols( dt ) ) &amp;lt;&amp;lt; Get Formula;
flower = Column( dt, N Cols( dt ) - 1 ) &amp;lt;&amp;lt; Get Formula;
fpredicted = Column( dt, N Cols( dt ) - 2 ) &amp;lt;&amp;lt; Get Formula;

// replace predictor name with x
fsupper = Substitute( Name Expr( fupper ), Expr( :ratio ), Expr( x ) );
fslower = Substitute( Name Expr( flower ), Expr( :ratio ), Expr( x ) );
fspredicted = Substitute( Name Expr( fpredicted ), Expr( :ratio ), Expr( x ) );

fsupper2 = Substitute( Expr( a - offset ), Expr( a ), Name Expr( fsupper ) ); // find zero at offset 
fslower2 = Substitute( Expr( a - offset ), Expr( a ), Name Expr( fslower ) ); // find zero at offset 
fspredicted2 = Substitute( Expr( a - offset ), Expr( a ), Name Expr( fspredicted ) ); // find zero at offset 

// initialize x, could get x that predicts mean residual = 0
x = startingPoint;
// minimize expression that is Abs( residual ), or mean = 0
faupper = Insert( Expr( Abs() ), Name Expr( fsupper2 ) );
Minimize( faupper, {x} );
xupper = x;
Show( xupper, Eval( faupper ) );

// initialize x, could get x that predicts mean residual = 0
x = startingPoint;
// minimize expression that is Abs( residual ), or mean = 0
falower = Insert( Expr( Abs() ), Name Expr( fslower2 ) );
Minimize( falower, {x} );
xlower = x;
Show( xlower, Eval( falower ) );


// initialize x, could get x that predicts mean residual = 0
x = startingPoint;
// minimize expression that is Abs( residual ), or mean = 0
fapredicted = Insert( Expr( Abs() ), Name Expr( fspredicted2 ) );
Minimize( fapredicted, {x} );
xpredicted = x;
Show( xpredicted, Eval( fapredicted ) );

// add lines on plot
Report( biv )[axisbox( 2 )] &amp;lt;&amp;lt; {Add Ref Line( xpredicted, "Solid", "Black", "P", 1 ), Add Ref Line( xupper, "Solid", "Black", "U", 1 ),
Add Ref Line( xlower, "Solid", "Black", "L", 1 )};
Report( biv )[axisbox( 1 )] &amp;lt;&amp;lt; {Add Ref Line( offset, "Solid", "Black", "", 1 )};
Report( biv )[framebox( 1 )] &amp;lt;&amp;lt; Frame Size( 752, 513 );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Low side" style="width: 846px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/36424iCB60D36523E3C3E0/image-size/large?v=v2&amp;amp;px=999" role="button" title="LowSide.png" alt="Low side" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Low side&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="High side" style="width: 846px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/36425iABCC3FF122719D0F/image-size/large?v=v2&amp;amp;px=999" role="button" title="HighSide.png" alt="High side" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;High side&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2021 14:28:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Extract-factor-range-from-bivariate-graph/m-p/424765#M67396</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2021-10-08T14:28:15Z</dc:date>
    </item>
    <item>
      <title>Re: Extract factor range from bivariate graph</title>
      <link>https://community.jmp.com/t5/Discussions/Extract-factor-range-from-bivariate-graph/m-p/424775#M67398</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;,&amp;nbsp;to solve the initial value problem, if you minimize the whole function first you could use that ratio as a limit for the minimize search and be guaranteed to find the values on each side. For this problem that could be 0.8:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Minimize( fa, { x([very small number],[min ratio - found from minimizing the function]) } );

//For this example -10 is arbitrary (could use -1E6 or something), and 0.8 is
//roughly the overall function minimum
Minimize( fa, { x(-10,0.8) } );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2021 12:40:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Extract-factor-range-from-bivariate-graph/m-p/424775#M67398</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2021-11-09T12:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: Extract factor range from bivariate graph</title>
      <link>https://community.jmp.com/t5/Discussions/Extract-factor-range-from-bivariate-graph/m-p/425661#M67512</link>
      <description>&lt;P&gt;I tried desperatly to come up with a algorithm for the starting point, for example I used the quadratic formula to calculate the predicted curve crossing with 1.96 and even if you plug that number in for the starting condition you&amp;nbsp;get fairly unpredictable behavior:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pauldeen_0-1634045471129.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/36508iF2EAB43BC94E4A27/image-size/medium?v=v2&amp;amp;px=400" role="button" title="pauldeen_0-1634045471129.png" alt="pauldeen_0-1634045471129.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So thanks for showing how it can be used and I did learn a lot from this example, but it is not robust enough yet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Oct 2021 13:32:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Extract-factor-range-from-bivariate-graph/m-p/425661#M67512</guid>
      <dc:creator>pauldeen</dc:creator>
      <dc:date>2021-10-12T13:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: Extract factor range from bivariate graph</title>
      <link>https://community.jmp.com/t5/Discussions/Extract-factor-range-from-bivariate-graph/m-p/425668#M67513</link>
      <description>&lt;P&gt;I think the problem is with the absolute value function making a curve that doesn't have a nice derivative, making minimize likely to fail. I was hoping&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6657"&gt;@ih&lt;/a&gt;&amp;nbsp; idea would force minimize to stay in the right neighborhood, but maybe not.&lt;/P&gt;&lt;P&gt;I don't have time to puzzle through it right now; it seems likely there is a standard alternative to abs() for this problem...yielding a smoother function. (maybe squaring it? something like that.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit: and your result agrees with mine, which is why I had the comment about visual inspection. The abs function makes a corner in the function to minimize, and the slope near that corner is used by the minimize function, and it expects a continuous (2nd?) derivative on each side of the answer. Since the slope &lt;EM&gt;instantly&lt;/EM&gt; flips on each side of the true answer, it is amazing it gets close answers sometimes. I think the message in the log may be because of this.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Oct 2021 14:12:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Extract-factor-range-from-bivariate-graph/m-p/425668#M67513</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2021-10-12T14:12:01Z</dc:date>
    </item>
    <item>
      <title>Re: Extract factor range from bivariate graph</title>
      <link>https://community.jmp.com/t5/Discussions/Extract-factor-range-from-bivariate-graph/m-p/425799#M67528</link>
      <description>&lt;P&gt;You can adjust the factor grid (reset factor grid from the red triangle) to only get one limit or the other.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Oct 2021 18:30:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Extract-factor-range-from-bivariate-graph/m-p/425799#M67528</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2021-10-12T18:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: Extract factor range from bivariate graph</title>
      <link>https://community.jmp.com/t5/Discussions/Extract-factor-range-from-bivariate-graph/m-p/425807#M67530</link>
      <description>&lt;P&gt;Expanding on&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;&amp;nbsp; and&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/5358"&gt;@Mark_Bailey&lt;/a&gt;&amp;nbsp;'s code, you could do something like what is below to find the overall minimum and then use that as a bound for subsequent searches on each side, that way you are not as reliant on the initial value.&amp;nbsp; Also, if you use a square instead of an absolute value gets rid of the corner. In practice though I've had good luck using the absolute value and other functions with step changes in the profiler's optimizer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

// example data set
dt = Open( "$sample_data/Growth.jmp" );

// fit first-order polynomial model to response
biv = Bivariate(
	Y( :age ),
	X( :ratio ),
	Fit Line
);

// save residuals for next step
biv &amp;lt;&amp;lt; (Curve[1] &amp;lt;&amp;lt; Save Studentized Residuals);
biv &amp;lt;&amp;lt; Close Window();

// fit second-order polynomial model to residuals
biv = Bivariate(
	Y( :Studentized Residuals age ),
	X( :ratio ),
	Fit Polynomial( 2, {Confid Shaded Fit( 1 ), Line Color( {212, 73, 88} )} )
);

// save formulas for lower / upper 95% confidence bound
biv &amp;lt;&amp;lt; (Curve[1] &amp;lt;&amp;lt; Mean Confidence Limit Formula);

// get formulas
fUpper = Column( dt, N Cols( dt ) ) &amp;lt;&amp;lt; Get Formula;
fLower = Column( dt, N Cols( dt ) - 1 ) &amp;lt;&amp;lt; Get Formula;

// replace predictor name with x
fsUpper = Substitute( Name Expr( fUpper ), Expr( :ratio ), Expr( x ) );
fsLower = Substitute( Name Expr( fLower ), Expr( :ratio ), Expr( x ) );

// initialize x, could get x that predicts mean residual = 0
x = 0.5;

// find the minimum of the whole expression, one solution will fall above and one below this value
fOverallMin = Name Expr( fsLower );
Minimize( fOverallMin, { x } );
xOverallMin = x;

// find where the value cross the x axis on each side of the overall min
x = xOverallMin - 1;
fMinCrossingTarget = Insert( Expr( Power() ), Insert( Expr( add(-1.96) ), Name Expr( fsLower ) ) );
Minimize( fMinCrossingTarget, { x(-1000, xOverallMin) } );
xMinLower = x;

x = xOverallMin + 1;
Minimize( fMinCrossingTarget, { x(xOverallMin, 1000) } );
xMinUpper = x;

x = xOverallMin - 1;
fMaxCrossingTarget = Insert( Expr( Power() ), Insert( Expr( add(-1.96) ), Name Expr( fsUpper ) ) );
Minimize( fMaxCrossingTarget, { x(-1000, xOverallMin) } );
xMaxLower = x;

x = xOverallMin + 1;
Minimize( fMaxCrossingTarget, { x(xOverallMin, 1000) } );
xMaxUpper = x;

show(xOverallMin, xMinLower, xMinUpper, xMaxLower, xMaxUpper);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 12:11:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Extract-factor-range-from-bivariate-graph/m-p/425807#M67530</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2021-10-20T12:11:56Z</dc:date>
    </item>
  </channel>
</rss>

