Skip to main content

Gage R&R

GitHub PyPi License

Table of Contents

  1. Install
  2. CLI
  3. Example
  4. Statistics

Install

From PyPi:

pip install GageRnR

From source:

pip install -e .

Development dependencies:

pip install -r pip/requirements-dev.txt

CLI

The package can be used to generate reports from CLI:

GageRnR -f data/data_mXop.csv -s 3,5,11 -o outDir

This generates a html report that is stored in the outDir folder.

Setting the axes parameter is useful if the data is not structured correct:

GageRnR -f data/data_opXm.csv -s 5,7,11 -a 2,1,0 -o outDir

To calculate linearity and bias ground truth is required:

GageRnR -f data/data_demoGRnR.csv -s 3,10,3 -a 0,2,1 -g 40,42,30,43,29,45,27.5,42,26,35 -o outDir

For more help run:

GageRnR -h
GageRnR.

The input data should be structured
in a 3d array n[i,j,k] where
i = operator, j = part, k = measurement
Stored to file this data would look:
m1    m2    m3
3.29, 3.41, 3.64  # p1 | o1
2.44, 2.32, 2.42  # p2
3.08, 3.25, 3.07  # p1 | o2
2.53, 1.78, 2.32  # p2
3.04, 2.89, 2.85  # p1 | o3
1.62, 1.87, 2.04  # p2

More info: https://github.com/owodunni/GageRnR

Usage:
    GageRnR -f FILE -s STRUCTURE [-a <AXES>] [-d <DELIMITER>] [-o <FOLDER>] [-g <PARTS>]
    GageRnR -h | --help
    GageRnR -v | --version

Examples:
    GageRnR -f data.csv -s5,7,11 -o report
    GageRnR -f data/data_mXop.csv -s 3,5,11 -o outDir
    GageRnR -f data/data_opXm.csv -s 5,7,11 -a 2,1,0 -o outDir
    GageRnR -f data/data_demoGRnR.csv -s 3,10,3 -a 0,2,1 -g 40,42,30,43,29,45,27.5,42,26,35 -o outDir

Options:
    -f --file=FILE Load input data.
    -s --structure=STRUCTURE Data structure.
        Order should be operators, parts, measurements.
    -a --axes=<AXES>  Order of data axes [default: 0,1,2].
    -d --delimiter=<DELIMITER>  Order of data axes [default: ,].
    -o --output=<FOLDER> Report output directory
    -g --groundTruth=<PARTS> Ground Truth data for parts
    -h --help     Show this screen.
    -v --version  Show version.

Example

The package can be used in the following way:

from GageRnR import GageRnR
import numpy as np

# The input should be structured in a 3d
# numpy array n[i,j,k] where
# i = operator, j = part, k = measurement
# Example:
#       m1    m2    m3
data = np.array(            #
    [[[3.29, 3.41, 3.64],   # p1 | o1
      [2.44, 2.32, 2.42],   # p2
      [4.34, 4.17, 4.27],   # p3
      [3.47, 3.5, 3.64],    # p4
      [2.2, 2.08, 2.16]],   # p5
     [[3.08, 3.25, 3.07],   # p1 | o2
      [2.53, 1.78, 2.32],   # p2
      [4.19, 3.94, 4.34],   # p3
      [3.01, 4.03, 3.2],    # p4
      [2.44, 1.8, 1.72]],   # p5
     [[3.04, 2.89, 2.85],   # p1 | o3
      [1.62, 1.87, 2.04],   # p2
      [3.88, 4.09, 3.67],   # p3
      [3.14, 3.2, 3.11],    # p4
      [1.54, 1.93, 1.55]]]) # p5

g = GageRnR(data)
g.calculate()
print(g.summary())

This will result in the following table:

Sources of Variance DF SS MS Var (σ²) Std (σ) F-value P-value
Operator 2 1.63 0.815 0.054 0.232 100.322 0.000
Part 4 28.909 7.227 0.802 0.896 889.458 0.000
Operator by Part 8 0.065 0.008 0 0 0.142 0.996
Measurement 30 1.712 0.057 0.057 0.239
Total 44 32.317 0.734 0.913 0.956

To access the result from the Gauge RnR data directly:

from GageRnR import GageRnR, Component, Result

.
.
.

g = GageRnR(data)
result = g.calculate()
F = result[Result.F]
>>> print(F[Component.OPERATOR])
100.322

For more examples of how to use this library take a look at the unit tests!

Statistics

The package can generate the following statistics:

  • GageRnR

    Gauge R&R, which stands for gage repeatability and reproducibility, is a statistical tool that measures the amount of variation in the measurement system arising from the measurement device and the people taking the measurement.

    Unfortunately, all measurement data contains a certain percentage of variation. The variation is the difference between the true values and the observed values. The variation represents the amount of measurement error. In addition to measurement error, is the actual product or process variation. When we combine measurement error with product or process variation the resulting value represents the total variation. To assure that our measurement data is accurate we must determine if the amount of variation is acceptable

    If the p value is less than 0.05, it means that the source of variation has a significant impact on the results.

    For more information take a look at:

  • Mean, Standard Deviation and bar chart plots.

    To get a better feel for our measurement data we can plot it together with a bar chart and show some characteristic statistics of the data.

  • Normality test

    For Gauge R&R to work it is important that our data is normal distributed. If we don't have enough data the it might not be normal distributed. We can test if the data is normal distributed using a Shapiro-Wilk Test. Small values of W are evidence of departure from normality. It is important that our parts are normally distributed. A P-value smaller then 0.05 indicates that the data is not Gaussian.

    For more information take a look at:

  • Linearity and Bias - requires ground truth data

    Bias and linearity assess the accuracy of a gage.

    • Bias examines the difference between the observed average measurement and a reference value. Bias indicates how accurate the gage is when compared to a reference value.
    • Linearity examines how accurate your measurements are through the expected range of the measurements. Linearity indicates whether the gage has the same accuracy across all reference values.

    A P-value smaller then 0.05 indicates that a linear equation fits well to the data.

    For more information take a look at:

Metadata

Release files for GageRnR 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for GageRnR 0.8.0
File Size Uploaded Provenance Actions
GageRnR-0.8.0.tar.gz 36.1 kB Without provenance Details for GageRnR-0.8.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for GageRnR 0.8.0
File Interpreter ABI Platform Actions
GageRnR-0.8.0-py3-none-any.whl Python 3 none any Details for GageRnR-0.8.0-py3-none-any.whl

Total release size: 78.6 kB

Release files / GageRnR-0.8.0.tar.gz

Download URL GageRnR-0.8.0.tar.gz
Size 36.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5dec91e2cfb7b495f9270d19ee33eb26ae76574661a067d3f665a5caf4e22a4d
BLAKE2b-256 checksum
How to use checksums
dd014b9ddd17fa67da39fd51a235bcf3e3caaee19a19c379e8584eee557d95fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

Release files / GageRnR-0.8.0-py3-none-any.whl

Download URL GageRnR-0.8.0-py3-none-any.whl
Size 42.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
45bfa3d105a90d64235087f7cb74b1acc2aeeb9ef650ac2218cd19077ce36cfd
BLAKE2b-256 checksum
How to use checksums
2170bf2a08cf7b1af573c9e04ff13352def92c13625fc605002254710fc1c626
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

Security for GageRnR 0.8.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page