To illustrate what qcc does, I made one vector of 100 data points and assigned it into groups of either 5 or 10 measurements. The resulting xbar charts have very different control limits relative to the reported standard deviation.

```
library(qcc)
#> Warning: package 'qcc' was built under R version 3.5.3
#> Package 'qcc' version 2.7
#> Type 'citation("qcc")' for citing this R package in publications.
set.seed(899)
Dat <- rnorm(100, mean = 0, sd = 1)
Runs1 = rep(LETTERS[1:20], each = 5)
Runs2 = rep(letters[1:10], each = 10)
Mat1 <- qcc.groups(Dat, Runs1)
Mat2 <- qcc.groups(Dat, Runs2)
Out1 <- qcc(Mat1, type = "xbar")
```

```
Out2 <- qcc(Mat2, type = "xbar")
```

^{Created on 2019-09-22 by the reprex package (v0.2.1)}

Here is the code for the limits.xbar() function of the qcc package.

```
> limits.xbar
function (center, std.dev, sizes, conf)
{
if (length(unique(sizes)) == 1)
sizes <- sizes[1]
se.stats <- std.dev/sqrt(sizes)
if (conf >= 1) {
lcl <- center - conf * se.stats
ucl <- center + conf * se.stats
}
else {
if (conf > 0 & conf < 1) {
nsigmas <- qnorm(1 - (1 - conf)/2)
lcl <- center - nsigmas * se.stats
ucl <- center + nsigmas * se.stats
}
else stop("invalid 'conf' argument. See help.")
}
limits <- matrix(c(lcl, ucl), ncol = 2)
rownames(limits) <- rep("", length = nrow(limits))
colnames(limits) <- c("LCL", "UCL")
return(limits)
}
<bytecode: 0x0000000026f05960>
<environment: namespace:qcc>
```