# cg: Function to calculate and visualize the gage capability. In qualityTools: Statistical Methods for Quality Science

## Description

Function visualize the given values of measurement in a run chart and in a histogram. Furthermore the “centralized Gage potential index” Cg and the “non-centralized Gage Capability index” Cgk are calculated and displayed.

## Usage

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13``` ```cg (x, target, tolerance, ref.interval, facCg, facCgk, n = 0.2, type, col, pch, xlim, ylim, conf.level = 0.95, cex.val = 1.5) cgToleranceView(x, target, tolerance, ref.interval, facCg, facCgk, n = 0.2, type, col, pch, xlim, ylim, main, conf.level = 0.95, cex.val = 1, cgOut = TRUE) cgHist (x, target, tolerance, ref.interval, facCg, facCgk, n = 0.2, col, xlim, ylim, main, conf.level = 0.95, cex.val = 1, cgOut = TRUE) cgRunChart (x, target, tolerance, ref.interval, facCg, facCgk, n = 0.2, type, col, pch, xlim, ylim,main, conf.level = 0.95, cex.val = 1, cgOut = TRUE) ```

## Arguments

 `x` a vector containing the measured values. `target` a numeric value giving the expected target value for the x-values. `tolerance` vector of length 2 giving the lower and upper specification limits. `ref.interval` numeric value giving the confidence intervall on which the calculation is based. By default it is based on 6 sigma methodology. Regarding the normal distribution this relates to `pnorm(3) - pnorm(-3`) which is exactly 99.73002 percent If the calculation is based on an other sigma value `ref.interval` needs to be adjusted. To give an example: If the sigma-level is given by 5.15 the `ref.interval` relates to `pnorm(5.15/2)-pnorm(-5.15/2)` which is exactly 0.989976 percent. `facCg` numeric value as a factor for the calculation of the gage potential index. The default Value for facCg is ‘0.2’. `facCgk` numeric value as a factor for the calulation of the gage capability index. The default value for facCgk is ‘0.1’. `n` numeric value between ‘0’ and ‘1’ giving the percentage of the tolerance field (values between the upper and lower specification limits given by tolerance) where the values of x should be positioned. Limit lines will be drawn. Default value is ‘0.2’. `type` what type of plot should be drawn in the run chart. Possible types see `plot`. `col` color of the curve in the run chart. `pch` variable specifies the symbols of the run chart. Details see `par`. `xlim` vector of length 2 giving the limits for the x axis of the run chart. `ylim` vector of length 2 giving the limits for the y axis of the run chart. `main` an overall title for the plot: see `title`. `conf.level` confidence level for internal t.test checking the significance of the bias between target and mean of x. The default value is ‘0.95’. The result of the t.test is shown in the histogram on the left side. `cex.val` numeric value giving the size of the text in the legend. See also `par`. `cgOut` logical value deciding wether the Cg and Cgk values should be plotted in a legend. Only available for the function `cgHist`, `cgToleranceView` and `cgRunChart`. The default value for cgOut is ‘TRUE’.

## Details

The calculation of the potential and actual gage capability are based on the following formulae:

• Cg = (facCg * tolerance-tolerance)/ref.interval

• Cgk = (facCgk * abs(target-mean(x))/(ref.interval/2)

If the usage of the historical process variation is preferred the values for the tolerance `tolerance` must be adjusted manually. That means in case of the 6 sigma methodolgy for example, that tolerance = 6 * sigma[process].

## Value

Function returns a list of numeric values. The first element contains the calculated centralized gage potential index Cg and the second contains the non-centralized gage capability index Cgk.

## Note

Support for other distributions than normal might be included later in an update.
For a more detailed example which shows the usage `cg()` please read the vignette for the package `qualityTools` at http://www.r-qualitytools.org/html/Measure.html.

## Author(s)

Thomas Roth: [email protected]
Etienne Stockhausen: [email protected]

## References

• DIETRICH, Edgar; SCHULZE, Alfred: Pruefprozesseignung, 3rd ed. Munich: Carl Hanser, 2007.

• DIETRICH, Edgar et al: Eignungsnachweis von Messsystemen, 3rd ed. Munich: Carl Hanser, 2008.

`gageLin`
`gageRR`
`plot`
`par`
http://www.r-qualitytools.org/html/Measure.html

## Examples

 ```1 2 3 4 5 6 7``` ``` #simple example with default values cg(rnorm(125,mean = 10.01 ,sd = 0.1), target = 10, tolerance = c(8,12)) #example with larger n and adjusted ref. interval cg(rnorm(25,mean = 1.01 ,sd = 0.5), ref.interval=pnorm(5.5/2)-pnorm(-5.5/2), n=0.3) #example with changed factors for Cg and Cgk cg(rnorm(75, sd = 0.1), facCg = 0.15, facCgk = 0.075, tolerance = c(-10,10)/6) ```

qualityTools documentation built on May 30, 2017, 1:43 a.m.