Learn R Programming

r6qualitytools (version 1.0.1)

gageRR.c: gageRR-class: Class `gageRR`

Description

R6 Class for Gage R&R (Repeatability and Reproducibility) Analysis

Arguments

Public fields

X

Data frame containing the measurement data.

ANOVA

List containing the results of the Analysis of Variance (ANOVA) for the gage study.

RedANOVA

List containing the results of the reduced ANOVA.

method

Character string specifying the method used for the analysis (e.g., `crossed`, `nested`).

Estimates

List of estimates including variance components, repeatability, and reproducibility.

Varcomp

List of variance components.

Sigma

Numeric value representing the standard deviation of the measurement system.

GageName

Character string representing the name of the gage.

GageTolerance

Numeric value indicating the tolerance of the gage.

DateOfStudy

Character string representing the date of the gage R&R study.

PersonResponsible

Character string indicating the person responsible for the study.

Comments

Character string for additional comments or notes about the study.

b

Factor levels for operator.

a

Factor levels for part.

y

Numeric vector or matrix containing the measurement responses.

facNames

Character vector specifying the names of the factors (e.g., `Operator`, `Part`).

numO

Integer representing the number of operators.

numP

Integer representing the number of parts.

numM

Integer representing the number of measurements per part-operator combination.

Methods


Method new()

Initialize the fiels of the gageRR object

Usage

gageRR.c$new(
  X,
  ANOVA = NULL,
  RedANOVA = NULL,
  method = NULL,
  Estimates = NULL,
  Varcomp = NULL,
  Sigma = NULL,
  GageName = NULL,
  GageTolerance = NULL,
  DateOfStudy = NULL,
  PersonResponsible = NULL,
  Comments = NULL,
  b = NULL,
  a = NULL,
  y = NULL,
  facNames = NULL,
  numO = NULL,
  numP = NULL,
  numM = NULL
)

Arguments

X

Data frame containing the measurement data.

ANOVA

List containing the results of the Analysis of Variance (ANOVA) for the gage study.

RedANOVA

List containing the results of the reduced ANOVA.

method

Character string specifying the method used for the analysis (e.g., "crossed", "nested").

Estimates

List of estimates including variance components, repeatability, and reproducibility.

Varcomp

List of variance components.

Sigma

Numeric value representing the standard deviation of the measurement system.

GageName

Character string representing the name of the gage.

GageTolerance

Numeric value indicating the tolerance of the gage.

DateOfStudy

Character string representing the date of the gage R&R study.

PersonResponsible

Character string indicating the person responsible for the study.

Comments

Character string for additional comments or notes about the study.

b

Factor levels for operator.

a

Factor levels for part.

y

Numeric vector or matrix containing the measurement responses.

facNames

Character vector specifying the names of the factors (e.g., "Operator", "Part").

numO

Integer representing the number of operators.

numP

Integer representing the number of parts.

numM

Integer representing the number of measurements per part-operator combination.


Method print()

Return the data frame containing the measurement data (X)

Usage

gageRR.c$print()


Method subset()

Return a subset of the data frame that containing the measurement data (X)

Usage

gageRR.c$subset(i, j)

Arguments

i

The i-position of the row of X.

j

The j-position of the column of X.


Method summary()

Summarize the information of the fields of the gageRR object.

Usage

gageRR.c$summary()


Method get.response()

Get or get the response for a gageRRDesign object.

Usage

gageRR.c$get.response()


Method response()

Set the response for a gageRRDesign object.

Usage

gageRR.c$response(value)

Arguments

value

New response vector.


Method names()

Methods for function names in Package base.

Usage

gageRR.c$names()


Method as.data.frame()

Methods for function as.data.frame in Package base.

Usage

gageRR.c$as.data.frame()


Method get.tolerance()

Get the tolerance for an object of class gageRR.

Usage

gageRR.c$get.tolerance()


Method set.tolerance()

Set the tolerance for an object of class gageRR.

Usage

gageRR.c$set.tolerance(value)

Arguments

value

A data.frame or vector for the new value of tolerance.


Method get.sigma()

Get the sigma for an object of class gageRR.

Usage

gageRR.c$get.sigma()


Method set.sigma()

Set the sigma for an object of class gageRR.

Usage

gageRR.c$set.sigma(value)

Arguments

value

Valor of sigma


Method plot()

This function creates a customized plot using the data from the gageRR.c object.

Usage

gageRR.c$plot(main = NULL, xlab = NULL, ylab = NULL, col, lwd, fun = mean)

Arguments

main

Character string specifying the title of the plot.

xlab

A character string for the x-axis label.

ylab

A character string for the y-axis label.

col

A character string or vector specifying the color(s) to be used for the plot elements.

lwd

A numeric value specifying the line width of plot elements

fun

Function to use for the calculation of the interactions (e.g., mean, median). Default is mean.

Examples

# Create gageRR-object
gdo = gageRRDesign(Operators = 3, Parts = 10, Measurements = 3, randomize = FALSE)
# Vector of responses
y = c(0.29,0.08, 0.04,-0.56,-0.47,-1.38,1.34,1.19,0.88,0.47,0.01,0.14,-0.80,
      -0.56,-1.46, 0.02,-0.20,-0.29,0.59,0.47,0.02,-0.31,-0.63,-0.46,2.26,
      1.80,1.77,-1.36,-1.68,-1.49,0.41,0.25,-0.11,-0.68,-1.22,-1.13,1.17,0.94,
      1.09,0.50,1.03,0.20,-0.92,-1.20,-1.07,-0.11, 0.22,-0.67,0.75,0.55,0.01,
      -0.20, 0.08,-0.56,1.99,2.12,1.45,-1.25,-1.62,-1.77,0.64,0.07,-0.15,-0.58,
      -0.68,-0.96,1.27,1.34,0.67,0.64,0.20,0.11,-0.84,-1.28,-1.45,-0.21,0.06,
      -0.49,0.66,0.83,0.21,-0.17,-0.34,-0.49,2.01,2.19,1.87,-1.31,-1.50,-2.16)

# Appropriate responses gdo$response(y) # Perform and gageRR gdo <- gageRR(gdo)

gdo$plot()


Method errorPlot()

The data from an object of class gageRR can be analyzed by running `Error Charts` of the individual deviations from the accepted rference values. These `Error Charts` are provided by the function errorPlot.

Usage

gageRR.c$errorPlot(main, xlab, ylab, col, pch, ylim, legend = TRUE)

Arguments

main

a main title for the plot.

xlab

A character string for the x-axis label.

ylab

A character string for the y-axis label.

col

Plotting color.

pch

An integer specifying a symbol or a single character to be used as the default in plotting points.

ylim

The y limits of the plot.

legend

A logical value specifying whether a legend is plotted automatically. By default legend is set to `TRUE`.

Examples

# Create gageRR-object
gdo = gageRRDesign(Operators = 3, Parts = 10, Measurements = 3, randomize = FALSE)
# Vector of responses
y = c(0.29,0.08, 0.04,-0.56,-0.47,-1.38,1.34,1.19,0.88,0.47,0.01,0.14,-0.80,
      -0.56,-1.46, 0.02,-0.20,-0.29,0.59,0.47,0.02,-0.31,-0.63,-0.46,2.26,
      1.80,1.77,-1.36,-1.68,-1.49,0.41,0.25,-0.11,-0.68,-1.22,-1.13,1.17,0.94,
      1.09,0.50,1.03,0.20,-0.92,-1.20,-1.07,-0.11, 0.22,-0.67,0.75,0.55,0.01,
      -0.20, 0.08,-0.56,1.99,2.12,1.45,-1.25,-1.62,-1.77,0.64,0.07,-0.15,-0.58,
      -0.68,-0.96,1.27,1.34,0.67,0.64,0.20,0.11,-0.84,-1.28,-1.45,-0.21,0.06,
      -0.49,0.66,0.83,0.21,-0.17,-0.34,-0.49,2.01,2.19,1.87,-1.31,-1.50,-2.16)

# Appropriate responses gdo$response(y) # Perform and gageRR gdo <- gageRR(gdo)

gdo$errorPlot()


Method whiskersPlot()

In a Whiskers Chart, the high and low data values and the average (median) by part-by-operator are plotted to provide insight into the consistency between operators, to indicate outliers and to discover part-operator interactions. The Whiskers Chart reminds of boxplots for every part and every operator.

Usage

gageRR.c$whiskersPlot(main, xlab, ylab, col, ylim, legend = TRUE)

Arguments

main

a main title for the plot.

xlab

A character string for the x-axis label.

ylab

A character string for the y-axis label.

col

Plotting color.

ylim

The y limits of the plot.

legend

A logical value specifying whether a legend is plotted automatically. By default legend is set to `TRUE`.

Examples

# Create gageRR-object
gdo = gageRRDesign(Operators = 3, Parts = 10, Measurements = 3, randomize = FALSE)
# Vector of responses
y = c(0.29,0.08, 0.04,-0.56,-0.47,-1.38,1.34,1.19,0.88,0.47,0.01,0.14,-0.80,
      -0.56,-1.46, 0.02,-0.20,-0.29,0.59,0.47,0.02,-0.31,-0.63,-0.46,2.26,
      1.80,1.77,-1.36,-1.68,-1.49,0.41,0.25,-0.11,-0.68,-1.22,-1.13,1.17,0.94,
      1.09,0.50,1.03,0.20,-0.92,-1.20,-1.07,-0.11, 0.22,-0.67,0.75,0.55,0.01,
      -0.20, 0.08,-0.56,1.99,2.12,1.45,-1.25,-1.62,-1.77,0.64,0.07,-0.15,-0.58,
      -0.68,-0.96,1.27,1.34,0.67,0.64,0.20,0.11,-0.84,-1.28,-1.45,-0.21,0.06,
      -0.49,0.66,0.83,0.21,-0.17,-0.34,-0.49,2.01,2.19,1.87,-1.31,-1.50,-2.16)

# Appropriate responses gdo$response(y) # Perform and gageRR gdo <- gageRR(gdo)

gdo$whiskersPlot()


Method averagePlot()

averagePlot creates all x-y plots of averages by size out of an object of class gageRR. Therfore the averages of the multiple readings by each operator on each part are plotted with the reference value or overall part averages as the index.

Usage

gageRR.c$averagePlot(main, xlab, ylab, col, single = FALSE)

Arguments

main

a main title for the plot.

xlab

A character string for the x-axis label.

ylab

A character string for the y-axis label.

col

Plotting color.

single

A logical value.If `TRUE` a new graphic device will be opened for each plot. By default single is set to `FALSE`.

Examples

# Create gageRR-object
gdo = gageRRDesign(Operators = 3, Parts = 10, Measurements = 3, randomize = FALSE)
# Vector of responses
y = c(0.29,0.08, 0.04,-0.56,-0.47,-1.38,1.34,1.19,0.88,0.47,0.01,0.14,-0.80,
      -0.56,-1.46, 0.02,-0.20,-0.29,0.59,0.47,0.02,-0.31,-0.63,-0.46,2.26,
      1.80,1.77,-1.36,-1.68,-1.49,0.41,0.25,-0.11,-0.68,-1.22,-1.13,1.17,0.94,
      1.09,0.50,1.03,0.20,-0.92,-1.20,-1.07,-0.11, 0.22,-0.67,0.75,0.55,0.01,
      -0.20, 0.08,-0.56,1.99,2.12,1.45,-1.25,-1.62,-1.77,0.64,0.07,-0.15,-0.58,
      -0.68,-0.96,1.27,1.34,0.67,0.64,0.20,0.11,-0.84,-1.28,-1.45,-0.21,0.06,
      -0.49,0.66,0.83,0.21,-0.17,-0.34,-0.49,2.01,2.19,1.87,-1.31,-1.50,-2.16)

# Appropriate responses gdo$response(y) # Perform and gageRR gdo <- gageRR(gdo)

gdo$averagePlot()


Method compPlot()

compPlot creates comparison x-y plots of an object of class gageRR. The averages of the multiple readings by each operator on each part are plotted against each other with the operators as indices. This plot compares the values obtained by one operator to those of another.

Usage

gageRR.c$compPlot(main, xlab, ylab, col, cex.lab, fun = NULL)

Arguments

main

a main title for the plot.

xlab

A character string for the x-axis label.

ylab

A character string for the y-axis label.

col

Plotting color.

cex.lab

The magnification to be used for x and y labels relative to the current setting of cex.

fun

Optional function that will be applied to the multiple readings of each part. fun should be an object of class function like mean,median, sum, etc. By default, fun is set to `NULL` and all readings will be plotted.

Examples

# Create gageRR-object
gdo = gageRRDesign(Operators = 3, Parts = 10, Measurements = 3, randomize = FALSE)
# Vector of responses
y = c(0.29,0.08, 0.04,-0.56,-0.47,-1.38,1.34,1.19,0.88,0.47,0.01,0.14,-0.80,
      -0.56,-1.46, 0.02,-0.20,-0.29,0.59,0.47,0.02,-0.31,-0.63,-0.46,2.26,
      1.80,1.77,-1.36,-1.68,-1.49,0.41,0.25,-0.11,-0.68,-1.22,-1.13,1.17,0.94,
      1.09,0.50,1.03,0.20,-0.92,-1.20,-1.07,-0.11, 0.22,-0.67,0.75,0.55,0.01,
      -0.20, 0.08,-0.56,1.99,2.12,1.45,-1.25,-1.62,-1.77,0.64,0.07,-0.15,-0.58,
      -0.68,-0.96,1.27,1.34,0.67,0.64,0.20,0.11,-0.84,-1.28,-1.45,-0.21,0.06,
      -0.49,0.66,0.83,0.21,-0.17,-0.34,-0.49,2.01,2.19,1.87,-1.31,-1.50,-2.16)

# Appropriate responses gdo$response(y) # Perform and gageRR gdo <- gageRR(gdo)

gdo$compPlot()


Method clone()

The objects of this class are cloneable with this method.

Usage

gageRR.c$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

Run this code
#create gageRR-object
gdo <- gageRRDesign(Operators = 3, Parts = 10, Measurements = 3, randomize = FALSE)
#vector of responses
y <- c(0.29,0.08, 0.04,-0.56,-0.47,-1.38,1.34,1.19,0.88,0.47,0.01,0.14,-0.80,
      -0.56,-1.46, 0.02,-0.20,-0.29,0.59,0.47,0.02,-0.31,-0.63,-0.46,2.26,
      1.80,1.77,-1.36,-1.68,-1.49,0.41,0.25,-0.11,-0.68,-1.22,-1.13,1.17,0.94,
      1.09,0.50,1.03,0.20,-0.92,-1.20,-1.07,-0.11, 0.22,-0.67,0.75,0.55,0.01,
      -0.20, 0.08,-0.56,1.99,2.12,1.45,-1.25,-1.62,-1.77,0.64,0.07,-0.15,-0.58,
      -0.68,-0.96,1.27,1.34,0.67,0.64,0.20,0.11,-0.84,-1.28,-1.45,-0.21,0.06,
      -0.49,0.66,0.83,0.21,-0.17,-0.34,-0.49,2.01,2.19,1.87,-1.31,-1.50,-2.16)

#appropriate responses
gdo$response(y)
# perform and gageRR
gdo <- gageRR(gdo)

# Using the plots
gdo$plot()

## ------------------------------------------------
## Method `gageRR.c$plot`
## ------------------------------------------------

# Create gageRR-object
gdo = gageRRDesign(Operators = 3, Parts = 10, Measurements = 3, randomize = FALSE)
# Vector of responses
y = c(0.29,0.08, 0.04,-0.56,-0.47,-1.38,1.34,1.19,0.88,0.47,0.01,0.14,-0.80,
      -0.56,-1.46, 0.02,-0.20,-0.29,0.59,0.47,0.02,-0.31,-0.63,-0.46,2.26,
      1.80,1.77,-1.36,-1.68,-1.49,0.41,0.25,-0.11,-0.68,-1.22,-1.13,1.17,0.94,
      1.09,0.50,1.03,0.20,-0.92,-1.20,-1.07,-0.11, 0.22,-0.67,0.75,0.55,0.01,
      -0.20, 0.08,-0.56,1.99,2.12,1.45,-1.25,-1.62,-1.77,0.64,0.07,-0.15,-0.58,
      -0.68,-0.96,1.27,1.34,0.67,0.64,0.20,0.11,-0.84,-1.28,-1.45,-0.21,0.06,
      -0.49,0.66,0.83,0.21,-0.17,-0.34,-0.49,2.01,2.19,1.87,-1.31,-1.50,-2.16)

# Appropriate responses
gdo$response(y)
# Perform and gageRR
gdo <- gageRR(gdo)

gdo$plot()

## ------------------------------------------------
## Method `gageRR.c$errorPlot`
## ------------------------------------------------

# Create gageRR-object
gdo = gageRRDesign(Operators = 3, Parts = 10, Measurements = 3, randomize = FALSE)
# Vector of responses
y = c(0.29,0.08, 0.04,-0.56,-0.47,-1.38,1.34,1.19,0.88,0.47,0.01,0.14,-0.80,
      -0.56,-1.46, 0.02,-0.20,-0.29,0.59,0.47,0.02,-0.31,-0.63,-0.46,2.26,
      1.80,1.77,-1.36,-1.68,-1.49,0.41,0.25,-0.11,-0.68,-1.22,-1.13,1.17,0.94,
      1.09,0.50,1.03,0.20,-0.92,-1.20,-1.07,-0.11, 0.22,-0.67,0.75,0.55,0.01,
      -0.20, 0.08,-0.56,1.99,2.12,1.45,-1.25,-1.62,-1.77,0.64,0.07,-0.15,-0.58,
      -0.68,-0.96,1.27,1.34,0.67,0.64,0.20,0.11,-0.84,-1.28,-1.45,-0.21,0.06,
      -0.49,0.66,0.83,0.21,-0.17,-0.34,-0.49,2.01,2.19,1.87,-1.31,-1.50,-2.16)

# Appropriate responses
gdo$response(y)
# Perform and gageRR
gdo <- gageRR(gdo)

gdo$errorPlot()

## ------------------------------------------------
## Method `gageRR.c$whiskersPlot`
## ------------------------------------------------

# Create gageRR-object
gdo = gageRRDesign(Operators = 3, Parts = 10, Measurements = 3, randomize = FALSE)
# Vector of responses
y = c(0.29,0.08, 0.04,-0.56,-0.47,-1.38,1.34,1.19,0.88,0.47,0.01,0.14,-0.80,
      -0.56,-1.46, 0.02,-0.20,-0.29,0.59,0.47,0.02,-0.31,-0.63,-0.46,2.26,
      1.80,1.77,-1.36,-1.68,-1.49,0.41,0.25,-0.11,-0.68,-1.22,-1.13,1.17,0.94,
      1.09,0.50,1.03,0.20,-0.92,-1.20,-1.07,-0.11, 0.22,-0.67,0.75,0.55,0.01,
      -0.20, 0.08,-0.56,1.99,2.12,1.45,-1.25,-1.62,-1.77,0.64,0.07,-0.15,-0.58,
      -0.68,-0.96,1.27,1.34,0.67,0.64,0.20,0.11,-0.84,-1.28,-1.45,-0.21,0.06,
      -0.49,0.66,0.83,0.21,-0.17,-0.34,-0.49,2.01,2.19,1.87,-1.31,-1.50,-2.16)

# Appropriate responses
gdo$response(y)
# Perform and gageRR
gdo <- gageRR(gdo)

gdo$whiskersPlot()

## ------------------------------------------------
## Method `gageRR.c$averagePlot`
## ------------------------------------------------

# Create gageRR-object
gdo = gageRRDesign(Operators = 3, Parts = 10, Measurements = 3, randomize = FALSE)
# Vector of responses
y = c(0.29,0.08, 0.04,-0.56,-0.47,-1.38,1.34,1.19,0.88,0.47,0.01,0.14,-0.80,
      -0.56,-1.46, 0.02,-0.20,-0.29,0.59,0.47,0.02,-0.31,-0.63,-0.46,2.26,
      1.80,1.77,-1.36,-1.68,-1.49,0.41,0.25,-0.11,-0.68,-1.22,-1.13,1.17,0.94,
      1.09,0.50,1.03,0.20,-0.92,-1.20,-1.07,-0.11, 0.22,-0.67,0.75,0.55,0.01,
      -0.20, 0.08,-0.56,1.99,2.12,1.45,-1.25,-1.62,-1.77,0.64,0.07,-0.15,-0.58,
      -0.68,-0.96,1.27,1.34,0.67,0.64,0.20,0.11,-0.84,-1.28,-1.45,-0.21,0.06,
      -0.49,0.66,0.83,0.21,-0.17,-0.34,-0.49,2.01,2.19,1.87,-1.31,-1.50,-2.16)

# Appropriate responses
gdo$response(y)
# Perform and gageRR
gdo <- gageRR(gdo)

gdo$averagePlot()

## ------------------------------------------------
## Method `gageRR.c$compPlot`
## ------------------------------------------------

# Create gageRR-object
gdo = gageRRDesign(Operators = 3, Parts = 10, Measurements = 3, randomize = FALSE)
# Vector of responses
y = c(0.29,0.08, 0.04,-0.56,-0.47,-1.38,1.34,1.19,0.88,0.47,0.01,0.14,-0.80,
      -0.56,-1.46, 0.02,-0.20,-0.29,0.59,0.47,0.02,-0.31,-0.63,-0.46,2.26,
      1.80,1.77,-1.36,-1.68,-1.49,0.41,0.25,-0.11,-0.68,-1.22,-1.13,1.17,0.94,
      1.09,0.50,1.03,0.20,-0.92,-1.20,-1.07,-0.11, 0.22,-0.67,0.75,0.55,0.01,
      -0.20, 0.08,-0.56,1.99,2.12,1.45,-1.25,-1.62,-1.77,0.64,0.07,-0.15,-0.58,
      -0.68,-0.96,1.27,1.34,0.67,0.64,0.20,0.11,-0.84,-1.28,-1.45,-0.21,0.06,
      -0.49,0.66,0.83,0.21,-0.17,-0.34,-0.49,2.01,2.19,1.87,-1.31,-1.50,-2.16)

# Appropriate responses
gdo$response(y)
# Perform and gageRR
gdo <- gageRR(gdo)

gdo$compPlot()

Run the code above in your browser using DataLab