testFun {qAnalyst}R Documentation

Internal function to perform control chart tests

Description

testFun executes control charts test.

Usage

testFun(x, sg, type, testType, k, p, nSigma)

Arguments

x input data vector.
sg subgroups id, vector or integer.
type string denoting chart type.
testType A vector or a scalar of test codes to be performed. Eight tests are implemented corrensponding to codes 1-8. Default performed test is 1.

test 1: k points out of p points beyond nSigma*sd from center line. Default values are k=1 p=1 nSigma=3

test 2: k points out of p points in a row on same side of center line. Default values are: k=9 p=9

test 3: k points out of p points in a row either all increasing or decreasing. Default values: k=6 p=6

test 4: k points out of p points in a row alternating up and down. Default values: k= 14 p=14

test 5: k points out of p points in a row beyond nSigma*sd from center line. Default values are: k=2 p=3 nSigma = 3

test 6: k points out of p points in a row beyond nSigma*sd from center line (one side of center line). Default values: k=4 p = 5 nSigma=2

test 7: k points out of p points in a row within nSigma*sd (both sides of centre line). Default values are: k = 15 p=15 nSigma=1

test 8: k points out of p points in a row beyond nSigma*sd (both sides of central line). Default values are k=8 p = 8 nSigma=1

k Parameter specific for the test. It is compulsory to be specified as a vector of length equal to length(testType). See details
p Parameter specific for the test. it is compulsory to be specified as a vector of length equal to length(testType). See details
nSigma standard deviation of confidence line, required in some test.

Value

A binary vector whose dimension is equal to the points plotted on the control chart is returned. A value of 1 means that the i-th point failed the performed test, a value of 0 means that the i-th points did not failed the performed test.

Note

This function is for internal use.

Author(s)

Andrea Spano'

References

Montgomery, Statistical Quality Control.

See Also

spc

Examples

#example of test 3
x=c(1,0,3,2,3,5,6,8,7,6)
sg=2
#i chart used for simplicity
outTest=testFun(x=x,type="i",sg=sg, testType=3,k=4,p=4,nSigma=3)
print(outTest)
# 0 0 0 0 0 0 1 1 0 0 ok

[Package qAnalyst version 0.6.0 Index]