control chart with multiple items how to save summaries in one table<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />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.
Re: control chart with multiple items how to save summaries in one tableqy6b0
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 ););
Re: control chart with multiple items how to save summaries in one tableIf 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.
Re: control chart with multiple items how to save summaries in one tableHow 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)
);
Re: control chart with multiple items how to save summaries in one tableThe 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?
Re: control chart with multiple items how to save summaries in one tableAs 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.