| Title: | Calculate Gauge Repeatability and Reproducibility |
|---|---|
| Description: | Procedures for calculating variance components, study variation, percent study variation, and percent tolerance for gauge repeatability and reproducibility study. Methods included are ANOVA and Average / Range methods. Requires balanced study. |
| Authors: | Jonah Warren [aut, cre] |
| Maintainer: | Jonah Warren <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.1.0 |
| Built: | 2026-05-11 07:30:08 UTC |
| Source: | https://github.com/cran/gageRR |
ANOVA Table Calculation
anova_table(data, part, operator, meas)anova_table(data, part, operator, meas)
data |
An R dataframe or tibble. |
part |
A column in data specifying the unique ID of the part being measured |
operator |
A column in data specifying the operator for the recorded measurement |
meas |
A column in data where the measurement value is recorded. |
An anova table of meas ~ operator x part
data = data.frame( SN = c( 'SerialNumber_01', 'SerialNumber_01', 'SerialNumber_02', 'SerialNumber_02', 'SerialNumber_01', 'SerialNumber_01', 'SerialNumber_02', 'SerialNumber_02'), Operator = c( 'Operator_01', 'Operator_01', 'Operator_01', 'Operator_01', 'Operator_02', 'Operator_02', 'Operator_02', 'Operator_02'), Measure = c( 0.0172, 0.0177, 0.0155, 0.0159, 0.0174, 0.0181, 0.0152, 0.0176)) anova_table(data, part = 'SN', operator = 'Operator', meas = 'Measure')data = data.frame( SN = c( 'SerialNumber_01', 'SerialNumber_01', 'SerialNumber_02', 'SerialNumber_02', 'SerialNumber_01', 'SerialNumber_01', 'SerialNumber_02', 'SerialNumber_02'), Operator = c( 'Operator_01', 'Operator_01', 'Operator_01', 'Operator_01', 'Operator_02', 'Operator_02', 'Operator_02', 'Operator_02'), Measure = c( 0.0172, 0.0177, 0.0155, 0.0159, 0.0174, 0.0181, 0.0152, 0.0176)) anova_table(data, part = 'SN', operator = 'Operator', meas = 'Measure')
ANOVA Variance Component Calculations
anova_var_calcs(data, part, operator, meas)anova_var_calcs(data, part, operator, meas)
data |
An R dataframe or tibble. |
part |
A column in data specifying the unique ID of the part being measured |
operator |
A column in data specifying the operator for the recorded measurement |
meas |
A column in data where the measurement value is recorded. |
A list of numeric values for repeatability, reproducibility, total GRR, part-to-part, and total variance components.
data = data.frame( SN = c( 'SerialNumber_01', 'SerialNumber_01', 'SerialNumber_02', 'SerialNumber_02', 'SerialNumber_01', 'SerialNumber_01', 'SerialNumber_02', 'SerialNumber_02'), Operator = c( 'Operator_01', 'Operator_01', 'Operator_01', 'Operator_01', 'Operator_02', 'Operator_02', 'Operator_02', 'Operator_02'), Measure = c( 0.0172, 0.0177, 0.0155, 0.0159, 0.0174, 0.0181, 0.0152, 0.0176)) anova_var_calcs(data, part = 'SN', operator = 'Operator', meas = 'Measure')data = data.frame( SN = c( 'SerialNumber_01', 'SerialNumber_01', 'SerialNumber_02', 'SerialNumber_02', 'SerialNumber_01', 'SerialNumber_01', 'SerialNumber_02', 'SerialNumber_02'), Operator = c( 'Operator_01', 'Operator_01', 'Operator_01', 'Operator_01', 'Operator_02', 'Operator_02', 'Operator_02', 'Operator_02'), Measure = c( 0.0172, 0.0177, 0.0155, 0.0159, 0.0174, 0.0181, 0.0152, 0.0176)) anova_var_calcs(data, part = 'SN', operator = 'Operator', meas = 'Measure')
Functions to calculate the constant (expected range of a normal subgroup),
the chi-square bias correction factor , and a Minitab-style adjusted
that incorporates the number of subgroups.
d2_integral(m, rel.tol = .Machine$double.eps^0.5) c4(n) d2_minitab_df(m, g)d2_integral(m, rel.tol = .Machine$double.eps^0.5) c4(n) d2_minitab_df(m, g)
m |
Integer. Subgroup size (must be |
rel.tol |
Relative tolerance for integration (passed to |
n |
Integer. Degrees of freedom argument for |
g |
Integer. Number of subgroups (must be |
d2_integral(m) computes the exact by numerical integration.
c4(n) computes the chi-square bias correction factor .
d2_minitab_df(m, g) computes a finite-sample adjusted constant
, with
degrees of freedom, consistent with Minitab/AIAG tables.
d2_integral() returns a numeric scalar (expected range for subgroup size m).
c4() returns a numeric scalar (bias correction factor).
d2_minitab_df() returns a numeric scalar (adjusted constant).
# Exact d2 for subgroup size 5 d2_integral(5) # Chi-square bias correction for df = 8 c4(8) # Minitab-style adjusted constant for m = 5, g = 2 d2_minitab_df(5, 2)# Exact d2 for subgroup size 5 d2_integral(5) # Chi-square bias correction for df = 8 c4(8) # Minitab-style adjusted constant for m = 5, g = 2 d2_minitab_df(5, 2)
A collection of sample data to analyze for reproducibility and repeatability measurement error.
datadata
dataA data frame with 27 rows and 3 columns:
Serial Number
Operator or Measurement Technician
Measured Value
...
Gage R&R Evaluation
grr_calc(data, part, operator, meas, LSL = NULL, USL = NULL, method = "anova")grr_calc(data, part, operator, meas, LSL = NULL, USL = NULL, method = "anova")
data |
An R dataframe or tibble containing the required identifier and measurement columns. |
part |
A string giving the column name specifying the unique ID of the part being measured. The column should be a character or factor. |
operator |
A string giving the column name specifying the operator for the recorded measurement. The column should be a character or factor. |
meas |
A string giving the column name where the measurement value is recorded. The column must be numeric and contain no missing or infinite values. |
LSL |
A number specifying the lower specification limit. |
USL |
A number specifying the upper specification limit. |
method |
A string specifying "anova" or "xbar_r". |
A list containing:
VarianceComponents: Data frame of variance components and percent contribution
GageEval: Data frame of study variation metrics
AnovaTable: ANOVA table (if method = "anova")
data <- data.frame( SN = rep(c("SerialNumber_01","SerialNumber_02"), each = 4), Operator = rep(c("Operator_01","Operator_02"), each = 2, times = 2), Measure = c(0.0172,0.0177,0.0155,0.0159,0.0174,0.0181,0.0152,0.0176) ) grr_calc(data, part = "SN", operator = "Operator", meas = "Measure", LSL = 0, USL = 0.040, method = "xbar_r")data <- data.frame( SN = rep(c("SerialNumber_01","SerialNumber_02"), each = 4), Operator = rep(c("Operator_01","Operator_02"), each = 2, times = 2), Measure = c(0.0172,0.0177,0.0155,0.0159,0.0174,0.0181,0.0152,0.0176) ) grr_calc(data, part = "SN", operator = "Operator", meas = "Measure", LSL = 0, USL = 0.040, method = "xbar_r")
Average and Range Method Part-to-Part Variance Calculation
part_to_part(data, part, meas)part_to_part(data, part, meas)
data |
An R dataframe or tibble containing the required identifier and measurement columns. |
part |
Column name (unquoted) specifying the unique ID of the part being measured. The column should be a character or factor vector. |
meas |
Column name (unquoted) where the measurement value is recorded. The column must be numeric and contain no missing or infinite values. |
A number. The measure of part-to-part variation for the given data.
data <- data.frame( SN = rep(c("SerialNumber_01","SerialNumber_02"), each = 4), Operator = rep(c("Operator_01","Operator_02"), each = 2, times = 2), Measure = c(0.0172,0.0177,0.0155,0.0159,0.0174,0.0181,0.0152,0.0176) ) part_to_part(data, part = 'SN', meas = 'Measure')data <- data.frame( SN = rep(c("SerialNumber_01","SerialNumber_02"), each = 4), Operator = rep(c("Operator_01","Operator_02"), each = 2, times = 2), Measure = c(0.0172,0.0177,0.0155,0.0159,0.0174,0.0181,0.0152,0.0176) ) part_to_part(data, part = 'SN', meas = 'Measure')
ANOVA Sum of Squares Calculations
ss_calcs(data, part, operator, meas)ss_calcs(data, part, operator, meas)
data |
An R dataframe or tibble containing the required identifier and measurement columns. |
part |
A column in data specifying the unique ID of the part being measured. The column should be a character or factor vector. |
operator |
A column in data specifying the operator for the recorded measurement. The column should be a character or factor vector. |
meas |
A column in data where the measurement value is recorded. The column must be numeric and contain no missing or infinite values. |
A list of numeric values for the sum of squares error for operator, part, equipment, operator and part interaction, and total error.
data = data.frame( SN = c( 'SerialNumber_01', 'SerialNumber_01', 'SerialNumber_02', 'SerialNumber_02', 'SerialNumber_01', 'SerialNumber_01', 'SerialNumber_02', 'SerialNumber_02'), Operator = c( 'Operator_01', 'Operator_01', 'Operator_01', 'Operator_01', 'Operator_02', 'Operator_02', 'Operator_02', 'Operator_02'), Measure = c( 0.0172, 0.0177, 0.0155, 0.0159, 0.0174, 0.0181, 0.0152, 0.0176)) ss_calcs(data, part = 'SN', operator = 'Operator', meas = 'Measure')data = data.frame( SN = c( 'SerialNumber_01', 'SerialNumber_01', 'SerialNumber_02', 'SerialNumber_02', 'SerialNumber_01', 'SerialNumber_01', 'SerialNumber_02', 'SerialNumber_02'), Operator = c( 'Operator_01', 'Operator_01', 'Operator_01', 'Operator_01', 'Operator_02', 'Operator_02', 'Operator_02', 'Operator_02'), Measure = c( 0.0172, 0.0177, 0.0155, 0.0159, 0.0174, 0.0181, 0.0152, 0.0176)) ss_calcs(data, part = 'SN', operator = 'Operator', meas = 'Measure')
Average and Range Method Repeatability Calculation
xbar_repeat(data, part, operator, meas)xbar_repeat(data, part, operator, meas)
data |
An R dataframe or tibble containing the required identifier and measurement columns. |
part |
Column name (unquoted) specifying the unique ID of the part being measured. The column should be a character or factor vector. |
operator |
Column name (unquoted) specifying the operator for the recorded measurement. The column should be a character or factor vector. |
meas |
Column name (unquoted) where the measurement value is recorded. The column must be numeric and contain no missing or infinite values. |
A number. The measure of repeatability for the given data.
data <- data.frame( SN = rep(c("SerialNumber_01","SerialNumber_02"), each = 4), Operator = rep(c("Operator_01","Operator_02"), each = 2, times = 2), Measure = c(0.0172,0.0177,0.0155,0.0159,0.0174,0.0181,0.0152,0.0176) ) xbar_repeat(data, part = 'SN', operator = 'Operator', meas = 'Measure')data <- data.frame( SN = rep(c("SerialNumber_01","SerialNumber_02"), each = 4), Operator = rep(c("Operator_01","Operator_02"), each = 2, times = 2), Measure = c(0.0172,0.0177,0.0155,0.0159,0.0174,0.0181,0.0152,0.0176) ) xbar_repeat(data, part = 'SN', operator = 'Operator', meas = 'Measure')
Average and Range Method Reproducibility Calculation
xbar_reproduce(data, part, operator, meas)xbar_reproduce(data, part, operator, meas)
data |
An R dataframe or tibble containing the required identifier and measurement columns. |
part |
Column name (unquoted) specifying the unique ID of the part being measured. The column should be a character or factor vector. |
operator |
Column name (unquoted) specifying the operator for the recorded measurement. The column should be a character or factor vector. |
meas |
Column name (unquoted) where the measurement value is recorded. The column must be numeric and contain no missing or infinite values. |
A number. The measure of reproducibility for the given data.
data <- data.frame( SN = rep(c("SerialNumber_01","SerialNumber_02"), each = 4), Operator = rep(c("Operator_01","Operator_02"), each = 2, times = 2), Measure = c(0.0172,0.0177,0.0155,0.0159,0.0174,0.0181,0.0152,0.0176) ) xbar_reproduce(data, part = 'SN', operator = 'Operator', meas = 'Measure')data <- data.frame( SN = rep(c("SerialNumber_01","SerialNumber_02"), each = 4), Operator = rep(c("Operator_01","Operator_02"), each = 2, times = 2), Measure = c(0.0172,0.0177,0.0155,0.0159,0.0174,0.0181,0.0152,0.0176) ) xbar_reproduce(data, part = 'SN', operator = 'Operator', meas = 'Measure')
Average and Range Method Variance Component Summary
xbar_varcomps(data, part, operator, meas)xbar_varcomps(data, part, operator, meas)
data |
An R dataframe or tibble. |
part |
Column name (unquoted) specifying the unique ID of the part being measured. |
operator |
Column name (unquoted) specifying the operator for the recorded measurement. |
meas |
Column name (unquoted) where the measurement value is recorded. |
A list of numeric values for repeatability, reproducibility, total GRR, part-to-part, and total variance components.
data <- data.frame( SN = rep(c("SerialNumber_01","SerialNumber_02"), each = 4), Operator = rep(c("Operator_01","Operator_02"), each = 2, times = 2), Measure = c(0.0172,0.0177,0.0155,0.0159,0.0174,0.0181,0.0152,0.0176) ) xbar_varcomps(data, part = 'SN', operator = 'Operator', meas = 'Measure')data <- data.frame( SN = rep(c("SerialNumber_01","SerialNumber_02"), each = 4), Operator = rep(c("Operator_01","Operator_02"), each = 2, times = 2), Measure = c(0.0172,0.0177,0.0155,0.0159,0.0174,0.0181,0.0152,0.0176) ) xbar_varcomps(data, part = 'SN', operator = 'Operator', meas = 'Measure')