Example 1: Deriving and Examining a Sampling Plan
Ribbon bar. Selecting the Home tab. In the File group, click the Open arrow and select Open Examples to display the Open a Statistica Data File dialog box. The data file is located in the Datasets folder.
Classic menus. On the File menu, select Open Examples to display the Open a Statistica Data File dialog box. The data file is located in the Datasets folder.
Variable 1 (Sample_1) was produced as a normal random variable with a mean of 74 and a sigma of .01; variable 2 (Sample_2) was produced as a normal random variable with a mean of 74.005 and a sigma of .01; variable 3 (Sample_3) was produced as a normal random variable with a mean of 74 and a sigma of .05.
Select Sampling plans for means, proportions, & Poisson frequencies.
Click the OK button to display the Sampling Plans dialog box, in which you can specify the parameters that will determine the sample sizes. First, select the Advanced tab.
Specifying H0, H1, and the test criterion. As discussed in the Introductory Overview, in order to estimate sample sizes, you need to specify the size of the difference that you want to detect. The mean under H0 refers to the target specification; thus, enter 74 into the Hypothesized mean for H0 (hypothesis/spec) box. The mean under H1 is the one that you want to detect.
Remember that the process shift that you want to protect against is 0.005 millimeters. Because you want to detect both upward shifts of this magnitude and downward shifts, specify a Two tailed test criterion (the default) in the Test criterion list. In the case of a two-tailed test, it does not matter whether you enter as the mean under H1 74 - .005 = 73.995 or 74 + .005 = 74.005; thus, enter 74.005 as the Hypothesized mean for H1 (alternative hyp.).
If you were mostly concerned about upward shifts in the process, you would set the Test criterion box to One-sided (right) test; in that case, the mean for H1 must be greater than the mean for H0; if you were mostly concerned about downward shifts, you would set the Test criterion box to One-sided (left) test, and enter a mean for H1 that is smaller than H0.
The beta error probability is the probability of erroneously accepting the process, that is, declaring that no mean shift has occurred, when in fact it has (of the magnitude specified by the H1 mean).
The default parameters for these values are adequate, therefore, the Sampling Plans dialog box will now look like this.
The results for a fixed sampling plan will be reviewed first. As you can see, the sample size that would be required given the previous specifications is equal to 43 (see the number beside the Sample size button). You can review the details of the fixed sampling plan in a spreadsheet by clicking the Summary: Results for fixed sampling plan button.
In addition to the previously selected specifications, the spreadsheet also shows the lower and upper confidence limits for H0. Thus, if the average piston ring size would fall below 73.997 or above 74.003 in a sample of size 43, you would say that a process shift has occurred.
The OC curve shows the power of the fixed sampling plan (see Process Analysis Sampling Plans - Fixed Sampling Plans); that is, this plot shows how likely it is that a shift to the values indicated on the x-axis will be detected, given the current size, or for some alternative sample size.
For example, try a sample size of 20. In the Results dialog box, click the Sample size button and enter 20 in the Specify Sample Size dialog box.
When you click the OK button in this dialog box, the Resultant b (beta) for that value will be displayed in the Results dialog as .39. Thus, lowering the sample size to 20 would greatly increase the likelihood that you would miss a process mean shift by .005 mm (and erroneously accept H0).
As mentioned earlier, this variable was actually created as a random normal variable with a mean of 74 and a standard deviation of .01. However, for this example, assume that these data are actual data for 100 piston rings that you sequentially selected from the production process.
The above spreadsheet displays samples 15 through 28. As you can see, at sample 21, the Recommended Action shown in the last column is to accept the process.
The spreadsheet above also shows the acceptance and rejection limits for a right- or left-shift of the process mean. These can best be visualized in a plot.
If the cumulative sum of deviations from specification steps outside either corridor to the inside, that is, toward the center line, you accept the process as being in control. At that point you would stop sampling additional piston rings. As you already saw in the spreadsheet, this happens at around sample number 21, and you could have stopped sampling there.
Shown below is the plot for variable 2 (Sample_2) which, as you may remember, was actually generated as a normal random variable with a mean of 74.005 and a standard deviation of .001. Assume that this sample is from a "bad" batch. Only the first 50 samples (piston rings selected from the production process) have been plotted in this chart. (To produce this plot, click the Variable containing data following current plan button and select Sample_2. Then enter 50 into the Sampling plan for sample sizes 1 through box and click the Plot equivalent sequential sampling plan button.)
As you can see, the line steps above the upper rejection limit at about sample number 37. At that point you would reject the sample and declare that the process mean has shifted by at least .005 millimeters.
Such empty sampling plans can be printed and then completed by hand as the engineer sequentially inspects randomly chosen units from the batch or lot.
With the Process Analysis module, you can generate and analyze sampling plans for normal means (as in this example), as well as proportions (e.g., proportion of units within specification limits) and Poisson frequencies (e.g., number of defects per batch).