sd.xbar(data, sizes, sd = NULL, equal.sd = T) sd.s(data, sizes, sd = NULL, equal.sd = T) sd.R(data, sizes, sd = NULL, equal.sd = T) sd.p(data, sizes) sd.np(data, sizes) sd.c(data, sizes) sd.u(data, sizes)
The argument equal.sd for "xbar", "s", and "R" charts is built in for added user control. It is not, however, controllable from the argument list to qcc. Consequently, you can either use sd.xbar, sd.s. or sd.R on your data, setting equal.sd = F, and passing the resulting value as the std.dev argument to qcc or make your own copy of these two functions with the default setting changed. References for the two different methods for computing the standard deviation for xbar and s charts are Burr(1969, 1976).
The value for std.dev for each type of chart are computed as follows:
"xbar"
Define c4 <- function(n) (sqrt(2/(n - 1)) * gamma(n/2))/gamma((n - 1)/2) var.df <- sum(sizes - 1) and var.within as the vector of within group variances.
If equal.sd = TRUE std.dev <- sqrt(sum((sizes - 1) * var.within)/var.df) std.dev <- std.dev/c4(var.df + 1) If equal.sd = FALSE g <- c4(sizes)/(1 - c4(sizes)^2) h <- g * c4(sizes) std.dev <- sum(g * sqrt(var.within))/sum(h)
"s" std.dev is computed in the same way it is for an "xbar" chart.
"R" std.dev is computed in the same way it is for an "xbar" chart.
"p" pbar <- sum(sizes * data)/sum(sizes) std.dev <- sqrt(pbar * (1 - pbar))
"np" pbar <- sum(data)/sum(sizes) std.dev <- sqrt(sizes * pbar * (1 - pbar))
"c" std.dev <- sqrt(mean(data)) sizes is assumed equal to 1 (one).
"u" std.dev <- sqrt(sum(sizes * data)/sum(sizes))
You may write your own version of any one of these functions and pass the name of your function to the std.dev argument of qcc. You can use these functions as templates. Be sure, however, to include either a sizes argument or the ... argument, since qcc will pass in sizes in the call to your function.
Burr, I. W. (1976). Statistical Quality Control Methods, Volume 16. New York: Marcel Decker, Inc.