- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
how to make cumulative probability plots in JMP?
How can I make cumulative probability plot like the one below? Appreciate your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: how to make cumulative probability plots in JMP?
The solution comes from @XanGregg - employing a hidden feature of "Line" graph:
https://community.jmp.com/t5/JMP-Wish-List/Add-CDFs-to-Graph-Builder/idc-p/794428/highlight/true#M62...
Open( "$SAMPLE_DATA/Airline Delays.jmp" );
Graph Builder(
Variables( X( :Arrival Delay ), Wrap( :Month ), Overlay( :Airline ) ),
Elements( Line( X, Summary Statistic( "Cumulative Percent" ) ) ));
and when you prefer points, it's almost that easy :
Open( "$SAMPLE_DATA/Airline Delays.jmp" );
new column ("one", formula(1)); // enabling the magic for points
Graph Builder(
Variables( X( :Arrival Delay ), Y( :one_Nr ), Wrap( :Month ), Overlay( :Airline ) ),
Elements( Points( X, Y, Legend( 3 ), Summary Statistic( "Cumulative Percent" ) ) )
);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: how to make cumulative probability plots in JMP?
The subtle difference between CDF and Cumulative Probability:
So, think twice if it's OK to switching the Y scale to Normal Probability!
Life Distribution: Cumulative Probability
Graph Builder (workaround via Cumulative Percent and 1s on the Y axis):
Open( "$SAMPLE_DATA/Airline Delays.jmp" );
:distance[1] = 10000;
Life Distribution(
Y( :Distance ),
<<Set Scale( Normal )
);
Graph Builder(
Transform Column( "CDF", Formula( 1 ) ),
Variables( X( :Distance ), Y( :CDF ) ),
Elements(
Points( X, Y, Legend( 1 ), Summary Statistic( "Cumulative Percent" ) ),
Line( X, Y, Legend( 2 ), Summary Statistic( "Cumulative Percent" ) )
),
SendToReport(
Dispatch( {}, "CDF", ScaleBox,
{Scale( "Normal Probability" )})
));
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: how to make cumulative probability plots in JMP?
Hi hogi,
Reviving an old thread. I am trying to understand Graph Builder better. I can get the fit for the Cumulative Probability that includes all the data:
And I can use the Overlay option below to make it match your graph and show the fit for the different groups:
But I cannot figure out how I can use Graph Builder to combine those graphs (show the fit for all the data and for the different groups in one graph). Is this possible just using Graph Builder? I have someone here who seems to get frustrated every time I reference Script, so I want to show how this is done on Graph Builder, if possible, until he gets more accustomed to JMP.
Not the same data above, but he wants something like this in the graph area:
Thank you for any assistance,
Grant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: how to make cumulative probability plots in JMP?
Ignore my message above. I think I should go home, my brain is done for the week apparently...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: how to make cumulative probability plots in JMP?
For a Minitab-like plot - with meaningful fits (!), you have to use LifeDistribution with Perspective: Compare Groups:
Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
Life Distribution(
Perspective( Compare Groups ),
Y( :height ),
Grouping( :sex ),
Fit Distribution( "Normal" ),
Select Distribution( Distribution ),
Select Scale( Normal ),
);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: how to make cumulative probability plots in JMP?
To get the overlay (all data + curves by sex),
you have to switch to Graph Builder, change the scale on the Y axis to normal probability, calculate the cumulative probability "manually" and play with the variable settings.
You can even activate the fit - and get confidence intervals ...
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
Graph Builder(
Transform Column(
"Cumulative Probability[height] by sex",
Formula( Col Rank( :height, :sex ) / (Col Number( :height, :sex ) + 1) )
),
Transform Column(
"Cumulative Probability[height]",
Formula( Col Rank( :height ) / (Col Number( :height ) + 1) )
),
Variables(
X( :height ),
Y( :"Cumulative Probability[height]"n ),
Y( :"Cumulative Probability[height] by sex"n, Position( 1 ) ),
Overlay( :sex )
),
Elements(
Points( X, Y( 2 ) ),
Points( X, Y( 1 ), Overlay( 0 ) ),
Line Of Fit( X, Y( 2 ) ),
Line Of Fit( X, Y( 2 ), Overlay( 0 ) )
),
SendToReport(
Dispatch( {}, "Cumulative Probability[height]", ScaleBox,
{Scale( "Normal Probability" )}))
);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: how to make cumulative probability plots in JMP?
but the fits don't match ...
The difference:
- Graph Builder fits a straight line to the cumulative distribution.
- Life Distribution takes the actual data to determine the parameters of the underlying normal distribution:
mean and standard deviation
... then it displays the result as cumulative probability - which gives a straight line.
Although both paths result in a straight line, the methods to achieve them differ.
Consequently, the residuals, the fit, and the confidence intervals might differ.
Please also note the slight offset between the Y values at the far left and right.
[3000]
- « Previous
- Next »