BookmarkSubscribe
Choose Language Hide Translation Bar
Highlighted
Community Trekker

## JMP Script : Pareto plot - combine last causes

JMP Script : Pareto plot - combine causes

Hello?

I do like to combine Last 3 causes at Pareto plot.

In this case, how can I make script?

=====================================================

Names Default To Here( 1 );

dt = Open(

"\$SAMPLE_DATA/Quality Control/Failure2.jmp"

);

obj = Pareto Plot( Cause( :failure ), Freq( :N ) );

Wait( 2 );

obj <<

Combine Causes(

{"miscellaneous", "silicon defect", "doping"}

);

=====================================================

I change the script as below, but it is not working.

Combine Causes( Last Causes (3)

1 ACCEPTED SOLUTION

Accepted Solutions
Staff

## Re: JMP Script : Pareto plot - combine last causes

Currently, there is no scriptable method for Last Causes.  We will consider adding this in a future release.  In the meantime, you can generate the list of desired items to combine as shown below for JMP 11.

dt = Open( "\$SAMPLE_DATA\Quality Control\Failure.jmp" );

/* Sort table by N */
dt << Sort( By( :N ), Order( Descending ), Replace Table );

lastCauses = 3;
combineList = {};
start = N Rows( dt ) - lastCauses + 1;

/* Build list for Last Causes */
For( i = start, i <= N Rows( dt ), i++,
Insert Into( combineList, Column( "failure" ) )
);

/* Use the list in Combine Causes  */

pPlot = dt << Pareto Plot(
Cause( :failure ),
Freq( :N ),
Combine Causes( combineList )
);

Wendy
Staff

## Re: JMP Script : Pareto plot - combine last causes

Currently, there is no scriptable method for Last Causes.  We will consider adding this in a future release.  In the meantime, you can generate the list of desired items to combine as shown below for JMP 11.

dt = Open( "\$SAMPLE_DATA\Quality Control\Failure.jmp" );

/* Sort table by N */
dt << Sort( By( :N ), Order( Descending ), Replace Table );

lastCauses = 3;
combineList = {};
start = N Rows( dt ) - lastCauses + 1;

/* Build list for Last Causes */
For( i = start, i <= N Rows( dt ), i++,
Insert Into( combineList, Column( "failure" ) )
);

/* Use the list in Combine Causes  */

pPlot = dt << Pareto Plot(
Cause( :failure ),
Freq( :N ),
Combine Causes( combineList )
);

Wendy