cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
Kelvin
Level I

How to overlay 2 CDF curves into one single plot using JSL script?

Hi

 

I would like to put more than one CDF plot in to a single curve.  I can do it under distribution/cdf tool to get a CDF curve, then by manually copy and paste the frame content from one to another curve.  Is there a way that I can do it using script?  

 

Kelvin

2 REPLIES 2
txnelson
Super User

Re: How to overlay 2 CDF curves into one single plot using JSL script?

The way I believe you want to go, is to use Fit Y by X, Oneway, and specifying the CDF plot there.

cdf.PNG

In the above example, the Variable Sex is used as the X Factor, and Height as the Y.  If you need to plot two or more separate columns, then the approach you can take is to simply stack the columns using 

     Tables=>Stack

and then use the Label variable as the X Factor, and the Data Column as the Y.

cdf2.PNG

Here is the sample script for the latter:

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );

dtStack = dt << Stack(
	columns( :height, :weight ),
	Source Label Column( "Label" ),
	Stacked Data Column( "Data" )
);

dtStack << Oneway( Y( :Data ), X( :Label ), All Graphs( 0 ), CDF Plot( 1 ) );
Jim

Re: How to overlay 2 CDF curves into one single plot using JSL script?

These plots are also available in Life Distribution using the Compare Groups tab in the launch diagram. Here is the same example as @txnelson used. The weight variable is not time-to-event, but you can still fit a variety of distribution models including the normal distribution used here.

 

Capture.JPG