Skip to contents

Function to estimate the Grubbs test statistic.

Usage

grubbs.test(x, ...)

# S3 method for default
grubbs.test(
  x,
  var.index = 1,
  replicate.index = 2,
  material.index = 3,
  laboratory.index = 4,
  data.name = NULL,
  alpha = 0.05,
  ...
)

# S3 method for lab.qcdata
grubbs.test(x, alpha = 0.05, ...)

Arguments

x

An object of class lab.qcdata (Univariate Quality Control Data).

...

Other arguments passed to or from methods.

var.index

A scalar with the column number corresponding to the observed variable (the critical to quality variable). Alternativelly can be a string with the name of the quality variable.

replicate.index

A scalar with the column number corresponding to the index each replicate.

material.index

A scalar corresponding to the replicated number.

laboratory.index

A scalar that defines the index number of each laboratory.

data.name

A string specifying the name of the variable which appears on the plots. If name is not provided, it is taken from the object given as data.

alpha

The significance level (0.05 for default)

References

Wilrich Peter-T. (2013), Critical values of Mandel's h and k, the Grubbs and the Cochran test statistic. Asta-Advances in Statistical Analysis, 97(1):1-10.

ASTM E 691 (1999), Standard practice for conducting an interlaboratory study to determine the precision of a test method. American Society for Testing and Materials. West Conshohocken, PA, USA.

Examples


library(ILS)
data(Glucose)
Glucose.qcdata<- lab.qcdata(Glucose)
str(Glucose.qcdata)
#> Classes ‘lab.qcdata’ and 'data.frame':	120 obs. of  4 variables:
#>  $ x         : num  41 41.5 41.4 41.2 42 ...
#>  $ replicate : Factor w/ 3 levels "1","2","3": 1 2 3 1 2 3 1 2 3 1 ...
#>  $ material  : Factor w/ 5 levels "A","B","C","D",..: 1 1 1 1 1 1 1 1 1 1 ...
#>  $ laboratory: Factor w/ 8 levels "Lab1","Lab2",..: 1 1 1 2 2 2 3 3 3 4 ...
#>  - attr(*, "data.name")= chr "Glucose"
grubbs.test(Glucose.qcdata)
#> 
#> Test Grubbs 
#> 
#>  Critical value: 1.154478 
#> 
#>  Alpha test: 0.00625 
#>   Material Gmax    G.max p.value.max Gmin    G.min p.value.min
#> 1        A Lab8 1.909229      0.0489 Lab7 1.915242      0.0485
#> 2        B Lab4 1.564273      0.0809 Lab1 1.490219      0.0899
#> 3        C Lab4 2.984235      0.0102 Lab7 1.387137      0.1040
#> 4        D Lab8 2.388179      0.0241 Lab7 2.423819      0.0229
#> 5        E Lab2 1.576391      0.0795 Lab7 1.551749      0.0823