<?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: Difference of lines in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Difference-of-lines/m-p/417718#M66684</link>
    <description>&lt;P&gt;Here's a low scripting alternative using the &lt;STRONG&gt;Save Formula&lt;/STRONG&gt; command available in the red triangle menu for a Smoother or Line of Fit element.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="XanGregg_0-1631541150941.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/35745i49FB7E1B999DC769/image-size/medium?v=v2&amp;amp;px=400" role="button" title="XanGregg_0-1631541150941.png" alt="XanGregg_0-1631541150941.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Starting with Craige's ab.jmp table using Overlay to get two lines/curves, use Save Formula to get a new column with a formula that looks like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;If( :Source Table == "a", Spline Eval( ... ), :Source Table == "b", Spline Eval( ... ), . ))&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Go into the Formula Editor for the new column and change the formula to subtract the two Spline expressions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Spline Eval( ... ) - Spline Eval( ... )&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And use that as the Y in GB.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="XanGregg_1-1631541420331.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/35746i0124EF073602DC7E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="XanGregg_1-1631541420331.png" alt="XanGregg_1-1631541420331.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 13 Sep 2021 13:59:43 GMT</pubDate>
    <dc:creator>XanGregg</dc:creator>
    <dc:date>2021-09-13T13:59:43Z</dc:date>
    <item>
      <title>Difference of lines</title>
      <link>https://community.jmp.com/t5/Discussions/Difference-of-lines/m-p/416953#M66603</link>
      <description>&lt;P&gt;Suppose I have two lines, distance vs. time for two different moving objects.&amp;nbsp; The time measurements for object 1 and object 2 are at arbitrary times, i.e., the measured times for object 1 aren't the same times as provided for object 2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way in Graph Builder to plot the *difference* between those curves vs. time?&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jun 2023 11:17:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Difference-of-lines/m-p/416953#M66603</guid>
      <dc:creator>BHarris</dc:creator>
      <dc:date>2023-06-11T11:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: Difference of lines</title>
      <link>https://community.jmp.com/t5/Discussions/Difference-of-lines/m-p/416976#M66607</link>
      <description>&lt;P&gt;The only way that you can compare to curves observed at different times is to model each one and compare the models at selected times. The model could be as simple as a linear interpolation as complex as any model type in JMP. Do you have JMP Pro? If so, you can treat the data as 'functions' and use the Functional Data Explorer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I won't go into detail until I hear from you that the general approach makes sense.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2021 19:33:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Difference-of-lines/m-p/416976#M66607</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2021-09-09T19:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: Difference of lines</title>
      <link>https://community.jmp.com/t5/Discussions/Difference-of-lines/m-p/417007#M66614</link>
      <description>&lt;P&gt;No, we just have the basic JMP v16.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2021 22:22:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Difference-of-lines/m-p/417007#M66614</guid>
      <dc:creator>BHarris</dc:creator>
      <dc:date>2021-09-09T22:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: Difference of lines</title>
      <link>https://community.jmp.com/t5/Discussions/Difference-of-lines/m-p/417148#M66623</link>
      <description>&lt;P&gt;If you had a pair of data tables, one per object, with columns for time and distance, you could save the formulas that would predict positions at between times. Subtracting the formulas at a Time would give an answer. I think Mark's question is if you think a linear/quadratic/other model from Fit Model would give a good-enough estimate of a object position, between measurements.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Sep 2021 13:56:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Difference-of-lines/m-p/417148#M66623</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2021-09-10T13:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: Difference of lines</title>
      <link>https://community.jmp.com/t5/Discussions/Difference-of-lines/m-p/417171#M66624</link>
      <description>&lt;P&gt;Exactly. The complexity of the curve or shape will dictate the complexity of the model that is necessary. Can you show a picture of a plot of the data? Perhaps there is a theoretical model for such data?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We cannot help you further because the next step is the modeling, but we have to know which model in order to help you.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Sep 2021 14:31:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Difference-of-lines/m-p/417171#M66624</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2021-09-10T14:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: Difference of lines</title>
      <link>https://community.jmp.com/t5/Discussions/Difference-of-lines/m-p/417361#M66642</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/5358"&gt;@Mark_Bailey&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Exactly. The complexity of the curve or shape will dictate the complexity of the model that is necessary. Can you show a picture of a plot of the data? Perhaps there is a theoretical model for such data?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We cannot help you further because the next step is the modeling, but we have to know which model in order to help you.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/5358"&gt;@Mark_Bailey&lt;/a&gt;&amp;nbsp;, &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;&amp;nbsp; -- Yes, a linear fit between points would be fine. &amp;nbsp;I realize the difference will be somewhat bouncy due to the linear interpolation, but that's fine, we're just looking at rough magnitudes.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Sep 2021 21:51:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Difference-of-lines/m-p/417361#M66642</guid>
      <dc:creator>BHarris</dc:creator>
      <dc:date>2021-09-10T21:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: Difference of lines</title>
      <link>https://community.jmp.com/t5/Discussions/Difference-of-lines/m-p/417365#M66645</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;If the two lines are linear, then a Fit Model of Height predicted by Weight, for the 2 sex groups end up having an term estimate of -2.079223.&amp;nbsp; Wouldn't that be the difference between the lines when simplified to a linear regression?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1631312435224.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/35709iFDF7E5C9DECC600C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1631312435224.png" alt="txnelson_0-1631312435224.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Sep 2021 22:20:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Difference-of-lines/m-p/417365#M66645</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-09-10T22:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: Difference of lines</title>
      <link>https://community.jmp.com/t5/Discussions/Difference-of-lines/m-p/417373#M66646</link>
      <description>&lt;P&gt;I think what you want is called a piece-wise linear interpolation. I'm not sure what platform might produce a formula for that, but you can do something similar like this. Do your own testing if you use this!&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$desktop/ab.jmp" ); // table with unaligned times for a and b measurements
dt &amp;lt;&amp;lt; sort( by( time ), replacetable( 1 ) ); // make sure time is ascending
aRows = dt &amp;lt;&amp;lt; getrowswhere( SourceTable == "a" ); // get all the a
bRows = dt &amp;lt;&amp;lt; getrowswhere( SourceTable == "b" ); // and b row indexes
aTimes = dt:time[aRows]; // get all the a and b times and positions in
aPositions = dt:position[aRows]; // matrices for the interpolate function
bTimes = dt:time[bRows];
bPositions = dt:position[bRows];

apos = Function( {time}, // tiny wrappers for interpolate
	Interpolate( time, aTimes, aPositions )
);
bpos = Function( {time},
	Interpolate( time, bTimes, bPositions )
);

dtnew = New Table( "new_ab", // new table is similar to old table
	New Column( "Source Table", Character( 1 ), "Nominal" ),
	New Column( "time", Numeric, "Continuous", Format( "Best", 12 ) ),
	New Column( "position", Numeric, "Continuous", Format( "Best", 12 ) )
);

bigdif = 0; // track the largest difference so it can have a ref line
bigtime = .;
// make a new table covering the range of the data
For( i = min(min(aTimes),min(bTimes))-10, i &amp;lt;= max(max(aTimes),max(bTimes))+10, i += 1,
	dtnew &amp;lt;&amp;lt; addrows( 1 ); // interpolate a at time i
	dtnew:SourceTable = "a";
	dtnew:time = i;
	dtnew:position = apos( i );
	dtnew &amp;lt;&amp;lt; addrows( 1 ); // interpolate b at time i
	dtnew:SourceTable = "b";
	dtnew:time = i;
	dtnew:position = bpos( i );
	dtnew &amp;lt;&amp;lt; addrows( 1 ); // difference at time i
	dtnew:SourceTable = "diff";
	dtnew:time = i;
	dtnew:position = apos( i ) - bpos( i );
	If( Abs( dtnew:position ) &amp;gt; bigdif, // capture biggest diff
		bigdif = Abs( dtnew:position );
		bigtime = i;
	);
);

dtnew &amp;lt;&amp;lt; Graph Builder(
	Size( 518, 448 ),
	Show Control Panel( 0 ),
	Variables( X( :time ), Y( :position ), Overlay( :Source Table ) ),
	Elements( Points( X, Y, Legend( 21 ) ), Smoother( X, Y, Legend( 22 ), Lambda( 0.000001 ) ) ),
	SendToReport(
		Dispatch( {}, "time", ScaleBox, {Add Ref Line( bigtime, "Solid", "Black", "big=" || Char( bigtime ), 1 )} ),
		Dispatch( {}, "Graph Builder", FrameBox, {Marker Size( 2 )} )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Input data like this&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture1.PNG" style="width: 307px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/35710i0484B69864992478/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture1.PNG" alt="Capture1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And the interpolated data like this&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture2.PNG" style="width: 367px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/35711iC2910CD82A3AA03A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture2.PNG" alt="Capture2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Producing a graph like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="The green curve is blue - red; the ref line is at the first biggest difference." style="width: 633px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/35712iCE02808E6A637DA6/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture3.PNG" alt="The green curve is blue - red; the ref line is at the first biggest difference." /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;The green curve is blue - red; the ref line is at the first biggest difference.&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If this was a race, a won in 71 seconds and b lost in 99 seconds. a was furthest ahead at 43 seconds (well, maybe. You can't be too sure about b's position at time 43 in the original data.)&lt;/P&gt;&lt;P&gt;You can't get that from a simple linear fit on the original data:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Original data with linear fit." style="width: 637px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/35713i600105191BCB8E80/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture4.PNG" alt="Original data with linear fit." /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Original data with linear fit.&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Sep 2021 23:09:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Difference-of-lines/m-p/417373#M66646</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2021-09-10T23:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: Difference of lines</title>
      <link>https://community.jmp.com/t5/Discussions/Difference-of-lines/m-p/417700#M66679</link>
      <description>&lt;P&gt;Wow, impressive solution! &amp;nbsp;And very well documented, thank you!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only thing better would be if JMP just did this on its own without the intermediate scripting step, but aside from shift-clicking two lines in Graph Builder and asking for a difference line (which is conceptually messy from a mental-model-of-what-it's-doing standpoint), I can't really imagine how that would work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, Craige!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(ps. &amp;nbsp;Are you really retired? &amp;nbsp;Doing JMP support for fun?)&lt;/P&gt;</description>
      <pubDate>Mon, 13 Sep 2021 13:02:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Difference-of-lines/m-p/417700#M66679</guid>
      <dc:creator>BHarris</dc:creator>
      <dc:date>2021-09-13T13:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: Difference of lines</title>
      <link>https://community.jmp.com/t5/Discussions/Difference-of-lines/m-p/417706#M66681</link>
      <description>&lt;P&gt;Yes, retired, and I learn a lot answering questions.&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/494"&gt;@XanGregg&lt;/a&gt;for the graph builder suggestion.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Sep 2021 13:14:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Difference-of-lines/m-p/417706#M66681</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2021-09-13T13:14:42Z</dc:date>
    </item>
    <item>
      <title>Re: Difference of lines</title>
      <link>https://community.jmp.com/t5/Discussions/Difference-of-lines/m-p/417718#M66684</link>
      <description>&lt;P&gt;Here's a low scripting alternative using the &lt;STRONG&gt;Save Formula&lt;/STRONG&gt; command available in the red triangle menu for a Smoother or Line of Fit element.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="XanGregg_0-1631541150941.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/35745i49FB7E1B999DC769/image-size/medium?v=v2&amp;amp;px=400" role="button" title="XanGregg_0-1631541150941.png" alt="XanGregg_0-1631541150941.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Starting with Craige's ab.jmp table using Overlay to get two lines/curves, use Save Formula to get a new column with a formula that looks like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;If( :Source Table == "a", Spline Eval( ... ), :Source Table == "b", Spline Eval( ... ), . ))&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Go into the Formula Editor for the new column and change the formula to subtract the two Spline expressions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Spline Eval( ... ) - Spline Eval( ... )&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And use that as the Y in GB.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="XanGregg_1-1631541420331.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/35746i0124EF073602DC7E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="XanGregg_1-1631541420331.png" alt="XanGregg_1-1631541420331.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Sep 2021 13:59:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Difference-of-lines/m-p/417718#M66684</guid>
      <dc:creator>XanGregg</dc:creator>
      <dc:date>2021-09-13T13:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: Difference of lines</title>
      <link>https://community.jmp.com/t5/Discussions/Difference-of-lines/m-p/430753#M68044</link>
      <description>&lt;P&gt;Due to some bizarre licensing problems* I was only finally able to try this today. &amp;nbsp;It works quite well, very elegant!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Two questions:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Is JSL powerful enough to make that formula change for me? &amp;nbsp;So that whole process could be scripted into a .jsl script?&lt;/LI&gt;&lt;LI&gt;I expected the difference curve to update as I changed the lambda on the smoother but it doesn't. &amp;nbsp;Looking deeper I see that the "Save formula" is actually saving off the spline parameters, not maintaining a connection back to the actual splines being used. &amp;nbsp;I presume the latter is not reasonably possible?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;****************************************&lt;/P&gt;&lt;P&gt;* I was finally forced to update my Mac to 11.6, not realizing that JMP v14 wouldn't work on it. &amp;nbsp;So I requested v16 through my company, and it literally took months after getting a PO to actually get a v16 license for me. &amp;nbsp;There was tons of back-and-forth with tax certs and address changes and PO problems. &amp;nbsp;I can't tell if the problem was my company's supply-chain or JMP/SAS's sales department, but getting a license if you have money in hand really shouldn't be that hard.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 15:04:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Difference-of-lines/m-p/430753#M68044</guid>
      <dc:creator>BHarris</dc:creator>
      <dc:date>2021-10-27T15:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: Difference of lines</title>
      <link>https://community.jmp.com/t5/Discussions/Difference-of-lines/m-p/691643#M87740</link>
      <description>&lt;P&gt;As a combination of the different suggestions, you could also use a simple interpolate() - interpolate() to calculate the difference and then use the lambda setting of the smoother plot to tune the granularity of the curve.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_0-1698514312749.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/58073iBF47F20E52360463/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_0-1698514312749.png" alt="hogi_0-1698514312749.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Open( "$DOWNLOADS/ab.jmp" );
New Column( "diff",
	Formula(
		rowsA = As Constant( Current Data Table() &amp;lt;&amp;lt; get rows where( :Source Table == "a" ) );
		rowsB = As Constant( Current Data Table() &amp;lt;&amp;lt; get rows where( :Source Table == "b" ) );
		xA = As Constant( :time[rowsA] );
		xB = As Constant( :time[rowsB] );
		posA = As Constant( :position[rowsA] );
		posB = As Constant( :position[rowsB] );
		If( Min( xA ) &amp;lt;= :time &amp;lt;= Max( xA ) &amp;amp; Min( xB ) &amp;lt;= :time &amp;lt;= Max( xB ),
			Interpolate( :time, xA, posA ) - Interpolate( :time, xB, posB ),
			.
		);
	)
);
Graph Builder(
	Variables( X( :time ), Y( :diff ), Y( :position ), Overlay( :Source Table ) ),
	Elements( Position( 1, 1 ), Points( X, Y, Overlay( 0 ), Legend( 1 ) ), Smoother( X, Y, Overlay( 0 ), Lambda( 0.02 ) ) ),
	Elements( Position( 1, 2 ), Points( X, Y ), Smoother( X, Y ) )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 28 Oct 2023 17:33:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Difference-of-lines/m-p/691643#M87740</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-10-28T17:33:20Z</dc:date>
    </item>
  </channel>
</rss>

