Function visualize the given values of measurement in a Tolerance View.
cg_ToleranceChart(
  x,
  target,
  tolerance,
  ref.interval,
  facCg,
  facCgk,
  n = 0.2,
  col,
  pch,
  xlim,
  ylim,
  main,
  conf.level = 0.95,
  cgOut = TRUE
)The function cg_ToleranceChart 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.
A vector containing the measured values.
A numeric value giving the expected target value for the x-values.
Vector of length 2 giving the lower and upper specification limits.
Numeric value giving the confidence interval 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 another 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.
Numeric value as a factor for the calculation of the gage potential index. The default value for facCg is 0.2.
Numeric value as a factor for the calculation of the gage capability index. The default value for facCgk is 0.1.
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.
Character or numeric value specifying the color of the line and points in the tolerance view. Default is `black`.
Numeric or character specifying the plotting symbol. Default is 19 (filled circle).
Numeric vector of length 2 specifying the limits for the x-axis. Default is NULL which means the limits are set automatically.
Numeric vector of length 2 specifying the limits for the y-axis. Default is NULL which means the limits are set automatically.
Character string specifying the title of the plot. Default is `Tolerance View`.
Confidence level for internal t.test checking the significance of the bias between target and mean of x. The default value is 0.95.
Logical value deciding whether the Cg and Cgk values should be plotted in a legend. Default is TRUE.
The calculation of the potential and actual gage capability are based on the following formulae:
Cg = (facCg * tolerance[2]-tolerance[1])/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 methodology for example, that tolerance = 6 * sigma[process].
cg_RunChart, cg_HistChart,  cg
x <- c(9.991, 10.013, 10.001, 10.007, 10.010, 10.013, 10.008,9.992,
       10.017, 10.005, 10.005, 10.002, 10.017, 10.005, 10.002, 9.996,
       10.011, 10.009, 10.006, 10.008, 10.003, 10.002, 10.006, 10.010, 10.013)
cg_ToleranceChart(x = x, target = 10.003, tolerance = c(9.903, 10.103))
Run the code above in your browser using DataLab