Function to plot the Q chart

Description

This function is used to compute statistics required by the Q chart.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
npqcs.Q(x, ...)

## Default S3 method:
npqcs.Q(x, G, data.name = NULL, limits = NULL,
  method = c("Tukey", "Liu", "Mahalanobis", "RP", "LD"), alpha = 0.01,
  plot = FALSE, ...)

## S3 method for class 'npqcd'
npqcs.Q(x, data.name, limits = NULL, method = c("Tukey",
  "Liu", "Mahalanobis", "RP", "LD"), alpha = 0.01, plot = FALSE, ...)

Arguments

x

An object npqcd (Non parametric Quality Control Data)

...

arguments passed to or from methods.

G

The x as a matrix, data frame or list. If it is a matrix or data frame, then each row is viewed as one multivariate observation.

data.name

a string that specifies the title displayed on the plots. If not provided it is taken from the name of the object x.

limits

a two-value vector specifying the control limits lower and central.

method

Character string which determines the depth function used. method can be "Tukey" (the default), "Liu", "Mahalanobis", "RP" Random Project or "LD" Likelihood depth.

alpha

it is the the significance level (0.01 for default)

plot

a logical value indicating it should be plotted.

References

Regina Liu (1995)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## Not run:  
##
##  Continuous data 
##
library(qcr)
set.seed(12345)
mu<-c(0,0)
Sigma<- matrix(c(1,0,0,1),nrow = 2,ncol = 2)
u <- c(2,2)
S <- matrix(c(4,0,0,4),nrow = 2,ncol = 2)
G <- rmvnorm(540, mean = mu, sigma = Sigma)
x<- rmvnorm(40,mean=u,sigma = S)
x <- rbind(G[501:540,],x)
n <- 4 # samples
m <- 20  # measurements
k <- 2  # number of variables
x.a <- array(,dim=c(n,k,m))
for (i in 1:m){
x.a[,,i] <- x[(1+(i-1)*n):(i*n),] }
M <- G[1:500,]
data.npqcd <- npqcd(x.a,M)
str(data.npqcd)
res.npqcs <- npqcs.Q(data.npqcd,method = "Liu", alpha=0.025)
str(res.npqcs)
summary(res.npqcs)
plot(res.npqcs,title =" Q Control Chart")
## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.