Control Chart
Example 1
Summary: Visualizes control chart results from a data table, utilizing Control Chart platform with K-Sigma set to 3 and range span of 1, while hiding center line and control limits.
Code:
// Plot Results
// Open data table
dt = Open("data_table.jmp");
// Plot Results
Control Chart(
KSigma( 3 ),
Range Span( 1 ),
Chart Col(
:Average,
Individual Measurement(
Show Center Line( 0 ),
Show Control Limits( 0 )
)
)
);
Code Explanation:
- Open data table.
- Create control chart.
- Set K Sigma to 3.
- Set range span to 1.
- Add chart column.
- Select average column.
- Use individual measurement.
- Hide center line.
- Hide control limits.
Example 2
Summary: Opens a data table, creates a UWMA control chart with specified parameters, and adds the UWMA chart column.
Code:
// UWMA Chart
// Open data table
dt = Open("data_table.jmp");
// UWMA Chart
Control Chart(
Sample Label( :Status ),
Sample Size( 5 ),
K Sigma( 3 ),
Moving Average Span( 2 ),
Chart Col( :Gap, UWMA )
);
Code Explanation:
- Open data table.
- Create control chart.
- Set sample label.
- Define sample size.
- Set K sigma value.
- Specify moving average span.
- Add UWMA chart column.
Example 3
Summary: Generates a UWMA chart to monitor and control process variability, utilizing the Control Chart platform in JMP.
Code:
// UWMA Chart
// Open data table
dt = Open("data_table.jmp");
// UWMA Chart
Control Chart(
Sample Label( :Date ),
Sample Size( 5 ),
K Sigma( 3 ),
Moving Average Span( 2 ),
Chart Col( :Gap, UWMA )
);
Code Explanation:
- Open data table.
- Create control chart.
- Set sample label.
- Define sample size.
- Set K Sigma value.
- Specify moving average span.
- Add UWMA chart column.
Example 4
Summary: Creates a control chart for quality monitoring, utilizing a run chart to visualize sample data and specify chart columns.
Code:
Names Default To Here( 1 );
dt = Open("data_table.jmp");
obj = Control Chart( Sample Size( 1 ), Chart Col( :Weight ), Chart Type( Run Chart ) );
Code Explanation:
- Set default names.
- Open data table.
- Create control chart object.
- Set sample size to 1.
- Select chart column.
- Specify chart type as run chart.
Example 5
Summary: Creates a control chart with XBar chart type, 3 sigma control limits, and weight column, using data from an open JMP data table.
Code:
Names Default To Here( 1 );
dt = Open("data_table.jmp");
obj = Control Chart( Sample Size( :Sample ), KSigma( 3 ), Chart Col( :Weight ), Chart Type( XBar ) );
Code Explanation:
- Set default names scope.
- Open data table.
- Create control chart object.
- Set sample size column.
- Set control limits to 3 sigma.
- Add weight column to chart.
- Specify chart type as XBar.
Example 6
Summary: Creates a control chart with sample label 'Box', sample size 'Box Size', and K-Sigma set to 3, featuring a '# Defects' column with limits precision set to -1.
Code:
dt under test = Open("data_table.jmp");
obj = Control Chart(
Sample Label( :Box ),
Sample Size( :Box Size ),
KSigma( 3 ),
Chart Col( :Name( "# Defects" ), C( Limits Precision( -1 ) ) )
);
Code Explanation:
- Open data table.
- Create control chart object.
- Set sample label to Box.
- Define sample size as Box Size.
- Set KSigma to 3.
- Add # Defects column to chart.
- Set limits precision to -1.
Example 7
Summary: Creates a control chart with specified parameters, including sample size, KSigma, and weight, for analysis of the Gap column using EWMA method.
Code:
dt under test = Open("data_table.jmp");
obj = Control Chart( Sample Size( 5 ), KSigma( 3 ), Weight( 0.5 ), Chart Col( :Gap, EWMA ) );
Code Explanation:
- Open data table.
- Create control chart object.
- Set sample size to 5.
- Set KSigma to 3.
- Set weight to 0.5.
- Specify Gap column for analysis.
- Use EWMA method for chart.
Example 8
Summary: Creates a control chart with individual measurement settings and moving range chart for weight, utilizing Control Chart functionality in JMP.
Code:
dt under test = Open("data_table.jmp");
obj = Control Chart(
Sample Label( :Sample ),
Group Size( 1 ),
KSigma( 3 ),
Chart Col( :Weight, Individual Measurement( Needle( 1 ), Connect Points( 0 ) ), Moving Range( Needle( 1 ), Connect Points( 0 ) ) )
);
Code Explanation:
- Open data table.
- Create control chart object.
- Set sample label column.
- Define group size as 1.
- Set K Sigma to 3.
- Add weight column to chart.
- Configure individual measurement settings.
- Enable needle for individual measurements.
- Disable point connections for individuals.
- Add moving range chart for weight.
Example 9
Summary: Creates a control chart with median moving range type, using data from an open JMP data table and specifying K-Sigma as 3.
Code:
Names Default To Here( 1 );
dt = Open("data_table.jmp");
obj = Control Chart( KSigma( 3 ), Chart Col( :Weight ), Chart Type( Median Moving Range ) );
Code Explanation:
- Set default names.
- Open data table.
- Create control chart object.
- Set K-Sigma to 3.
- Add Weight column.
- Use Median Moving Range type.
Example 10
Summary: Creates a control chart with sample size 400, K Sigma level 3, and needle display for defects, utilizing Control Chart functionality in JMP.
Code:
dt under test = Open("data_table.jmp");
obj = Control Chart(
Sample Size( 400 ),
KSigma( 3 ),
Chart Col( :Name( "# defective" ), NP( Needle( 1 ), Connect Points( 0 ), Point Marker( 12 ) ) )
);
Code Explanation:
- Open data table;
- Create control chart object.
- Set sample size to 400.
- Define K Sigma level as 3.
- Add chart column for defects.
- Use NP chart type.
- Enable needle display.
- Disable point connection.
- Set point marker style to 12.
- Display control chart.
Example 11
Summary: Creates a control chart with sample label, sample size, and K Sigma specifications to analyze defect rates in a data table.
Code:
dt under test = Open("data_table.jmp");
obj = Control Chart( Sample Label( :Lot ), Sample Size( :Lot Size ), K Sigma( 3 ), Chart Col( :Name( "# defective" ), P ) );
Code Explanation:
- Open data table.
- Create control chart object.
- Set sample label column.
- Define sample size column.
- Specify K Sigma value.
- Add P chart column.
Example 12
Summary: Creates a control chart with individual and moving range plots for quality monitoring, utilizing the Control Chart platform in JMP.
Code:
dt under test = Open("data_table.jmp");
obj = Control Chart( Sample Label( :Sample ), KSigma( 3 ), Chart Col( :Weight, Individual on Group Means, Moving Range on Group Means ), );
Code Explanation:
- Open data table.
- Assign data table to variable.
- Create control chart object.
- Set sample label column.
- Define KSigma level.
- Add Weight column to chart.
- Use Individual on Group Means plot.
- Use Moving Range on Group Means plot.
Example 13
Summary: Creates a control chart with sample label 'Date', unit size 'Unit size', and K Sigma set to 3, featuring column '# defects' for defect tracking.
Code:
dt under test = Open("data_table.jmp");
obj = Control Chart( Sample Label( :Date ), Unit Size( :Unit size ), KSigma( 3 ), Chart Col( :Name( "# defects" ), U ) );
Code Explanation:
- Open data table;
- Create control chart object.
- Set sample label to "Date".
- Set unit size to "Unit size".
- Set K Sigma to 3.
- Add column "# defects" to chart.
- Set chart type to U control chart.
Example 14
Summary: Creates a control chart with sample label, K Sigma level, and moving average span for data analysis.
Code:
dt under test = Open("data_table.jmp");
obj = Control Chart( Sample Label( :Sample ), KSigma( 3 ), Moving Average Span( 3 ), Chart Col( :Gap, UWMA ) );
Code Explanation:
- Open data table.
- Create control chart object.
- Set sample label column.
- Define K Sigma level.
- Set moving average span.
- Add Gap column to chart.
- Specify UWMA analysis type.
Example 15
Summary: Creates a control chart with defects column, unit size, and K-Sigma set to 3, and sends report dispatch with grid line order and reference line order.
Code:
dt under test = Open("data_table.jmp");
obj = Control Chart(
Sample Label( :Date ),
Unit Size( :Unit size ),
KSigma( 3 ),
Chart Col( :Name( "# defects" ), U( Show Zones( 1 ), Shade Zones( 1 ) ) ),
SendToReport( Dispatch( {"U of # defects"}, "Attributes Chart", FrameBox, {Grid Line Order( 4 ), Reference Line Order( 5 )} ) )
);
Code Explanation:
- Open data table.
- Create control chart.
- Set sample label.
- Define unit size.
- Set K Sigma to 3.
- Add defects column.
- Enable upper zone.
- Shade upper zone.
- Send report dispatch.
- Adjust grid and reference lines.
Example 16
Summary: Creates a control chart with sample size, KSigma value, and '# defective' column using JMP's Control Chart platform.
Code:
dt = Open("data_table.jmp");
obj1 = Control Chart( Sample Size( :Lot Size ), KSigma( 3 ), Chart Col( :Name( "# defective" ), P ), );
Code Explanation:
- Open data table;
- Create control chart object.
- Set sample size column.
- Set KSigma value to 3.
- Add "# defective" column.
- Use P chart type.
Example 17
Summary: Creates a control chart for defect analysis, selecting all rows and deleting them from the data table.
Code:
dt = Open("data_table.jmp");
obj1 = Control Chart( Sample Size( :Lot Size ), KSigma( 3 ), Chart Col( :Name( "# defective" ), P ), );
dt << select all rows;
dt << delete rows();
Code Explanation:
- Open data table.
- Create control chart object.
- Set sample size column.
- Set K Sigma value.
- Add defect count column.
- Select all rows.
- Delete selected rows.
Example 18
Summary: Creates a control chart to monitor defects in a production process, utilizing a P-chart and specifying K Sigma value.
Code:
dt under test = Open("data_table.jmp");
obj = Control Chart( Sample Label( :Lot ), Sample Size( :Lot Size ), K Sigma( 3 ), Chart Col( Name( "# defective" ), P ) );
Code Explanation:
- Open data table;
- Assign data table to variable.
- Create control chart object.
- Set sample label column.
- Define sample size column.
- Set K Sigma value.
- Add chart column for defects.
- Specify chart type as P-chart.
Example 19
Summary: Creates a control chart with EWMA type, specifying sample label column, sample size, K Sigma value, and weight, while deleting middle rows from the data table.
Code:
dt = Open("data_table.jmp");
obj = dt << Control Chart( Sample Label( :Status ), Sample Size( 5 ), KSigma( 3 ), weight( 0.2 ), Chart Col( :Gap ), Chart Type( EWMA ) );
dt << Delete Rows( Index( 2, N Row( dt ) - 1 ) );
Code Explanation:
- Open data table.
- Create control chart object.
- Set sample label column.
- Define sample size.
- Set K Sigma value.
- Assign weight.
- Specify chart column.
- Choose chart type.
- Delete middle rows.
- Save changes.
Example 20
Summary: Creates a control chart with picture box for data analysis, utilizing the Control Chart platform in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Control Chart( Sample Size( :Sample ), KSigma( 3 ), Chart Col( :Weight ), Chart Type( IR ) );
obj[Picture Box( 1 )];
Code Explanation:
- Open data table.
- Create control chart object.
- Set sample size column.
- Define KSigma level.
- Specify chart column.
- Choose chart type.
- Display picture box.
Example 21
Summary: Creates a control chart with XBar and R charts, utilizing sample labels and KSigma levels to visualize measurement data.
Code:
dt = Open("data_table.jmp");
cc1sample = {:part#};
cc1column = {:Measurement};
obj = dt << Control Chart( Sample Label( Eval( cc1sample ) ), KSigma( 3 ), Chart Col( Eval( cc1column ), XBar, R ) );
rpt = obj << report;
Code Explanation:
- Open data table.
- Assign part number column.
- Assign measurement column.
- Create control chart object.
- Set sample label.
- Define KSigma level.
- Add XBar and R charts.
- Generate report object.
Example 22
Summary: Creates and manipulates a control chart for weight, utilizing various JSL syntax features such as Eval, Substitute, and Parse.
Code:
dt = Open("data_table.jmp");
samplesz = 6;
obj = Control Chart( Sample Size( samplesz ), KSigma( 3 ), Chart Col( :weight, XBar, R ) );
obj << close window;
obj = Control Chart( Sample Size( Eval( samplesz ) ), KSigma( 3 ), Chart Col( :weight, XBar, R ) );
obj << close window;
Eval( Eval Expr( obj = Control Chart( Sample Size( Expr( samplesz ) ), KSigma( 3 ), Chart Col( :weight, XBar, R ) ) ) );
obj << close window;
Eval(
Substitute( Expr( obj = Control Chart( Sample Size( samp ), KSigma( 3 ), Chart Col( :weight, XBar, R ) ) ), Expr( samp ), samplesz )
);
obj << close window;
Eval( Parse( "obj = Control Chart( Sample Size( " || Char( samplesz ) || " ), KSigma( 3 ), Chart Col( :weight, XBar, R ) );" ) );
obj << close window;
Code Explanation:
- Open data table;
- Set sample size to 6.
- Create control chart for weight.
- Close the control chart window.
- Re-create control chart with evaluated sample size.
- Close the control chart window.
- Use nested Eval to create control chart.
- Close the control chart window.
- Substitute sample size variable in expression.
- Close the control chart window.
- Parse and evaluate string expression for control chart.
- Close the control chart window.
Example 23
Summary: Creates and configures a control chart with XBar and R, utilizing the Control Chart platform in JMP.
Code:
ut relative epsilon = 1e-2;
dt = Open("data_table.jmp");
samplesz = 6;
obj = Control Chart( Sample Size( samplesz ), KSigma( 3 ), Chart Col( :weight, XBar, R ) );
obj << close window;
obj = Control Chart( Sample Size( Eval( samplesz ) ), KSigma( 3 ), Chart Col( :weight, XBar, R ) );
obj << close window;
Eval( Eval Expr( obj = Control Chart( Sample Size( Expr( samplesz ) ), KSigma( 3 ), Chart Col( :weight, XBar, R ) ) ) );
obj << close window;
Eval(
Substitute( Expr( obj = Control Chart( Sample Size( samp ), KSigma( 3 ), Chart Col( :weight, XBar, R ) ) ), Expr( samp ), samplesz )
);
obj << close window;
Eval( Parse( "obj = Control Chart( Sample Size( " || Char( samplesz ) || " ), KSigma( 3 ), Chart Col( :weight, XBar, R ) );" ) );
obj << close window;
Code Explanation:
- Define relative epsilon.
- Open data table;
- Set sample size to 6.
- Create control chart with XBar and R.
- Close the control chart window.
- Re-create control chart with evaluated sample size.
- Close the control chart window.
- Use Eval to create control chart with expression.
- Close the control chart window.
- Substitute sample size in expression and create control chart.
- Close the control chart window.
- Parse and evaluate string to create control chart.
- Close the control chart window.
Example 24
Summary: Creates a control chart for quality monitoring, specifying sample size, K Sigma level, and chart column, with report generation.
Code:
dt = Open("data_table.jmp");
cc = Control Chart( Sample Size( :Sample ), KSigma( 3 ), Chart Col( :Weight, Median Moving Range on Group Std Devs ) );
rpt = cc << report;
Code Explanation:
- Open data table.
- Create control chart.
- Set sample size column.
- Define K Sigma level.
- Specify chart column and type.
- Generate report object.
Control Chart using For
Summary: Creates a new window with two control charts, displaying height and weight measurements by sex, using data from an open JMP data table.
Code:
For( i = 1, i <= 10, i++,
dt = Open("data_table.jmp");
win_temp = New Window( "test",
o = Outline Box( "test",
Lineup Box( N Col( 2 ), spacing( 0 ),
Control Chart( Group Size( 1 ), KSigma( 3 ), Chart Col( :height, Individual Measurement, Moving Range ), By( :sex ) ),
Control Chart( Group Size( 1 ), KSigma( 3 ), Chart Col( :weight, Individual Measurement, Moving Range ), By( :sex ) )
)
)
);
dt << Subscribe( "myname", On Close( win_temp << close window ) );
Close( dt );
);
Code Explanation:
- Loop 10 times.
- Open data table.
- Create new window named "test".
- Add outline box titled "test".
- Arrange two control charts side by side.
- First chart: height, individual measurement, moving range, by sex.
- Second chart: weight, individual measurement, moving range, by sex.
- Subscribe to data table close event.
- Close data table.
- Repeat loop.
Control Chart using Index
Summary: Creates an XBar control chart with Test 4 enabled, and performs data manipulation tasks such as row deletion and random sampling.
Code:
dt = Open("data_table.jmp");
dt << delete rows( Index( 85, 132 ) );
obj = dt << Control Chart( Sample Size( 6 ), KSigma( 3 ), Chart Col( :DIAMETER ), Chart Type( XBar ) );
obj << Test 4( 1 );
Random Reset( 123456789 );
dt << Select Randomly( 0.1 ) << Delete Rows();
rpt = obj << report;
Code Explanation:
- Open data table;
- Delete rows 85-132.
- Create XBar control chart.
- Enable Test 4.
- Set random seed.
- Randomly select 10% rows.
- Delete selected rows.
- Generate report.