diff --git a/DESCRIPTION b/DESCRIPTION
index 131c72bc..d37c8480 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,7 +1,7 @@
Package: jaspQualityControl
Type: Package
Title: Quality Control Module for JASP
-Version: 0.96.0
+Version: 0.96.1
Date: 2022-10-25
Author: JASP Team
Website: https://github.com/jasp-stats/jaspQualityControl
diff --git a/R/processCapabilityStudies.R b/R/processCapabilityStudies.R
index d667be92..32e6514f 100644
--- a/R/processCapabilityStudies.R
+++ b/R/processCapabilityStudies.R
@@ -1115,8 +1115,10 @@ processCapabilityStudies <- function(jaspResults, dataset, options) {
sourceVector <- c(sourceVector, paste0(ciLevelPercent, "% CI Cpk"))
}
- if (options[["processCapabilityTableZbench"]]) {
- table$addColumnInfo(name="zbench", title=gettext("Z bench (ST)"), type="number")
+ if (options[["processCapabilityTableZ"]]) {
+ table$addColumnInfo(name="zSt", title=gettext("Z (ST)"), type="number")
+ tableColNames <- c(tableColNames, "zSt")
+ sourceVector <- c(sourceVector, "Z (ST)")
}
table$showSpecifiedColumnsOnly <- TRUE
@@ -1158,8 +1160,6 @@ processCapabilityStudies <- function(jaspResults, dataset, options) {
} else {
cpk <- cpu
}
- zbench <- 3*cpk
-
if (options[["processCapabilityTableCi"]]) {
ciAlpha <- 1 - ciLevel
@@ -1178,11 +1178,14 @@ processCapabilityStudies <- function(jaspResults, dataset, options) {
ciUbCpk <- cpk + (normCIrange * intervalCpk)
}
}
- tableDfCurrentStage <- data.frame(cp = round(cp, .numDecimals),
+ tableDfCurrentStage <- data.frame(cp = round(cp, .numDecimals),
cpl = round(cpl, .numDecimals),
cpu = round(cpu, .numDecimals),
- cpk = round(cpk, .numDecimals),
- zbench = round(zbench, .numDecimals))
+ cpk = round(cpk, .numDecimals))
+
+ if (options[["processCapabilityTableZ"]])
+ tableDfCurrentStage[["zSt"]] <- round(3*cpk, .numDecimals)
+
if (options[["processCapabilityTableCi"]]) {
if (!(options[["lowerSpecificationLimitBoundary"]] || options[["upperSpecificationLimitBoundary"]])) {
tableDfCurrentStage[["cplci"]] <- round(ciLbCp, .numDecimals)
@@ -1248,6 +1251,8 @@ processCapabilityStudies <- function(jaspResults, dataset, options) {
if (options[["processCapabilityTableCi"]] &&
!(options[["upperSpecificationLimitBoundary"]] && options[["lowerSpecificationLimitBoundary"]]))
formattedTableDf[["cpkci"]] <- paste0("[", tableList[["cpklci"]], ", ", tableList[["cpkuci"]], "]")
+ if (options[["processCapabilityTableZ"]])
+ formattedTableDf[["zSt"]] <- tableList[["zSt"]]
colnames(formattedTableDf) <- sourceVector
return(formattedTableDf)
}
@@ -1311,8 +1316,10 @@ processCapabilityStudies <- function(jaspResults, dataset, options) {
tableColNames <- c(tableColNames, "ppklci", "ppkuci")
sourceVector1 <- c(sourceVector1, paste0(ciLevelPercent, "% CI Ppk"))
}
- if (options[["processCapabilityTableZbench"]]) {
- table$addColumnInfo(name="zbench", title=gettext("Z bench (LT)"), type="number")
+ if (options[["processCapabilityTableZ"]]) {
+ table$addColumnInfo(name="zLt", title=gettext("Z (LT)"), type="number")
+ tableColNames <- c(tableColNames, "zLt")
+ sourceVector1 <- c(sourceVector1, "Z (LT)")
}
if (options[["target"]]) {
table$addColumnInfo(name = "cpm", type = "integer", title = gettext("Cpm"))
@@ -1366,7 +1373,6 @@ processCapabilityStudies <- function(jaspResults, dataset, options) {
} else {
ppk <- ppu
}
- zbench <- 3*ppk
cp <- (usl - lsl) / (tolMultiplier * sdw)
if (options[["lowerSpecificationLimit"]] && options[["upperSpecificationLimit"]] && options[["target"]]) {
@@ -1408,11 +1414,12 @@ processCapabilityStudies <- function(jaspResults, dataset, options) {
}
}
- tableDfCurrentStage <- data.frame(pp = round(pp, .numDecimals),
+ tableDfCurrentStage <- data.frame(pp = round(pp, .numDecimals),
ppl = round(ppl, .numDecimals),
ppu = round(ppu, .numDecimals),
- ppk = round(ppk, .numDecimals),
- zbench = round(zbench, .numDecimals))
+ ppk = round(ppk, .numDecimals))
+ if (options[["processCapabilityTableZ"]])
+ tableDfCurrentStage[["zLt"]] <- round(3*ppk, .numDecimals)
if (options[["target"]])
tableDfCurrentStage[["cpm"]] <- round(cpm, .numDecimals)
if (options[["processCapabilityTableCi"]]) {
@@ -1489,6 +1496,8 @@ processCapabilityStudies <- function(jaspResults, dataset, options) {
if (options[["processCapabilityTableCi"]] &&
!(options[["lowerSpecificationLimitBoundary"]] && options[["upperSpecificationLimitBoundary"]]))
formattedTableDf[["ppkci"]] <- paste0("[", tableList[["ppklci"]], ", ",tableList[["ppkuci"]], "]")
+ if (options[["processCapabilityTableZ"]])
+ formattedTableDf[["zLt"]] <- tableList[["zLt"]]
if (options[["target"]]) {
formattedTableDf[["cpm"]] <- tableList[["cpm"]]
if (options[["processCapabilityTableCi"]] &&
diff --git a/inst/Upgrades.qml b/inst/Upgrades.qml
index bdb26dcf..37d94601 100644
--- a/inst/Upgrades.qml
+++ b/inst/Upgrades.qml
@@ -1422,4 +1422,14 @@ Upgrades
ChangeRename {from: "reportTime"; to: "reportTimeText"}
ChangeRename {from: "reportFrequency"; to: "reportFrequencyText"}
}
+
+ // Z.bench to Z
+ Upgrade
+ {
+ functionName: "processCapabilityStudies"
+ fromVersion: "0.96.0"
+ toVersion: "0.96.1"
+
+ ChangeRename {from: "processCapabilityTableZbench"; to: "processCapabilityTableZ"}
+ }
}
diff --git a/inst/help/processCapabilityStudies.md b/inst/help/processCapabilityStudies.md
index 08bf87c8..c03b835a 100644
--- a/inst/help/processCapabilityStudies.md
+++ b/inst/help/processCapabilityStudies.md
@@ -97,7 +97,7 @@ The size of the subgroups is relevant for the calculation of the process varianc
Process capability is determined by the variation that comes from common causes. It generally represents the best (potential) performance of the process. This is demonstrated when the process is being operated in a state of statistical control regardless the specifications [1].
Capability index Cp compares the process capability to the maximum allowable variation as indicated by the tolerance.
Cp is not impacted by the process location. This index can be calculated only for bilateral (two-sided) tolerances, it has no meaning for the one-sided situation (unilateral tolerance, with only one specification limit).
- Capability index Cpk takes the process location as well as the capability into account. Cpk will always be less than or equal to Cp.
+ Capability index Cpk takes the process location as well as the capability into account. Cpk will always be less than or equal to Cp. Z (ST) is equal to 3 * Cpk and corresponds to the distance of the process mean to the nearest bound in standard deviation units.
*Note*: Capability study reports contain meaningless numbers if processes are not in a state of statistical control.
- Process performance (total): the Pp and its confidence interval's values, PpL, PpU, PpK and its confidence interval's values, Cpm and its confidence interval's values.
@@ -106,7 +106,7 @@ The size of the subgroups is relevant for the calculation of the process varianc
Performance index Pp compares the process performance to the maximum allowable variation as indicated by the tolerance [1].
Pp is not impacted by the process location. This index can be calculated only for bilateral (two-sided) tolerances, it has no meaning for the one-sided situation (unilateral tolerance, with only one specification limit).
Performance index Ppk takes the process location as well as the performance into account.
- Ppk will always be less than or equal to Pp.
+ Ppk will always be less than or equal to Pp. Z (LT) is equal to 3 * Ppk and corresponds to the distance of the process mean to the nearest bound in standard deviation units.
The Cpm index indicates how well the process can produce within specifications. Its calculation is similar to Cp, except that the standard deviation is calculated using the target value instead of the mean. The larger the Cpm, the more likely the process will produce output that meets specifications and is close to the target value.
- Non-conformance statistics: the observed of ppm outside the specification limits, the expected ppm outside the specifications limits based on the overall standard deviation and the within standard deviation.
diff --git a/inst/qml/processCapabilityStudies.qml b/inst/qml/processCapabilityStudies.qml
index ec295c34..b4d529d7 100644
--- a/inst/qml/processCapabilityStudies.qml
+++ b/inst/qml/processCapabilityStudies.qml
@@ -582,8 +582,8 @@ Form
CheckBox
{
- name: "processCapabilityTableZbench"
- label: qsTr("Z bench")
+ name: "processCapabilityTableZ"
+ label: qsTr("Z (ST) / Z (LT)")
}
}
diff --git a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report21-subplot-8.svg b/tests/testthat/_snaps/processCapabilityStudies/process-capability-report21-subplot-8.svg
index 917e6e8f..c4ba392a 100644
--- a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report21-subplot-8.svg
+++ b/tests/testthat/_snaps/processCapabilityStudies/process-capability-report21-subplot-8.svg
@@ -87,6 +87,16 @@
+
+
+
+
+
+
+
+
+
+
@@ -147,6 +157,16 @@
+
+
+
+
+
+
+
+
+
+
Cp
@@ -207,6 +227,16 @@
+
+Z (ST)
+
+
+
+
+2.79
+
+
+
@@ -268,22 +298,32 @@
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -348,22 +388,32 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
@@ -427,23 +477,33 @@
-
-Cpm
+
+Z (LT)
+
+
+
+
+2.65
+
+
+
+
+Cpm
-
-0.93
+
+0.93
-
-90% CI Cpm
+
+90% CI Cpm
-
-[0.83, 1.04]
+
+[0.83, 1.04]
diff --git a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report22-subplot-11.svg b/tests/testthat/_snaps/processCapabilityStudies/process-capability-report22-subplot-11.svg
index abac3be8..f6e993c6 100644
--- a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report22-subplot-11.svg
+++ b/tests/testthat/_snaps/processCapabilityStudies/process-capability-report22-subplot-11.svg
@@ -97,6 +97,16 @@
+
+
+
+
+
+
+
+
+
+
@@ -307,6 +317,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Stage
@@ -377,6 +417,11 @@
+
+Z (ST)
+
+
+
[0.99, 1.38]
@@ -447,6 +492,21 @@
+
+2.63
+
+
+
+
+2.91
+
+
+
+
+0.28
+
+
+
@@ -518,22 +578,32 @@
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -748,62 +818,92 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -877,8 +977,8 @@
-
-Cpm
+
+Z (LT)
@@ -887,8 +987,8 @@
-
-90% CI Cpm
+
+Cpm
@@ -897,6 +997,11 @@
+
+90% CI Cpm
+
+
+
1.18
@@ -957,33 +1062,48 @@
-
-0.89
+
+2.46
+
+
+
+
+2.77
+
+
+
+
+0.31
+
+
+
+
+0.89
-
-0.97
+
+0.97
-
-0.08
+
+0.08
-
-[0.73, 1.05]
+
+[0.73, 1.05]
-
-[-, -]
+
+[-, -]
-
-[0.1, 0.06]
+
+[0.1, 0.06]
Process capability (within)
diff --git a/tests/testthat/test-processCapabilityStudies.R b/tests/testthat/test-processCapabilityStudies.R
index ad3abd3d..03c55261 100644
--- a/tests/testthat/test-processCapabilityStudies.R
+++ b/tests/testthat/test-processCapabilityStudies.R
@@ -24,7 +24,7 @@ options$upperSpecificationLimit <- TRUE
options$lowerSpecificationLimitValue <- 0
options$targetValue <- 6
options$upperSpecificationLimitValue <- 12
-options$processCapabilityTableZbench <- TRUE # not tested against Minitab
+options$processCapabilityTableZ <- TRUE # not tested against other Software
set.seed(1)
results <- runAnalysis("processCapabilityStudies",
"datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options)
@@ -100,6 +100,7 @@ options$upperSpecificationLimit <- TRUE
options$lowerSpecificationLimitValue <- 0
options$targetValue <- 6
options$upperSpecificationLimitValue <- 12
+options$processCapabilityTableZ <- TRUE # Not tested against other software
set.seed(1)
results <- runAnalysis("processCapabilityStudies",
"datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options)
@@ -114,9 +115,9 @@ test_that("LF2.2 (Normal) Basic tests of Process performance (total) table with
table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis_capabilityTableOverall"]][["data"]]
jaspTools::expect_equal_tables(table,
list(0.89, 0.73, 1.05, 1, 0.82, 0.65, 1, 1.18, 0.81, 0.82, 1.19, "1 (BL)",
- 0.97, "-", "-", 1.13, 0.92, 0.77, 1.08, 1.33, 0.95, 0.92, 1.29,
- 2, 0.08, 0.1, 0.06, 0.13, 0.1, "-", "-", 0.15, "-", 0.1, "-",
- "Change (2 vs. BL)"))
+ 2.46, 0.97, "-", "-", 1.13, 0.92, 0.77, 1.08, 1.33, 0.95, 0.92,
+ 1.29, 2, 2.77, 0.08, 0.1, 0.06, 0.13, 0.1, "-", "-", 0.15, "-",
+ 0.1, "-", "Change (2 vs. BL)", 0.31))
})
test_that("LF2.3 (Normal) Basic tests of Non-conformance statistics table with subgroup variable and stages", {
@@ -131,9 +132,10 @@ test_that("LF2.3 (Normal) Basic tests of Non-conformance statistics table with s
test_that("LF2.4 (Normal) Basic tests of Process capability (within) table with subgroup variable and stages", {
table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis_capabilityTableWithin"]][["data"]]
jaspTools::expect_equal_tables(table,
- list(1.07, 0.88, 0.68, 1.08, 1.26, 0.85, 0.88, 1.29, "1 (BL)", 1.18,
- 0.97, 0.79, 1.15, 1.4, 0.99, 0.97, 1.38, 2, 0.11, 0.09, "-",
- "-", 0.14, "-", 0.09, "-", "Change (2 vs. BL)"))
+ list(1.07, 0.88, 0.68, 1.08, 1.26, 0.85, 0.88, 1.29, "1 (BL)", 2.63,
+ 1.18, 0.97, 0.79, 1.15, 1.4, 0.99, 0.97, 1.38, 2, 2.91, 0.11,
+ 0.09, "-", "-", 0.14, "-", 0.09, "-", "Change (2 vs. BL)", 0.28
+ ))
})
test_that("LF2.5 (Normal) Basic tests of Process summary table with subgroup variable and stages", {
@@ -1594,6 +1596,8 @@ options$reportProcessText <- "process name test"
options$reportDateText <- "today"
options$reportReportedByText <- "Name test"
options$reportConclusionText <- "comments test"
+options$processCapabilityTableZ <- TRUE
+
set.seed(1)
results <- runAnalysis("processCapabilityStudies",
"datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options)
@@ -1631,6 +1635,8 @@ options$reportProcessText <- "process name test"
options$reportDateText <- "today"
options$reportReportedByText <- "Name test"
options$reportConclusionText <- "comments test"
+options$processCapabilityTableZ <- TRUE
+
set.seed(1)
results <- runAnalysis("processCapabilityStudies",
"datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options)