Plot conventional and reverse CDF on same plot by grouping variableHello,
Have a question on CDF plots on the distribution platform
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.
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.
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?
I started with getting the probability score and adding a column for 1-P(X2 > x) for Y2 but was little stuck on how I could get 1-P(X2>x) and P(X1<=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.
Re: Plot conventional and reverse CDF on same plot by grouping variableAttached 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. If you are looking for rows where the Inv Prob of Y2 > Prob Y1 the unstacked (raw) data would be easier to use.
Note, Y1 and Y2 were simulated as uniform distributions.
Names Default to Here(1);
dt = New Table("Demo - Raw", Add rows(1000),
New Column("Y1", Numeric, Continuous, <<SET each="" value=""></SET>
Here are the two graphs:


Re: Plot conventional and reverse CDF on same plot by grouping variableI 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.
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:

I attached the data table that I made to produce this plot.