Calculation STATBEANS®

 

STATBEAN Name: ControlCharts

 

Control Charts Software Purpose: Calculates various types of statistical control charts for both variables and attributes. In some cases, both a location control chart (such as an X-bar chart) and a dispersion control chart (such as an R chart) are created. In other cases, only a single chart is created (such as a P chart). Allows Statgraphics to function as control charts software.

DataSource For Statistical Control Charts: any. 


Control Charts Software Read/Write Properties
Name Type Description Possible Values Default Value
chartMode String Method for calculating control limits. "Initial Study",
"Control to Standard",
"User Specified Limits"
"Initial Study"
chartType String Type of control chart to create. "X-bar and R",
"X-bar and S",
"X-bar and S-squared",
"X and MR(2)",
"P",
"NP",
"C"
"U"
"X-bar and R"
dataType String Format of the input data. "Observations",
"Subgroup Statistics"
"Observations"
flagRunsAlternating boolean Whether to flag unusual runs alternating beyond the outer warning limits. true,false true
flagRunsAboveAndBelow boolean Whether to flag unusual runs above or below the centerline. true,false true
flagRunsBeyondInner boolean Whether to flag unusual runs beyond the inner warning limits. true,false true
flagRunsBeyondOuter boolean Whether to flag unusual runs beyond the outer warning limits. true,false true
flagRunsUpAndDown boolean Whether to flag unusual runs up or down. true,false true
flagRunsWithinInner boolean Whether to flag unusual runs within the inner warning limits. true,false true
includeLowerLimitChart1 boolean Whether to include a lower control limit. true,false true
includeLowerLimitChart2 boolean Whether to include a lower control limit. true,false true
includeUpperLimitChart1 boolean Whether to include an upper control limit. true,false true
includeUpperLimitChart2 boolean Whether to include an upper control limit. true,false true
innerWarningLimitsMultiple double Number of standard errors to place inner warning limits at. > 0 1.0
lowerSpecificationLimit double Location of lower specification limit, if any. Any double value. none
nominal double Location of nominal or target value, if any. Any double value. none
normalizeChart boolean Whether to chart Z scores rather than sample statistics. true,false false
outerWarningLimitsMultiple double Number of standard errors to place outer warning limits at. > 0 2.0
recalculateAtPosition1 int Subgroup number to recalculate control limits at if Initial Study. 0+ 0
recalculateAtPosition2 int Subgroup number to recalculate control limits at if Initial Study. 0+ 0
recalculateAtPosition3 int Subgroup number to recalculate control limits at if Initial Study. 0+ 0
recalculateAtPosition4 int Subgroup number to recalculate control limits at if Initial Study. 0+ 0
sigmaMultiple double Number of standard errors to place control limits at. > 0 3.0
standardMean double Process mean if Control to Standard. Any double value. 0.0
standardSigma double Process standard deviation if Control to Standard. Any double value > 0. 1.0
subgroupMeanVariableName String The name of the column containing group means if Subgroup Statistics. Any string. "X"
subgroupSize int Sample size if same for all subgroups. 1+ 1
subgroupSizeVariableName String The name of the column containing group indicators if unequal subgroup sizes. Any string. "X"
subgroupSpreadVariableName String The name of the column containing group ranges, standard deviations, or variances if Subgroup Statistics. Any string. "X"
upperSpecificationLimit double Location of upper specification limit, if any. Any double value. none
useAverageSubgroupSize boolean Whether to calculate control limits using average subgroup size. true,false true
userCenterlineChart1 double Centerline for location chart if User Specified Limits. Any double value. 0.0
userCenterlineChart2 double Centerline for dispersion chart if User Specified Limits. > 0. 1.0
userLCLChart1 double Lower control limit for location chart if User Specified Limits. < centerline. -1.0
userLCLChart2 double Lower control limit for dispersion chart if User Specified Limits. >=0 and < centerline. 0.0
userUCLChart1 double Upper control limit for location chart if User Specified Limits. > centerline. 1.0
userUCLChart2 double Upper control limit for dispersion chart if User Specified Limits. > centerline. 2.0
unusualRunLength int The run size to be flagged on runs up or down and runs above or below. 2+ 8
xVariableName String The name of the column with data if Observations. Any string. "X"

Added January, 2019

Name Type Description Possible Values Default Value
identifierVariableName String The name of the column identifying location of each observation on the X axis. Any string. ""


Other Public Methods For Statistical Control Charts

Name Description Arguments Return Value
double getAverageSubgroupSize() Returns the average number of data values in a subgroup. None. Average size.
int getBeyondLimitsChart1(int section) Returns the number of points beyond the control limits. Section number (0-4). Number of points.
int getBeyondLimitsChart2(int section) Returns the number of points beyond the control limits. Section number (0-4). Number of points.
double getCenterlineChart1(int section) Returns the center line of the first chart. Section number (0-4). Centerline.
double getCenterlineChart2(int section) Returns the center line of the second chart. Section number (0-4). Centerline.
double getCp(int section) Returns the estimated capability index. Section number (0-4). Capability index.
double getCpk(int section) Returns the estimated capability index. Section number (0-4). Capability index.
double getCpkLower(int section) Returns the estimated capability index. Section number (0-4). Capability index.
double getCpkUpper(int section) Returns the estimated capability index. Section number (0-4). Capability index.
double getCpm(int section) Returns the estimated capability index. Section number (0-4). Capability index.
double getCr(int section) Returns the estimated capability index. Section number (0-4). Capability index.
void getDataChart1(double xbar[n]) Returns the data plotted on the first chart. Double output array. Mean values.
void getDataChart2(double r[n]) Returns the data plotted on the second chart. Double output array. Range or sigma values.
double getK(int section) Returns the estimated capability index. Section number (0-4). Capability index.
double getLCLChart1(int section) Returns the lower control limit of the first chart. Section number (0-4). LCL.
double getLCLChart2(int section) Returns the lower control limit of the second chart. Section number (0-4). LCL.
int getNumberOfSections() Returns the number of sections in the charts for which separate limits were calculated. None. Number of sections.
int getNumberOfSubgroups() Returns the number of subgroups with data. None. Number of subgroups.
double getPp(int section) Returns the estimated capability index. Section number (0-4). Capability index.
double getPpk(int section) Returns the estimated capability index. Section number (0-4). Capability index.
double getPpkLower(int section) Returns the estimated capability index. Section number (0-4). Capability index.
double getPpkUpper(int section) Returns the estimated capability index. Section number (0-4). Capability index.
double getPr(int section) Returns the estimated capability index. Section number (0-4). Capability index.
double getProcessMean(int section) Returns the estimated process mean. Section number (0-4). Mean.
double getProcessSigma(int section) Returns the estimated process standard deviation. Section number (0-4). Sigma.
double getUCLChart1(int section) Returns the upper control limit of the first chart. Section number (0-4). UCL.
double getUCLChart2(int section) Returns the upper control limit of the second chart. Section number (0-4). UCL.
int getUnusualRunsChart1(int section) Returns the number of points identified as unusual runs. Section number (0-4). Number of points.
int getUnusualRunsChart2(int section) Returns the number of points identified as unusual runs. Section number (0-4). Number of points.

Control Charts Software Output Variables
Name Description
Chart1Data The data values for the location control chart.
Chart2Data The data values for the dispersion control chart, if any.

Control Charts Software Code Sample 

//create a datasource bean 
FileDataSource fileDataSource1 = new STATBEANS.FileDataSource(); 

//set the file name to be read 
fileDataSource1.setFileName("c:\\statbeans\\samples\\spc.txt"); 

//create a calculation bean 
ControlCharts controlCharts1 = new STATBEANS.ControlCharts(); 

//set the chart type 
controlCharts1.setChartType("X-bar and R"); 

//set the name of the column containing the data 
controlCharts1.setXVariableName("strength"); 

//set the subgroup size (if not 1) 
controlCharts1.setSubgroupSize(5); 

//set specification limits 
controlCharts1.setUpperSpecificationLimit(300.0); 
controlCharts1.setNominal(250.0); 
controlCharts1.setLowerSpecificationLimit(200.0); 

//create a table bean with 19 rows 
ControlChartsTable controlChartsTable1 = new STATBEANS.ControlChartsTable(); 
controlChartsTable1.setNumberOfRowsInDisplay(19); 

//set the number of decimal places for displaying the limits 
controlChartsTable1.setDecimalPlaces(2); 

//create 2 plot beans 
ControlChartsPlot controlChartsPlot1 = new STATBEANS.ControlChartsPlot(); 
ControlChartsPlot controlChartsPlot2 = new STATBEANS.ControlChartsPlot(); 

//turn off the legends 
controlChartsPlot1.setDisplayLimitValues(false); 
controlChartsPlot2.setDisplayLimitValues(false); 

//set the chart numbers for each plot 
controlChartsPlot1.setChartNumber(0); 
controlChartsPlot2.setChartNumber(1); 

//ask for warning limits on the first chart 
controlChartsPlot1.setShowOuterWarningLimits(true); 
controlChartsPlot1.setShowInnerWarningLimits(true); 

//add a smoother to the second chart 
controlChartsPlot2.setSmootherType("EWMA"); 

//make the calculation bean a listener for changes in the FileDataSource bean 
fileDataSource1.addDataChangeListener(controlCharts1.listenerForDataChange); 

//make the table and plot beans listeners for changes in the calculation bean 
controlCharts1.addDataChangeListener(controlChartsTable1.listenerForDataChange); 
controlCharts1.addDataChangeListener(controlChartsPlot1.listenerForDataChange); 
controlCharts1.addDataChangeListener(controlChartsPlot2.listenerForDataChange); 

//instruct the fileDataSource bean to read the file 
fileDataSource1.readData();