cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
qy6b0
Level I

control chart with multiple items how to save summaries in one table

I have a control chart (cc) window with multiple items (i.e. each item has a control chart). In jsl, when I use cc<< Save Summaries, it pops up a summary table for each item. How can I save all summaries in one table with item name identified? Thank you.

5 REPLIES 5
Peter_Bartell
Level VIII

Re: control chart with multiple items how to save summaries in one table

As a suggestion, why not just use the hot spot drop down option from the control chart window for Save Summaries? This creates a single JMP data table with column identified quantities for various summary measures.

txnelson
Super User

Re: control chart with multiple items how to save summaries in one table

The default action with ,<< Save Summaries is to create a single table for all charts defined for the platform.  The example below will produce an example of the combined Summary Table.

Names Default To Here( 1 );

dt = Open( "$SAMPLE_DATA/Quality Control/Airport.jmp" );

// Add a column so there is a second charting column

dt<< new column("Random",formula(Random Uniform()));

obj = Control Chart(

       Sample Size( :Day ),

       KSigma( 3 ),

       Chart Col( :Delay, XBar, R ),

       Chart Col( :Random, XBar, R )

);

obj << Save Summaries;


Could you clarify your issue?

Jim
vheber
Level II

Re: control chart with multiple items how to save summaries in one table

How could the same (save all summaries in one table with item name identified) be done if a By-variable is used in the control chart?

Like in this example that creates a chart for ByVar=1 and ByVar=2:

dt = Open( "$SAMPLE_DATA/Quality Control/Airport.jmp" );

dt<< new column("ByVar", Character, formula(left(:Day,1)));

obj = Control Chart(

  Sample Size( :Day ),

  KSigma( 3 ),

  Chart Col( :Delay, XBar ),

  By(:ByVar)

);

ian_jmp
Staff

Re: control chart with multiple items how to save summaries in one table

If you use the tooltip in the editor, you will see that (when using a 'By' variable), obj is a list. So you could try something like:

Names Default To Here( 1 );

dt = Open( "$SAMPLE_DATA/Quality Control/Airport.jmp" );

// Add a column so there is a second charting column

dt<< new column("Random",formula(Random Uniform()));

dt<< new column("By",formula(Random Integer(1, 2)));

obj = Control Chart(

       Sample Size( :Day ),

       KSigma( 3 ),

       Chart Col( :Delay, XBar, R ),

       Chart Col( :Random, XBar, R ),

       By(:By)

);

For(b=1, b<=NItems(obj), b++, obj[b] << Save Summaries);


Then you have to consolidate the resulting tables of course.

Phil_Brown
Super User (Alumni)

Re: control chart with multiple items how to save summaries in one table

qy6b0

veronica.a.heber

You could try the following:

dt = Open( "$SAMPLE_DATA/Quality Control/Airport.jmp" );

dt << New Column( "ByVar", Character, formula( Left( :Day, 1 ) ) );

obj = Control Chart( Sample Size( :Day ), KSigma( 3 ), Chart Col( :Delay, XBar ), By( :ByVar ) );

Current Data Table( dt );

Summarize( byVals = By( :ByVar ) );

res = obj << SaveSummaries;

If( Is List( res ),

finalTable = res[1] << concatenate( res[2 :: N Items( res )], create source column, outputTableName( "Saved Summaries" ) );

Try(

col = Column( finalTable, "Source Table" );

col << set name( dt:ByVar << get name );

For( i = 1, i <= N Items( res ), i++,

col[finalTable << get rows where( Column( dt:ByVar << get name )[] == (res << get name) )] = byVals;

Close( res, NoSave );

);

,

finalTable = res

);

);

PDB