-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
qcc.groups() with only one observation cause error in qcc() from sd.xbar, etc. #13
Comments
Ok, this is a case outside the standard situations where you have "rationale subgroups" of at least two observations each, or all samples with a single observations. The two cases need different methods for estimate the within-sample standard deviation.
This can be easily implemented within the sd.xbar() function. |
Indeed I did something like this as a hack in my present application: QCCGroups <- function(data, sample){
mat <- qcc::qcc.groups(data, sample)
mat <- mat[which(apply(mat, 1, function(x) length(which(!is.na(x))))>1),,drop=FALSE]
return(mat)
} I think the "real" issue here is that using
|
also...thanks again for the great package, and for taking the time to look at this issue! |
Your hack simply remove the sample(s) with a single observation (and the code can be simplified to improve readability), so you can do this with touching any qcc code. |
With variable group sizes, if a group happens to have only one member,
qcc()
will throw an error fromsd.xbar()
.Ideally, the functions should be robust to this type of input so that the tool can be used for in-process monitoring: e.g. with time-based subgroups, the user may run the report before a second (or third, or perhaps even first) observation is collected.
The text was updated successfully, but these errors were encountered: