Skip to contents

This function is used to compute the statistic k of Mandel.

Usage

k.qcs(x, ...)

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

# S3 method for lab.qcdata
k.qcs(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 by 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"
k<- k.qcs(Glucose.qcdata, alpha = 0.005)
summary(k)
#> 
#> Number of laboratories:  8
#> Number of materials:  5
#> Number of replicate:  3
#> Critical value:  2.06084
#> Beyond limits of control: 
#>         A    B     C    D     E
#> Lab1 TRUE TRUE  TRUE TRUE  TRUE
#> Lab2 TRUE TRUE  TRUE TRUE FALSE
#> Lab3 TRUE TRUE  TRUE TRUE  TRUE
#> Lab4 TRUE TRUE FALSE TRUE  TRUE
#> Lab5 TRUE TRUE  TRUE TRUE  TRUE
#> Lab6 TRUE TRUE  TRUE TRUE  TRUE
#> Lab7 TRUE TRUE  TRUE TRUE  TRUE
#> Lab8 TRUE TRUE  TRUE TRUE  TRUE
plot(k)