spc {qAnalyst}R Documentation

Function to create spc object

Description

spc function creates spc class objects from data. Generic methods plot, print, summary are avaiable for SPC class objects.

Usage

spc(x, sg, type = "xbar", name = deparse(substitute(x)), testType = 1, k = NA, p = NA, nSigma = NA)

Arguments

x

data vector

sg

Subgroup variable. This argument has a different meaning according to chart type.

xbar, r and s charts: sg represents rational sub-group of observations. It can be specified either as a vector, of the same length of x of ordered subgroup id, or as a constant value that will be replicated along x. Subgroup dimension must be greather than one.

i and mr charts: sg represents the width of the window over which moving range are computed. Must be a scalar. Default value is set to two.

p, np and u charts: sg represents sample size of observation. It can be specified either as a vector, of the same length of x or as a constant value that will be replicated along x.

c chart: sg is not required

type

Chart type. String identifying chart type. Charts can be of type: "xbar", "r", "s", "i", "mr", "p", "np", "u", "c".

name

Name of x variable as it appears in the charts. By default the name of the given x variable

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

A vector or a scalar of parameters to be used by tests. If k is not specified, tests are performed with k default values. If k is specified, its length must be of the same length as testType.

p

A vector or a scalar of parameters to be used by tests. If p is not specified, tests are performed with p default values. If p is specified, its length must be of the same length as testType.

nSigma

A vector or a scalar of parameters to be used by tests. If nSigma is not specified, tests are performed with nSigma default values. If nSigma is specified, its length must be of the same length as testType.

Details

spc function performs coherence tests on subgroups dimension and chart name. Then it calculates graphical parameters, statistics values and test results and stores this values in lists.

Value

An object of class spc

Note

No notes

Author(s)

Andrea Spano'

References

Montgomery, Statistical Quality Control

See Also

plot.spc, print.spc

Examples


#i-chart, moving range to estimate st. dev. is equal to 2 points with testType=1, 
data(rawWeight)
ichart=spc(x=rawWeight$rawWeight, sg=2, type="i", name="weight", testType=1)
plot(ichart)
summary(ichart)


[Package qAnalyst version 0.6.0 Index]