<?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: Plot conventional and reverse CDF on same plot by grouping variable in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Plot-conventional-and-reverse-CDF-on-same-plot-by-grouping/m-p/192576#M41174</link>
    <description>&lt;P&gt;I like Georgia's solution a lot. Here is a simpler and different approach: normalizing the two data sets before combining the plot. It might not be as satisfying.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used two normal distributions with different parameters to illustrate this approach. You could save the fitted model for a distribution of sample data as a column formula instread of making up the data as I did. Here is the resulting plot:&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="Screen Shot 2019-04-11 at 6.08.21 AM.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/16849i7E0E1D941C0E12D8/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2019-04-11 at 6.08.21 AM.png" alt="Screen Shot 2019-04-11 at 6.08.21 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I attached the data table that I made to produce this plot.&lt;/P&gt;</description>
    <pubDate>Thu, 11 Apr 2019 10:14:06 GMT</pubDate>
    <dc:creator>Mark_Bailey</dc:creator>
    <dc:date>2019-04-11T10:14:06Z</dc:date>
    <item>
      <title>Plot conventional and reverse CDF on same plot by grouping variable</title>
      <link>https://community.jmp.com/t5/Discussions/Plot-conventional-and-reverse-CDF-on-same-plot-by-grouping/m-p/192508#M41161</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Have a question on CDF plots on the distribution platform&lt;/P&gt;&lt;P&gt;I would like to plot the CDF of two variables say Y1 and Y2 which are on the same numerical scale but differ by the range/. For example Y1 from 0-100 and Y2 from 0 to 1000. I want to plot Y1like a regular CDF plot with the CumProb going from 0 to 1 and X1 values increasing from 0 to 100.&lt;/P&gt;&lt;P&gt;For Y2, I want the X2 to be in decreasing order from 1000 to 0 but the cumprob of Y2 runs from 0 to Y increasing in the Y axis direction.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to essentially reverse cdf(Y2) and overplot with cdf(Y1) and plot both on the same cdf plot window. Eventually I want to shade specific areas under the curves based on X1 and X2 values but before that I want to know how I could accomplish this task?&amp;nbsp;&lt;/P&gt;&lt;P&gt;I started with getting the probability score and adding a column for 1-P(X2 &amp;gt; x) for Y2 but was little stuck on how I could get 1-P(X2&amp;gt;x) and P(X1&amp;lt;=x1) on the same X axis and was running around circles with how I could approach this in general. Any thoughts and pointers would be really helpful. I have 5 different categories of a grouping variable and do not mind having 5 different such cdf plots.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2019 22:34:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Plot-conventional-and-reverse-CDF-on-same-plot-by-grouping/m-p/192508#M41161</guid>
      <dc:creator>theseventhhill</dc:creator>
      <dc:date>2019-04-10T22:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: Plot conventional and reverse CDF on same plot by grouping variable</title>
      <link>https://community.jmp.com/t5/Discussions/Plot-conventional-and-reverse-CDF-on-same-plot-by-grouping/m-p/192519#M41162</link>
      <description>&lt;P&gt;Attached is a script that I believe simulates your data setup and two methods to create the graph you described. One uses unstacked data ( two columns) and another with stacked data.&amp;nbsp; If you are looking for rows where the Inv Prob of Y2 &amp;gt; Prob Y1 the unstacked (raw) data would be easier to use.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note, Y1 and Y2 were simulated as uniform distributions.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);

dt = New Table("Demo - Raw", Add rows(1000),
        New Column("Y1", Numeric, Continuous, &amp;lt;&amp;lt;Set Each Value(Random Integer(0,100)) ),
        New Column("Y2", Numeric, Continuous, &amp;lt;&amp;lt;Set Each Value(Random Integer(0,1000)) )    
     );

dist = dt &amp;lt;&amp;lt; Distribution(
	Continuous Distribution( Column( :Y1 ) ),
	Continuous Distribution( Column( :Y2 ) )
);

dist &amp;lt;&amp;lt; Save(Prob Scores);

dist &amp;lt;&amp;lt; close window();

dt &amp;lt;&amp;lt; New Column("Inv Prob Y2", numeric, continuous, &amp;lt;&amp;lt;Set Each Value(1-:Prob Y2));


//Using Unstacked data and GraphBuilder
gb = dt &amp;lt;&amp;lt; Graph Builder(
	Size( 534, 454 ),
	Show Control Panel( 0 ),
	Variables(
		X( :Y1 ),
		X( :Y2, Position( 1 ) ),
		Y( :Prob Y1 ),
		Y( :Inv Prob Y2, Position( 1 ) )
	),
	Elements(
		Smoother( X( 1 ), Y( 1 ), Legend( 25 ) ),
		Smoother( X( 2 ), Y( 2 ), Legend( 27 ) )
	),
	SendToReport(
		Dispatch(
			{},
			"Y1",
			ScaleBox,
			{Min( -100 ), Max( 1100 ), Inc( 50 ), Minor Ticks( 1 ),
			Label Row( {Show Major Grid( 1 ), Show Minor Grid( 1 )} )}
		),
		Dispatch(
			{},
			"Prob Y1",
			ScaleBox,
			{Min( -0.1 ), Max( 1.1 ), Inc( 0.1 ), Minor Ticks( 1 ),
			Label Row( {Show Major Grid( 1 ), Show Minor Grid( 1 )} )}
		)
	)
);


//Sometimes it is easier to stack the data and use Bivariate instead of GraphBuilder

dtstck = dt &amp;lt;&amp;lt; Stack(
	columns( :Y1, :Y2, :Prob Y1, :Inv Prob Y2 ),
	Source Label Column( "Label" ),
	Stacked Data Column( "Data" ),
	Stack By Row( 0 ),
	Number of Series( 2 ),
	Contiguous,
	Output Table Name("Demo - Stacked")
);

dtstck:Data2 &amp;lt;&amp;lt; set name("Prob");

//this creates one graph with 2 curves
biv = dtstck &amp;lt;&amp;lt; Bivariate(
	Y( :Prob ),
	X( :Data ),
	Group By(:Label),
	Fit Each Value( {Report(0)}),
	SendToReport(
		Dispatch(
			{},
			"1",
			ScaleBox,
			{Min( -50 ), Max( 1050 ), Inc( 50 ), Minor Ticks( 1 ),
			Label Row( {Show Major Grid( 1 ), Show Minor Grid( 1 )} )}
		),
		Dispatch(
			{},
			"2",
			ScaleBox,
			{Label Row( {Show Major Grid( 1 ), Show Minor Grid( 1 )} )}
		),

		Dispatch(
			{},
			"Bivar Plot",
			FrameBox,
			{Row Legend(
				Label,
				Color( 1 ),
				Color Theme( "JMP Default" ),
				Marker( 0 ),
				Marker Theme( "" ),
				Continuous Scale( 0 ),
				Reverse Scale( 0 ),
				Excluded Rows( 0 )
			)}
		)
	)
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here are the two graphs:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 711px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/16840i2518B26A359067F8/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 465px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/16841i71E6FBDC91419526/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2019 00:43:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Plot-conventional-and-reverse-CDF-on-same-plot-by-grouping/m-p/192519#M41162</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2019-04-11T00:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: Plot conventional and reverse CDF on same plot by grouping variable</title>
      <link>https://community.jmp.com/t5/Discussions/Plot-conventional-and-reverse-CDF-on-same-plot-by-grouping/m-p/192576#M41174</link>
      <description>&lt;P&gt;I like Georgia's solution a lot. Here is a simpler and different approach: normalizing the two data sets before combining the plot. It might not be as satisfying.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used two normal distributions with different parameters to illustrate this approach. You could save the fitted model for a distribution of sample data as a column formula instread of making up the data as I did. Here is the resulting plot:&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="Screen Shot 2019-04-11 at 6.08.21 AM.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/16849i7E0E1D941C0E12D8/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2019-04-11 at 6.08.21 AM.png" alt="Screen Shot 2019-04-11 at 6.08.21 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I attached the data table that I made to produce this plot.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2019 10:14:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Plot-conventional-and-reverse-CDF-on-same-plot-by-grouping/m-p/192576#M41174</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2019-04-11T10:14:06Z</dc:date>
    </item>
  </channel>
</rss>

