From f4091f3b125d596746eac0720dd1ea91660d9669 Mon Sep 17 00:00:00 2001 From: JTPetter Date: Wed, 27 Aug 2025 16:34:22 +0200 Subject: [PATCH 1/9] GUI --- inst/qml/processCapabilityStudies.qml | 125 ++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) diff --git a/inst/qml/processCapabilityStudies.qml b/inst/qml/processCapabilityStudies.qml index eb4ef1e3..8ea28154 100644 --- a/inst/qml/processCapabilityStudies.qml +++ b/inst/qml/processCapabilityStudies.qml @@ -218,6 +218,41 @@ Form id : normalCapabilityAnalysis label: qsTr("Normal distribution") checked: true + + + CheckBox + { + name: "historicalMean" + label: qsTr("Historical mean") + id: historicalMean + childrenOnSameRow: true + + DoubleField + { + name: "historicalMeanValue" + id: historicalMeanValue + negativeValues: true + defaultValue: 0 + decimals: 9 + } + } + + CheckBox + { + name: "historicalStdDev" + label: qsTr("Historical std. dev.") + id: historicalStdDev + childrenOnSameRow: true + + DoubleField + { + name: "historicalStdDevValue" + id: historicalStdDevValue + negativeValues: true + defaultValue: 1 + decimals: 9 + } + } } RadioButton @@ -241,6 +276,96 @@ Form indexDefaultValue: 0 } + CheckBox + { + name: "historicalShape" + label: qsTr("Historical shape") + id: historicalShape + childrenOnSameRow: true + visible: nonNormalDistribution.currentValue == "weibull" || nonNormalDistribution.currentValue == "3ParameterWeibull" + + DoubleField + { + name: "historicalShapeValue" + id: historicalShapeValue + negativeValues: true + defaultValue: 1 + decimals: 9 + } + } + + CheckBox + { + name: "historicalScale" + label: qsTr("Historical scale") + id: historicalScale + childrenOnSameRow: true + visible: nonNormalDistribution.currentValue == "weibull" || nonNormalDistribution.currentValue == "3ParameterWeibull" + + DoubleField + { + name: "historicalScaleValue" + id: historicalScaleValue + negativeValues: true + defaultValue: 1 + decimals: 9 + } + } + + CheckBox + { + name: "historicalLogMean" + label: qsTr("Historical log mean") + id: historicalLogMean + childrenOnSameRow: true + visible: nonNormalDistribution.currentValue == "lognormal" || nonNormalDistribution.currentValue == "3ParameterLognormal" + + DoubleField + { + name: "historicalLogMeanValue" + id: historicalLogMeanValue + negativeValues: true + defaultValue: 1 + decimals: 9 + } + } + + CheckBox + { + name: "historicalLogStdDev" + label: qsTr("Historical log std. dev.") + id: historicalLogStdDev + childrenOnSameRow: true + visible: nonNormalDistribution.currentValue == "lognormal" || nonNormalDistribution.currentValue == "3ParameterLognormal" + + DoubleField + { + name: "historicalLogStdDevValue" + id: historicalLogStdDevValue + negativeValues: true + defaultValue: 1 + decimals: 9 + } + } + + CheckBox + { + name: "historicalThreshold" + label: qsTr("Historical threshold") + id: historicalThreshold + childrenOnSameRow: true + visible: nonNormalDistribution.currentValue == "3ParameterLognormal" || nonNormalDistribution.currentValue == "3ParameterWeibull" + + DoubleField + { + name: "historicalThresholdValue" + id: historicalThresholdValue + negativeValues: true + defaultValue: 1 + decimals: 9 + } + } + DropDown { name: "nonNormalMethod" From e1ecb96e58a2890c0d3eeab5569eb3536f9833d4 Mon Sep 17 00:00:00 2001 From: JTPetter Date: Thu, 20 Nov 2025 17:00:27 +0100 Subject: [PATCH 2/9] Functionality for normal dist. and historical mean --- R/processCapabilityStudies.R | 65 ++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/R/processCapabilityStudies.R b/R/processCapabilityStudies.R index a373c2fa..18ea7919 100644 --- a/R/processCapabilityStudies.R +++ b/R/processCapabilityStudies.R @@ -515,21 +515,23 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { dataCurrentStage <- dataset[which(dataset[[stages]] == stage), ][!names(dataset) %in% stages] if (length(measurements) < 2) { k <- options[["controlChartSdEstimationMethodMeanMovingRangeLength"]] - sdw <- .controlChart_calculations(dataCurrentStage[measurements], plotType = "MR", movingRangeLength = k)$sd + sdw <- if (options[["historicalStdDev"]]) options[["historicalStdDevValue"]] else .controlChart_calculations(dataCurrentStage[measurements], plotType = "MR", movingRangeLength = k)$sd } else { sdType <- if (options[["controlChartSdEstimationMethodGroupSizeLargerThanOne"]] == "rBar") "r" else "s" unbiasingConstantUsed <- options[["controlChartSdUnbiasingConstant"]] - sdw <- .sdXbar(dataCurrentStage[measurements], type = sdType, unbiasingConstantUsed = unbiasingConstantUsed) + sdw <- if (options[["historicalStdDev"]]) options[["historicalStdDevValue"]] else .sdXbar(dataCurrentStage[measurements], type = sdType, unbiasingConstantUsed = unbiasingConstantUsed) } allData <- na.omit(unlist(dataCurrentStage[, measurements])) if (is.na(sdw)) table$addFootnote(gettext("The within standard deviation could not be calculated.")) + processMean <- if (options[["historicalMean"]]) options[["historicalMeanValue"]] else mean(allData, na.rm = TRUE) + tableDfCurrentStage <- data.frame(lsl = round(options[["lowerSpecificationLimitValue"]], .numDecimals), target = round(options[["targetValue"]], .numDecimals), usl = round(options[["upperSpecificationLimitValue"]], .numDecimals), - mean = mean(allData, na.rm = TRUE), + mean = processMean, n = length(allData), sd = sd(allData, na.rm = TRUE), sdw = sdw) @@ -578,9 +580,6 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { target <- '*' if (!options[["upperSpecificationLimit"]]) usl <- '*' - mean <- mean(allData, na.rm = TRUE) - n <- as.integer(length(allData)) - sd <- sd(allData, na.rm = TRUE) formattedTableDf[["lsl"]] <- tableList[["lsl"]] formattedTableDf[["target"]] <- tableList[["target"]] formattedTableDf[["usl"]] <- tableList[["usl"]] @@ -654,11 +653,11 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { dataCurrentStage <- dataset[which(dataset[[stages]] == stage), ][!names(dataset) %in% stages] if (length(measurements) < 2) { k <- options[["controlChartSdEstimationMethodMeanMovingRangeLength"]] - sdw <- .controlChart_calculations(dataCurrentStage[measurements], plotType = "MR", movingRangeLength = k)$sd + sdw <- if (options[["historicalStdDev"]]) options[["historicalStdDevValue"]] else .controlChart_calculations(dataCurrentStage[measurements], plotType = "MR", movingRangeLength = k)$sd } else { sdType <- if (options[["controlChartSdEstimationMethodGroupSizeLargerThanOne"]] == "rBar") "r" else "s" unbiasingConstantUsed <- options[["controlChartSdUnbiasingConstant"]] - sdw <- .sdXbar(dataCurrentStage[measurements], type = sdType, unbiasingConstantUsed = unbiasingConstantUsed) + sdw <- if (options[["historicalStdDev"]]) options[["historicalStdDevValue"]] else .sdXbar(dataCurrentStage[measurements], type = sdType, unbiasingConstantUsed = unbiasingConstantUsed) } allData <- as.vector(na.omit(unlist(dataCurrentStage[, measurements]))) plotData <- data.frame(x = allData) @@ -690,9 +689,10 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { # Overlay distribution if (options[["processCapabilityPlotDistributions"]]) { if (distribution == "normal") { - p <- p + ggplot2::stat_function(fun = dnorm, args = list(mean = mean(allData), sd = sd(allData)), + processMean <- if (options[["historicalMean"]]) options[["historicalMeanValue"]] else mean(allData, na.rm = TRUE) + p <- p + ggplot2::stat_function(fun = dnorm, args = list(mean = processMean, sd = sd(allData)), mapping = ggplot2::aes(color = "sdoDist", linetype = "sdoDist")) + - ggplot2::stat_function(fun = dnorm, args = list(mean = mean(allData), sd = sdw), + ggplot2::stat_function(fun = dnorm, args = list(mean = processMean, sd = sdw), mapping = ggplot2::aes(color = "sdwDist", linetype = "sdwDist")) legendColors <- c(legendColors, "dodgerblue", "red") legendLty <- c(legendLty, "solid", "solid") @@ -868,11 +868,11 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { if (length(measurements) < 2) { k <- options[["controlChartSdEstimationMethodMeanMovingRangeLength"]] - sdw <- .controlChart_calculations(dataCurrentStage[measurements], plotType = "MR", movingRangeLength = k)$sd + sdw <- if (options[["historicalStdDev"]]) options[["historicalStdDevValue"]] else .controlChart_calculations(dataCurrentStage[measurements], plotType = "MR", movingRangeLength = k)$sd } else { sdType <- if (options[["controlChartSdEstimationMethodGroupSizeLargerThanOne"]] == "rBar") "r" else "s" unbiasingConstantUsed <- options[["controlChartSdUnbiasingConstant"]] - sdw <- .sdXbar(dataCurrentStage[measurements], type = sdType, unbiasingConstantUsed = unbiasingConstantUsed) + sdw <- if (options[["historicalStdDev"]]) options[["historicalStdDevValue"]] else .sdXbar(dataCurrentStage[measurements], type = sdType, unbiasingConstantUsed = unbiasingConstantUsed) } allData <- na.omit(unlist(dataCurrentStage[, measurements])) @@ -881,10 +881,11 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { lsl <- options[["lowerSpecificationLimitValue"]] n <- length(allData) k <- length(measurements) + processMean <- if (options[["historicalMean"]]) options[["historicalMeanValue"]] else mean(allData, na.rm = TRUE) tolMultiplier <- 6 cp <- if (options[["lowerSpecificationLimitBoundary"]] || options[["upperSpecificationLimitBoundary"]]) NA else (usl - lsl) / (tolMultiplier * sdw) - cpl <-if (options[["lowerSpecificationLimitBoundary"]]) NA else (mean(allData) - lsl) / ((tolMultiplier/2) * sdw) - cpu <- if (options[["upperSpecificationLimitBoundary"]]) NA else (usl - mean(allData)) / ((tolMultiplier/2) * sdw) + cpl <-if (options[["lowerSpecificationLimitBoundary"]]) NA else (processMean - lsl) / ((tolMultiplier/2) * sdw) + cpu <- if (options[["upperSpecificationLimitBoundary"]]) NA else (usl - processMean) / ((tolMultiplier/2) * sdw) if (options[["lowerSpecificationLimit"]] && options[["upperSpecificationLimit"]]) { cpk <-if (options[["lowerSpecificationLimitBoundary"]] && options[["upperSpecificationLimitBoundary"]]) NA else min(cpu, cpl, na.rm = TRUE) } else if (options[["lowerSpecificationLimit"]] && !options[["upperSpecificationLimit"]]) { @@ -1074,15 +1075,15 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { if (length(measurements) < 2) { k <- options[["controlChartSdEstimationMethodMeanMovingRangeLength"]] - sdw <- .controlChart_calculations(dataCurrentStage[measurements], plotType = "MR", movingRangeLength = k)$sd + sdw <- if (options[["historicalStdDev"]]) options[["historicalStdDevValue"]] else .controlChart_calculations(dataCurrentStage[measurements], plotType = "MR", movingRangeLength = k)$sd } else { sdType <- if (options[["controlChartSdEstimationMethodGroupSizeLargerThanOne"]] == "rBar") "r" else "s" unbiasingConstantUsed <- options[["controlChartSdUnbiasingConstant"]] - sdw <- .sdXbar(dataCurrentStage[measurements], type = sdType, unbiasingConstantUsed = unbiasingConstantUsed) + sdw <- if (options[["historicalStdDev"]]) options[["historicalStdDevValue"]] else .sdXbar(dataCurrentStage[measurements], type = sdType, unbiasingConstantUsed = unbiasingConstantUsed) } allData <- na.omit(unlist(dataCurrentStage[, measurements])) sdo <- sd(allData) - meanOverall <- mean(allData) + processMean <- if (options[["historicalMean"]]) options[["historicalMeanValue"]] else mean(allData, na.rm = TRUE) usl <- options[["upperSpecificationLimitValue"]] lsl <- options[["lowerSpecificationLimitValue"]] m <- (options[["upperSpecificationLimitValue"]] + options[["lowerSpecificationLimitValue"]])/2 @@ -1090,8 +1091,8 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { t <- options[["targetValue"]] tolMultiplier <- 6 pp <- if (options[["lowerSpecificationLimitBoundary"]] || options[["upperSpecificationLimitBoundary"]]) NA else (usl - lsl) / (tolMultiplier * sdo) - ppl <- if (options[["lowerSpecificationLimitBoundary"]]) NA else (meanOverall - lsl) / ((tolMultiplier/2) * sdo) - ppu <- if (options[["upperSpecificationLimitBoundary"]]) NA else (usl - mean(allData)) / ((tolMultiplier/2) * sdo) + ppl <- if (options[["lowerSpecificationLimitBoundary"]]) NA else (processMean - lsl) / ((tolMultiplier/2) * sdo) + ppu <- if (options[["upperSpecificationLimitBoundary"]]) NA else (usl - processMean) / ((tolMultiplier/2) * sdo) if (options[["lowerSpecificationLimit"]] && options[["upperSpecificationLimit"]]) { ppk <- if (options[["lowerSpecificationLimitBoundary"]] && options[["upperSpecificationLimitBoundary"]]) NA else min(ppu, ppl, na.rm = TRUE) @@ -1135,7 +1136,7 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { if (options[["target"]] && !(options[["lowerSpecificationLimitBoundary"]] && options[["upperSpecificationLimitBoundary"]])){ #CI for Cpm - a <- (meanOverall - t) / sdo + a <- (processMean - t) / sdo dfCpm <- (n * ((1 + (a^2))^2)) / (1 + (2 * (a^2))) ciLbCpm <- cpm * sqrt( qchisq(p = ciAlpha/2, df = dfCpm) /dfCpm) ciUbCpm <- cpm * sqrt(qchisq(p = 1 - (ciAlpha/2), df = dfCpm) / dfCpm) @@ -1269,7 +1270,7 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { table2$addColumnInfo(name = expWithinComparisonColName, type = "integer", title = "Expected within", overtitle = colOvertitle2) } - #Calculate performance + # Calculate performance stage <- unique(dataset[[stages]])[i] dataCurrentStage <- dataset[which(dataset[[stages]] == stage), ][!names(dataset) %in% stages] allData <- na.omit(unlist(dataCurrentStage[, measurements])) @@ -1278,17 +1279,17 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { uslTitle <- if (options[["upperSpecificationLimitBoundary"]]) gettext("UB") else gettext("USL") rowNames <- c(sprintf("ppm < %s", lslTitle), sprintf("ppm > %s", uslTitle), "ppm total") sdo <- sd(allData) - meanOverall <- mean(allData) + processMean <- if (options[["historicalMean"]]) options[["historicalMeanValue"]] else mean(allData, na.rm = TRUE) if (length(measurements) < 2) { k <- options[["controlChartSdEstimationMethodMeanMovingRangeLength"]] - sdw <- .controlChart_calculations(dataCurrentStage[measurements], plotType = "MR", movingRangeLength = k)$sd + sdw <- if (options[["historicalStdDev"]]) options[["historicalStdDevValue"]] else .controlChart_calculations(dataCurrentStage[measurements], plotType = "MR", movingRangeLength = k)$sd } else { sdType <- if (options[["controlChartSdEstimationMethodGroupSizeLargerThanOne"]] == "rBar") "r" else "s" unbiasingConstantUsed <- options[["controlChartSdUnbiasingConstant"]] - sdw <- .sdXbar(dataCurrentStage[measurements], type = sdType, unbiasingConstantUsed = unbiasingConstantUsed) + sdw <- if (options[["historicalStdDev"]]) options[["historicalStdDevValue"]] else .sdXbar(dataCurrentStage[measurements], type = sdType, unbiasingConstantUsed = unbiasingConstantUsed) } - #observed + # observed if (options[["lowerSpecificationLimit"]]) { oLSL <- (1e6*length(allDataVector[allDataVector < lsl])) / n } else { @@ -1304,12 +1305,12 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { # expected total if (options[["lowerSpecificationLimit"]] && !options[["lowerSpecificationLimitBoundary"]]) { - eoLSL <- 1e6 * (1 - pnorm((meanOverall - lsl)/sdo)) + eoLSL <- 1e6 * (1 - pnorm((processMean - lsl)/sdo)) } else { eoLSL <- NA } if (options[["upperSpecificationLimit"]] && !options[["upperSpecificationLimitBoundary"]]) { - eoUSL <- 1e6 * (1 - pnorm((usl - meanOverall)/sdo)) + eoUSL <- 1e6 * (1 - pnorm((usl - processMean)/sdo)) } else { eoUSL <- NA } @@ -1318,12 +1319,12 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { # expected within if (options[["lowerSpecificationLimit"]] && !options[["lowerSpecificationLimitBoundary"]]) { - ewLSL <- 1e6 * (1 - pnorm((meanOverall - lsl)/sdw)) + ewLSL <- 1e6 * (1 - pnorm((processMean - lsl)/sdw)) } else { ewLSL <- NA } if (options[["upperSpecificationLimit"]] && !options[["upperSpecificationLimitBoundary"]]) { - ewUSL <- 1e6 * (1 - pnorm((usl - meanOverall)/sdw)) + ewUSL <- 1e6 * (1 - pnorm((usl - processMean)/sdw)) } else { ewUSL <- NA } @@ -1441,7 +1442,7 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { if (options[["upperSpecificationLimit"]]) table$addColumnInfo(name = "usl", type = "integer", title = uslTitle) table$addColumnInfo(name = "n", type = "integer", title = gettext("Sample size")) - table$addColumnInfo(name = "mean", type = "number", title = gettext("Average")) + table$addColumnInfo(name = "mean", type = "number", title = gettext("Mean")) table$addColumnInfo(name = "sd", type = "number", title = gettext("Std. dev.")) if (options[["nonNormalDistribution"]] == "3ParameterLognormal" | options[["nonNormalDistribution"]] == "lognormal") { table$addColumnInfo(name = "beta", type = "number", title = gettextf("Log mean (%1$s)", "\u03BC")) @@ -1492,12 +1493,12 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { usl <- round(options[["upperSpecificationLimitValue"]], .numDecimals) target <- round(options[["targetValue"]], .numDecimals) sd <- sd(allData) - mean <- mean(allData, na.rm = TRUE) + processMean <- if (options[["historicalMean"]]) options[["historicalMeanValue"]] else mean(allData, na.rm = TRUE) beta <- distParameters[[i]]$beta theta <- distParameters[[i]]$theta tableDfCurrentStage <- data.frame("n" = n, - "mean" = mean, + "mean" = processMean, "sd" = sd, "lsl" = lsl, "usl" = usl, From 9700a5aef9ab484412b4c14fd63def374ec88f2d Mon Sep 17 00:00:00 2001 From: JTPetter Date: Fri, 21 Nov 2025 15:29:00 +0100 Subject: [PATCH 3/9] historical values in table for all non-normal dist --- R/processCapabilityStudies.R | 70 +++++++++++++++++++++++++++++++++--- 1 file changed, 65 insertions(+), 5 deletions(-) diff --git a/R/processCapabilityStudies.R b/R/processCapabilityStudies.R index 18ea7919..77cfb2aa 100644 --- a/R/processCapabilityStudies.R +++ b/R/processCapabilityStudies.R @@ -1476,11 +1476,71 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { stage <- unique(dataset[[stages]])[i] dataCurrentStage <- dataset[which(dataset[[stages]] == stage), ][!names(dataset) %in% stages] allData <- as.vector(na.omit(unlist(dataCurrentStage[, measurements]))) - distParameters[[i]] <- try(.distributionParameters(data = allData, distribution = options[["nonNormalDistribution"]])) - if (jaspBase::isTryError(distParameters[[i]])) { - table$setError(distParameters[[i]][1]) - container[["summaryTableNonNormal"]] <- table - return() + + # logic that checks if all parameters necessary for the distribution are given as historical, if yes, skip the dist. est. function, else replace only the given parameters + allParametersHistorical <- switch( + options[["nonNormalDistribution"]], + "weibull" = options[["historicalShape"]] && options[["historicalScale"]], + "lognormal" = options[["historicalLogMean"]] && options[["historicalLogStdDev"]], + "3ParameterWeibull" = options[["historicalShape"]] && options[["historicalScale"]] && options[["historicalThreshold"]], + "3ParameterLognormal" = options[["historicalLogMean"]] && options[["historicalLogStdDev"]] && options[["historicalThreshold"]], + FALSE # default + ) + + + if (allParametersHistorical) { + if (allParametersHistorical) { # If all are historical, assign parameters as given in options + tempDistParamList <- switch( + options[["nonNormalDistribution"]], + "weibull" = list( + beta = options[["historicalShapeValue"]], + theta = options[["historicalScaleValue"]] + ), + "lognormal" = list( + beta = options[["historicalLogMeanValue"]], + theta = options[["historicalLogStdDevValue"]] + ), + "3ParameterWeibull" = list( + beta = options[["historicalShapeValue"]], + theta = options[["historicalScaleValue"]], + threshold = options[["historicalThresholdValue"]] + ), + "3ParameterLognormal" = list( + beta = options[["historicalLogMeanValue"]], + theta = options[["historicalLogStdDevValue"]], + threshold = options[["historicalThresholdValue"]] + ), + NULL + ) + distParameters[[i]] <- tempDistParamList + } + } else { # If not all are historical, first estimate all parameters, then potentially replace some with the historical estimates + distParameters[[i]] <- try(.distributionParameters(data = allData, distribution = options[["nonNormalDistribution"]])) + if (jaspBase::isTryError(distParameters[[i]])) { + table$setError(distParameters[[i]][1]) + container[["summaryTableNonNormal"]] <- table + return() + + ## If applicable, replace parameters with historical values + # Weibull and 3-parameter Weibull + if (options[["nonNormalDistribution"]] == "weibull" || options[["nonNormalDistribution"]] == "3ParameterWeibull") { + if (options[["historicalShape"]]) + distParameters[[i]][["beta"]] <- options[["historicalShapeValue"]] + if (options[["historicalScale"]]) + distParameters[[i]][["theta"]] <- options[["historicalScaleValue"]] + if (options[["nonNormalDistribution"]] == "3ParameterWeibull" && options[["historicalThreshold"]]) + distParameters[[i]][["threshold"]] <- options[["historicalThresholdValue"]] + + # Lognormal and 3-parameter Lognormal + } else if (options[["nonNormalDistribution"]] == "lognormal" || options[["nonNormalDistribution"]] == "3ParameterLognormal") { + if (options[["historicalLogMean"]]) + distParameters[[i]][["beta"]] <- options[["historicalLogMeanValue"]] + if (options[["historicalLogStdDev"]]) + distParameters[[i]][["theta"]] <- options[["historicalLogStdDevValue"]] + if (options[["nonNormalDistribution"]] == "3ParameterLognormal" && options[["historicalThreshold"]]) + distParameters[[i]][["threshold"]] <- options[["historicalThresholdValue"]] + } + } } } From 0c02639d820f2191641669f108fd6858927c48ea Mon Sep 17 00:00:00 2001 From: JTPetter Date: Mon, 1 Dec 2025 19:04:02 +0100 Subject: [PATCH 4/9] All functionality added --- R/commonQualityControl.R | 20 +++--- R/processCapabilityStudies.R | 128 +++++++++++++++++++++++++---------- 2 files changed, 103 insertions(+), 45 deletions(-) diff --git a/R/commonQualityControl.R b/R/commonQualityControl.R index 62d9d257..6fa6bcd6 100644 --- a/R/commonQualityControl.R +++ b/R/commonQualityControl.R @@ -1375,8 +1375,8 @@ KnownControlStats.RS <- function(N, sigma = 3) { fit_Lnorm <- try(EnvStats::elnorm(data)) if (jaspBase::isTryError(fit_Lnorm)) stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) - beta <- fit_Lnorm$parameters[1] - theta <- fit_Lnorm$parameters[2] + beta <- fit_Lnorm$parameters[1] # shape / logmean + theta <- fit_Lnorm$parameters[2] # scale / log std. dev. } else if (distribution == "weibull") { fit_Weibull <- try(fitdistrplus::fitdist(data, "weibull", method = "mle", control = list( @@ -1386,23 +1386,23 @@ KnownControlStats.RS <- function(N, sigma = 3) { ndeps = rep(1e-8, 2)))) if (jaspBase::isTryError(fit_Weibull)) stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) - beta <- fit_Weibull$estimate[[1]] - theta <- fit_Weibull$estimate[[2]] + beta <- fit_Weibull$estimate[[1]] # shape + theta <- fit_Weibull$estimate[[2]] # scale } else if(distribution == "3ParameterLognormal") { temp <- try(EnvStats::elnorm3(data)) if (jaspBase::isTryError(temp)) stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) - beta <- temp$parameters[[1]] - theta <- temp$parameters[[2]] - threshold <- temp$parameters[[3]] + beta <- temp$parameters[[1]] # shape / logmean + theta <- temp$parameters[[2]] # scale / log std. dev. + threshold <- temp$parameters[[3]] # threshold } else if(distribution == "3ParameterWeibull") { temp <- try(MASS::fitdistr(data, function(x, shape, scale, thres) dweibull(x-thres, shape, scale), list(shape = 0.1, scale = 1, thres = 0))) if (jaspBase::isTryError(temp)) stop(gettext("Parameter estimation failed. Values might be too extreme. Try a different distribution."), call. = FALSE) - beta <- temp$estimate[1] - theta <- temp$estimate[2] - threshold <- temp$estimate[3] + beta <- temp$estimate[1] # shape + theta <- temp$estimate[2] # scale + threshold <- temp$estimate[3] # threshold } else if (distribution == "exponential") { fit_Weibull <- try(fitdistrplus::fitdist(data, "weibull", method = "mle", fix.arg = list("shape" = 1), control = list(maxit = 500, abstol = .Machine$double.eps, reltol = .Machine$double.eps))) diff --git a/R/processCapabilityStudies.R b/R/processCapabilityStudies.R index 77cfb2aa..a962f9e3 100644 --- a/R/processCapabilityStudies.R +++ b/R/processCapabilityStudies.R @@ -686,6 +686,17 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { legendLty <- c() legendLabels <- c() + # logic that checks if all parameters necessary for the non-normal distributions are given as historical, if yes, skip the dist. est. function, else replace only the given parameters + if (distribution != "normal") + allParametersHistorical <- switch( + options[["nonNormalDistribution"]], + "weibull" = options[["historicalShape"]] && options[["historicalScale"]], + "lognormal" = options[["historicalLogMean"]] && options[["historicalLogStdDev"]], + "3ParameterWeibull" = options[["historicalShape"]] && options[["historicalScale"]] && options[["historicalThreshold"]], + "3ParameterLognormal" = options[["historicalLogMean"]] && options[["historicalLogStdDev"]] && options[["historicalThreshold"]], + FALSE # default + ) + # Overlay distribution if (options[["processCapabilityPlotDistributions"]]) { if (distribution == "normal") { @@ -700,9 +711,19 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { gettext("Normal dist.\n(std. dev. within)")) } else if (distribution == "weibull") { - distParameters <- .distributionParameters(data = allData, distribution = distribution) - if (jaspBase::isTryError(distParameters)) - stop(distParameters[1], call. = FALSE) + if (allParametersHistorical) { + # If all are historical, assign parameters as given in options + distParameters <- list(beta = options[["historicalShapeValue"]], + theta = options[["historicalScaleValue"]]) + } else { + distParameters <- .distributionParameters(data = allData, distribution = distribution) + if (jaspBase::isTryError(distParameters)) + stop(distParameters[1], call. = FALSE) + if (options[["historicalShape"]]) + distParameters$beta <- options[["historicalShapeValue"]] + if (options[["historicalScale"]]) + distParameters$beta <- options[["historicalScaleValue"]] + } shape <- distParameters$beta scale <- distParameters$theta p <- p + ggplot2::stat_function(fun = dweibull, args = list(shape = shape, scale = scale), @@ -711,9 +732,19 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { legendLty <- c(legendLty, "solid") legendLabels <- c(legendLabels, gettext("Weibull dist.")) } else if (distribution == "lognormal") { - distParameters <- .distributionParameters(data = allData, distribution = distribution) - if (jaspBase::isTryError(distParameters)) - stop(distParameters[1], call. = FALSE) + if (allParametersHistorical) { + # If all are historical, assign parameters as given in options + distParameters <- list(beta = options[["historicalLogMeanValue"]], + theta = options[["historicalLogStdDevValue"]]) + } else { + distParameters <- .distributionParameters(data = allData, distribution = distribution) + if (jaspBase::isTryError(distParameters)) + stop(distParameters[1], call. = FALSE) + if (options[["historicalLogMean"]]) + distParameters$beta <- options[["historicalLogMeanValue"]] + if (options[["historicalLogStdDev"]]) + distParameters$theta <- options[["historicalLogStdDevValue"]] + } shape <- distParameters$beta scale <- distParameters$theta p <- p + ggplot2::stat_function(fun = dlnorm, args = list(meanlog = shape, sdlog = scale), @@ -722,10 +753,23 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { legendLty <- c(legendLty, "solid") legendLabels <- c(legendLabels, "Lognormal dist.") } else if (distribution == "3ParameterLognormal") { - distParameters <- .distributionParameters(data = allData, distribution = distribution) - if (jaspBase::isTryError(distParameters)) - stop(distParameters[1], call. = FALSE) - shape <- distParameters$theta + if (allParametersHistorical) { + # If all are historical, assign parameters as given in options + distParameters <- list(beta = options[["historicalLogMeanValue"]], + theta = options[["historicalLogStdDevValue"]], + threshold = options[["historicalThresholdValue"]]) + } else { + distParameters <- .distributionParameters(data = allData, distribution = distribution) + if (jaspBase::isTryError(distParameters)) + stop(distParameters[1], call. = FALSE) + if (options[["historicalLogMean"]]) + distParameters$beta <- options[["historicalLogMeanValue"]] + if (options[["historicalLogStdDev"]]) + distParameters$theta <- options[["historicalLogStdDevValue"]] + if (options[["historicalThreshold"]]) + distParameters$threshold <- options[["historicalThresholdValue"]] + } + shape <- distParameters$theta # The distribution function uses theta for shape and beta for scale, which is reverse to convention scale <- distParameters$beta threshold <- distParameters$threshold p <- p + ggplot2::stat_function(fun = FAdist::dlnorm3 , args = list(shape = shape, scale = scale, thres = threshold), @@ -734,9 +778,22 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { legendLty <- c(legendLty, "solid") legendLabels <- c(legendLabels, gettext("3-parameter\nlognormal dist.")) } else if (distribution == "3ParameterWeibull") { + if (allParametersHistorical) { + # If all are historical, assign parameters as given in options + distParameters <- list(beta = options[["historicalShapeValue"]], + theta = options[["historicalScaleValue"]], + threshold = options[["historicalThresholdValue"]]) + } else { distParameters <- .distributionParameters(data = allData, distribution = distribution) if (jaspBase::isTryError(distParameters)) stop(distParameters[1], call. = FALSE) + if (options[["historicalShape"]]) + distParameters$beta <- options[["historicalShapeValue"]] + if (options[["historicalScale"]]) + distParameters$beta <- options[["historicalScaleValue"]] + if (options[["historicalThreshold"]]) + distParameters$threshold <- options[["historicalThresholdValue"]] + } shape <- distParameters$beta scale <- distParameters$theta threshold <- distParameters$threshold @@ -1520,26 +1577,27 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { table$setError(distParameters[[i]][1]) container[["summaryTableNonNormal"]] <- table return() + } - ## If applicable, replace parameters with historical values - # Weibull and 3-parameter Weibull - if (options[["nonNormalDistribution"]] == "weibull" || options[["nonNormalDistribution"]] == "3ParameterWeibull") { - if (options[["historicalShape"]]) - distParameters[[i]][["beta"]] <- options[["historicalShapeValue"]] - if (options[["historicalScale"]]) - distParameters[[i]][["theta"]] <- options[["historicalScaleValue"]] - if (options[["nonNormalDistribution"]] == "3ParameterWeibull" && options[["historicalThreshold"]]) - distParameters[[i]][["threshold"]] <- options[["historicalThresholdValue"]] - - # Lognormal and 3-parameter Lognormal - } else if (options[["nonNormalDistribution"]] == "lognormal" || options[["nonNormalDistribution"]] == "3ParameterLognormal") { - if (options[["historicalLogMean"]]) - distParameters[[i]][["beta"]] <- options[["historicalLogMeanValue"]] - if (options[["historicalLogStdDev"]]) - distParameters[[i]][["theta"]] <- options[["historicalLogStdDevValue"]] - if (options[["nonNormalDistribution"]] == "3ParameterLognormal" && options[["historicalThreshold"]]) - distParameters[[i]][["threshold"]] <- options[["historicalThresholdValue"]] + ## If applicable, replace parameters with historical values + # Weibull and 3-parameter Weibull + if (options[["nonNormalDistribution"]] == "weibull" || options[["nonNormalDistribution"]] == "3ParameterWeibull") { + if (options[["historicalShape"]]) { + distParameters[[i]][["beta"]] <- options[["historicalShapeValue"]] } + if (options[["historicalScale"]]) + distParameters[[i]][["theta"]] <- options[["historicalScaleValue"]] + if (options[["nonNormalDistribution"]] == "3ParameterWeibull" && options[["historicalThreshold"]]) + distParameters[[i]][["threshold"]] <- options[["historicalThresholdValue"]] + + # Lognormal and 3-parameter Lognormal + } else if (options[["nonNormalDistribution"]] == "lognormal" || options[["nonNormalDistribution"]] == "3ParameterLognormal") { + if (options[["historicalLogMean"]]) + distParameters[[i]][["beta"]] <- options[["historicalLogMeanValue"]] + if (options[["historicalLogStdDev"]]) + distParameters[[i]][["theta"]] <- options[["historicalLogStdDevValue"]] + if (options[["nonNormalDistribution"]] == "3ParameterLognormal" && options[["historicalThreshold"]]) + distParameters[[i]][["threshold"]] <- options[["historicalThresholdValue"]] } } } @@ -1553,7 +1611,7 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { usl <- round(options[["upperSpecificationLimitValue"]], .numDecimals) target <- round(options[["targetValue"]], .numDecimals) sd <- sd(allData) - processMean <- if (options[["historicalMean"]]) options[["historicalMeanValue"]] else mean(allData, na.rm = TRUE) + processMean <- mean(allData, na.rm = TRUE) beta <- distParameters[[i]]$beta theta <- distParameters[[i]]$theta @@ -1724,12 +1782,12 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { } else if (options[["nonNormalDistribution"]] == "3ParameterLognormal") { if (options[["lowerSpecificationLimit"]] && !options[["lowerSpecificationLimitBoundary"]]) { if(options[['nonNormalMethod' ]] == "nonConformance") { - p1 <- FAdist::plnorm3(q = lsl, shape = theta, scale = beta, thres = threshold, lower.tail = TRUE) + p1 <- FAdist::plnorm3(q = lsl, shape = theta, scale = beta, thres = threshold, lower.tail = TRUE) # in this function, shape is theta and scale is beta, which is reverse to convention zLSL <- qnorm(p1) ppl <- -zLSL/3 } else { - x135 <- FAdist::qlnorm3(p = 0.00135, shape = theta, scale = beta, thres = threshold) - x05 <- FAdist::qlnorm3(p = 0.5, shape = theta, scale = beta, thres = threshold) + x135 <- FAdist::qlnorm3(p = 0.00135, shape = theta, scale = beta, thres = threshold) # in this function, shape is theta and scale is beta, which is reverse to convention + x05 <- FAdist::qlnorm3(p = 0.5, shape = theta, scale = beta, thres = threshold) # in this function, shape is theta and scale is beta, which is reverse to convention ppl <- (x05 - lsl) / (x05 - x135) } } else { @@ -1738,7 +1796,7 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { tableDfCurrentStage2[["ppl"]] <- round(ppl, .numDecimals) if (options[["upperSpecificationLimit"]] && !options[["upperSpecificationLimitBoundary"]]) { if(options[['nonNormalMethod' ]] == "nonConformance"){ - p2 <- FAdist::plnorm3(q = usl, shape = theta, scale = beta, thres = threshold) + p2 <- FAdist::plnorm3(q = usl, shape = theta, scale = beta, thres = threshold) # in this function, shape is theta and scale is beta, which is reverse to convention zUSL <- qnorm(p2) ppu <- zUSL/3 } else { @@ -1916,12 +1974,12 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { } else if (options[["nonNormalDistribution"]] == "3ParameterLognormal") { distname <- "3-parameter-lognormal" if (options[["lowerSpecificationLimit"]] && !options[["lowerSpecificationLimitBoundary"]]) { - eoLSL <- 1e6 * FAdist::plnorm3(q = lsl, shape = theta, scale = beta, thres = threshold, lower.tail = TRUE) + eoLSL <- 1e6 * FAdist::plnorm3(q = lsl, shape = theta, scale = beta, thres = threshold, lower.tail = TRUE) # in this function, shape is theta and scale is beta, which is reverse to convention } else { eoLSL <- NA } if (options[["upperSpecificationLimit"]] && !options[["upperSpecificationLimitBoundary"]]) { - eoUSL <- 1e6 * (1 - FAdist::plnorm3(q = usl, shape = theta, scale = beta, thres = threshold)) + eoUSL <- 1e6 * (1 - FAdist::plnorm3(q = usl, shape = theta, scale = beta, thres = threshold)) # in this function, shape is theta and scale is beta, which is reverse to convention } else { eoUSL <- NA } From 1ee9a84fdcc9b5c3733a790beda33dae5395fcd2 Mon Sep 17 00:00:00 2001 From: JTPetter Date: Tue, 2 Dec 2025 16:26:58 +0100 Subject: [PATCH 5/9] Finalize historical params (before unit testing and verification) --- R/processCapabilityStudies.R | 59 ++++++++++++++++++++++++++++-------- 1 file changed, 46 insertions(+), 13 deletions(-) diff --git a/R/processCapabilityStudies.R b/R/processCapabilityStudies.R index a962f9e3..7d36091e 100644 --- a/R/processCapabilityStudies.R +++ b/R/processCapabilityStudies.R @@ -479,6 +479,7 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { nStages <- length(unique(dataset[[stages]])) } table <- createJaspTable(title = gettext("Process summary")) + footnotes <- c() table$position <- 1 if (nStages > 1) { table$addColumnInfo(name = "stage", title = gettext("Stage"), type = "string") @@ -506,25 +507,31 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { tableColNames <- c("lsl", "target", "usl", "mean", "n", "sd", "sdw") if (nStages > 1) { tableColNames <- c("stage", tableColNames) - table$addFootnote(gettext("Columns titled 'Change' concern changes of the respective stage in comparison to baseline (BL).")) + footnotes <- paste0(footnotes, gettext("Columns titled 'Change' concern changes of the respective stage in comparison to baseline (BL). ")) } tableDf <- data.frame(matrix(ncol = length(tableColNames), nrow = 0)) colnames(tableDf) <- tableColNames for (i in seq_len(nStages)) { stage <- unique(dataset[[stages]])[i] dataCurrentStage <- dataset[which(dataset[[stages]] == stage), ][!names(dataset) %in% stages] - if (length(measurements) < 2) { - k <- options[["controlChartSdEstimationMethodMeanMovingRangeLength"]] - sdw <- if (options[["historicalStdDev"]]) options[["historicalStdDevValue"]] else .controlChart_calculations(dataCurrentStage[measurements], plotType = "MR", movingRangeLength = k)$sd + + ## ----- Std. dev. calculation ---------- + if (options[["historicalStdDev"]]) { + sdw <- options[["historicalStdDevValue"]] } else { - sdType <- if (options[["controlChartSdEstimationMethodGroupSizeLargerThanOne"]] == "rBar") "r" else "s" - unbiasingConstantUsed <- options[["controlChartSdUnbiasingConstant"]] - sdw <- if (options[["historicalStdDev"]]) options[["historicalStdDevValue"]] else .sdXbar(dataCurrentStage[measurements], type = sdType, unbiasingConstantUsed = unbiasingConstantUsed) + if (length(measurements) < 2) { + k <- options[["controlChartSdEstimationMethodMeanMovingRangeLength"]] + sdw <- if (options[["historicalStdDev"]]) options[["historicalStdDevValue"]] else .controlChart_calculations(dataCurrentStage[measurements], plotType = "MR", movingRangeLength = k)$sd + } else { + sdType <- if (options[["controlChartSdEstimationMethodGroupSizeLargerThanOne"]] == "rBar") "r" else "s" + unbiasingConstantUsed <- options[["controlChartSdUnbiasingConstant"]] + sdw <- if (options[["historicalStdDev"]]) options[["historicalStdDevValue"]] else .sdXbar(dataCurrentStage[measurements], type = sdType, unbiasingConstantUsed = unbiasingConstantUsed) + } + if (is.na(sdw)) + footnotes <- paste0(footnotes, gettext("The within std. dev. could not be calculated. ")) } - allData <- na.omit(unlist(dataCurrentStage[, measurements])) - if (is.na(sdw)) - table$addFootnote(gettext("The within standard deviation could not be calculated.")) + allData <- na.omit(unlist(dataCurrentStage[, measurements])) processMean <- if (options[["historicalMean"]]) options[["historicalMeanValue"]] else mean(allData, na.rm = TRUE) @@ -554,6 +561,14 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { tableList <- as.list(tableDf) table$setData(tableList) + # Add remaining footnotes + if (options[["historicalStdDev"]]) + footnotes <- paste0(footnotes, gettext("The within std. dev. is based on a historical value. ")) + if (options[["historicalMean"]]) + footnotes <- paste0(footnotes, gettext("The mean is based on a historical value. ")) + if (!is.null(footnotes)) + table$addFootnote(footnotes) + nDecimals <- .numDecimals if (returnDataframe) { @@ -1470,10 +1485,11 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { nStages <- length(unique(dataset[[stages]])) } table <- createJaspTable(title = gettextf("Process summary")) + footnotes <- c() if (nStages > 1) { table$addColumnInfo(name = "stage", title = gettext("Stage"), type = "string") table$transpose <- TRUE - table$addFootnote(gettext("Columns titled 'Change' concern changes of the respective stage in comparison to baseline (BL).")) + footnotes <- paste0(footnotes, gettext("Columns titled 'Change' concern changes of the respective stage in comparison to baseline (BL). ")) } if (((options[["nullDistribution"]] == "lognormal") || options[["nullDistribution"]] == "weibull") && @@ -1544,7 +1560,6 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { FALSE # default ) - if (allParametersHistorical) { if (allParametersHistorical) { # If all are historical, assign parameters as given in options tempDistParamList <- switch( @@ -2049,7 +2064,25 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { return(tableDf3) } - table$addFootnote(gettextf("Calculations based on %s distribution.", distname)) + # Add remaining footnotes + footnotes <- paste0(footnotes, gettextf("Calculations based on %s distribution.", distname)) + if (options[["historicalShape"]] && (options[["nonNormalDistribution"]] == "weibull" || options[["nonNormalDistribution"]] == "3ParameterWeibull")) + footnotes <- paste0(footnotes, gettextf("The shape (%1$s) is based on a historical value. ", "\u03B2")) + if (options[["historicalScale"]] && (options[["nonNormalDistribution"]] == "weibull" || options[["nonNormalDistribution"]] == "3ParameterWeibull")) + footnotes <- paste0(footnotes, gettextf("The scale (%1$s) is based on a historical value. ", "\u03B8")) + if (options[["historicalLogMean"]] && (options[["nonNormalDistribution"]] == "lognormal" || options[["nonNormalDistribution"]] == "3ParameterLognormal")) + footnotes <- paste0(footnotes, gettextf("The log mean (%1$s) is based on a historical value. ", "\u03BC")) + if (options[["historicalLogStdDev"]] && (options[["nonNormalDistribution"]] == "lognormal" || options[["nonNormalDistribution"]] == "3ParameterLognormal")) + footnotes <- paste0(footnotes, gettextf("The log std. dev. (%1$s) is based on a historical value. ", "\u03C3")) + if (options[["historicalThreshold"]] && (options[["nonNormalDistribution"]] == "3ParameterWeibull" || options[["nonNormalDistribution"]] == "3ParameterLognormal")) + footnotes <- paste0(footnotes, gettext("The threshold is based on a historical value. ")) + + if (!is.null(footnotes)) + table$addFootnote(footnotes) + + + + container[["summaryTableNonNormal"]] <- table if (options[["lowerSpecificationLimitBoundary"]] || options[["upperSpecificationLimitBoundary"]]) table2$addFootnote(gettext("Statistics displayed as * were not calculated because the relevant specification limit is not set or set as boundary.")) From f300b08ab163c86bc5297558c8facd153e03d92d Mon Sep 17 00:00:00 2001 From: JTPetter Date: Wed, 3 Dec 2025 16:19:52 +0100 Subject: [PATCH 6/9] New xaxis break rule and unit test updates --- R/processCapabilityStudies.R | 25 ++++- .../capability-of-the-process1-subplot-1.svg | 88 ++++++++------- .../capability-of-the-process12-subplot-1.svg | 80 ++++++------- .../capability-of-the-process12-subplot-2.svg | 80 ++++++------- .../capability-of-the-process12-subplot-3.svg | 88 ++++++++------- .../capability-of-the-process13-subplot-1.svg | 82 +++++++------- .../capability-of-the-process13-subplot-2.svg | 88 ++++++++------- .../capability-of-the-process14-subplot-1.svg | 88 ++++++++------- .../capability-of-the-process16-subplot-1.svg | 88 ++++++++------- .../capability-of-the-process17-subplot-1.svg | 88 ++++++++------- .../capability-of-the-process18-subplot-1.svg | 88 ++++++++------- .../capability-of-the-process19-subplot-1.svg | 88 ++++++++------- .../capability-of-the-process2-subplot-1.svg | 82 +++++++------- .../capability-of-the-process2-subplot-2.svg | 88 ++++++++------- .../capability-of-the-process20-subplot-1.svg | 80 ++++++------- .../capability-of-the-process20-subplot-2.svg | 106 +++++++++++------- .../capability-of-the-process20-subplot-3.svg | 88 ++++++++------- .../capability-of-the-process3-subplot-1.svg | 88 ++++++++------- .../capability-of-the-process4-subplot-1.svg | 82 +++++++------- .../capability-of-the-process4-subplot-2.svg | 88 ++++++++------- .../capability-of-the-process5-subplot-1.svg | 78 +++++++------ .../capability-of-the-process5-subplot-2.svg | 86 +++++++------- .../capability-of-the-process6-subplot-1.svg | 78 +++++++------ .../capability-of-the-process6-subplot-2.svg | 86 +++++++------- .../capability-of-the-process7-subplot-1.svg | 78 +++++++------ .../capability-of-the-process7-subplot-2.svg | 86 +++++++------- .../capability-of-the-process8-subplot-1.svg | 80 ++++++------- .../capability-of-the-process8-subplot-2.svg | 86 +++++++------- .../capability-of-the-process9-subplot-1.svg | 82 +++++++------- .../capability-of-the-process9-subplot-2.svg | 88 ++++++++------- .../capability-of-the-processw1-subplot-1.svg | 88 ++++++++------- ...capability-of-the-processw10-subplot-1.svg | 82 +++++++------- ...capability-of-the-processw10-subplot-2.svg | 80 ++++++------- ...capability-of-the-processw10-subplot-3.svg | 106 +++++++++++------- ...capability-of-the-processw12-subplot-1.svg | 88 ++++++++------- ...capability-of-the-processw14-subplot-1.svg | 88 ++++++++------- ...capability-of-the-processw15-subplot-1.svg | 88 ++++++++------- .../capability-of-the-processw2-subplot-1.svg | 80 ++++++------- .../capability-of-the-processw2-subplot-2.svg | 88 ++++++++------- .../capability-of-the-processw3-subplot-1.svg | 86 +++++++------- .../capability-of-the-processw4-subplot-1.svg | 86 +++++++------- .../capability-of-the-processw5-subplot-1.svg | 86 +++++++------- .../capability-of-the-processw6-subplot-1.svg | 86 +++++++------- .../capability-of-the-processw7-subplot-1.svg | 88 ++++++++------- .../process-capability-report21-subplot-7.svg | 88 ++++++++------- .../process-capability-report22-subplot-4.svg | 88 ++++++++------- .../process-capability-report22-subplot-9.svg | 82 +++++++------- .../process-capability-report23-subplot-4.svg | 86 +++++++------- .../process-capability-report23-subplot-9.svg | 78 +++++++------ .../process-capability-report24-subplot-5.svg | 88 ++++++++------- ...process-capability-reportw16-subplot-7.svg | 88 ++++++++------- ...process-capability-reportw17-subplot-4.svg | 88 ++++++++------- ...process-capability-reportw17-subplot-9.svg | 80 ++++++------- ...process-capability-reportw18-subplot-4.svg | 86 +++++++------- ...process-capability-reportw18-subplot-9.svg | 78 +++++++------ ...process-capability-reportw19-subplot-5.svg | 88 ++++++++------- 56 files changed, 2505 insertions(+), 2234 deletions(-) diff --git a/R/processCapabilityStudies.R b/R/processCapabilityStudies.R index 7d36091e..75f4868d 100644 --- a/R/processCapabilityStudies.R +++ b/R/processCapabilityStudies.R @@ -678,14 +678,29 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { plotData <- data.frame(x = allData) sdo <- sd(allData, na.rm = TRUE) - xBreaks <- jaspGraphs::getPrettyAxisBreaks(c(plotData[["x"]], min(plotData[["x"]]) - 1 * sdo, max(plotData[["x"]]) + 1 * sdo), min.n = 4) - xLimits <- range(xBreaks) + xLimits <- c(min(allData) - sdo, max(allData) + sdo) if (options[["lowerSpecificationLimit"]] && options[["processCapabilityPlotSpecificationLimits"]]) - xLimits <- range(xLimits, options[["lowerSpecificationLimitValue"]]) + xLimits <- range(xLimits, options[["lowerSpecificationLimitValue"]] - 0.5*sdo) if (options[["upperSpecificationLimit"]] && options[["processCapabilityPlotSpecificationLimits"]]) - xLimits <- range(xLimits, options[["upperSpecificationLimitValue"]]) + xLimits <- range(xLimits, options[["upperSpecificationLimitValue"]] + 0.5*sdo) if (options[["target"]] && options[["processCapabilityPlotSpecificationLimits"]]) - xLimits <- range(xLimits, options[["target"]]) + xLimits <- range(xLimits, options[["targetValue"]]) + + if (distribution == "normal" && options[["historicalMean"]]) + xLimits <- range(xLimits, options[["historicalMeanValue"]] - 2 * sdo, options[["historicalMeanValue"]] + 2 * sdo) + # if (distribution == "weibull" || distribution == "3ParameterWeibull" && options[["historicalShape"]]) + # xLimits <- range(xLimits, options[["historicalShapeValue"]]) + + + # Get xBreaks based on the data, with an axis that also spans the limits + xBreaks <- jaspGraphs::getPrettyAxisBreaks(c(allData)) + xStep <- diff(xBreaks)[1] + loExt <- min(xBreaks) - pmax(0, ceiling((min(xBreaks) - min(xLimits)) / xStep) * xStep) + hiExt <- max(xBreaks) + pmax(0, ceiling((max(xLimits) - max(xBreaks)) / xStep) * xStep) + xBreaks <- seq(loExt, hiExt, by = xStep) + # Get limits to always include all breaks + xLimits <- range(xLimits, xBreaks) + nBins <- options[["processCapabilityPlotBinNumber"]] h <- hist(allData, plot = FALSE, breaks = nBins) diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process1-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process1-subplot-1.svg index 5cfd3a50..15f03966 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process1-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process1-subplot-1.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process12-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process12-subplot-1.svg index 52991c9e..bfea874c 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process12-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process12-subplot-1.svg @@ -27,31 +27,33 @@ - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -60,20 +62,22 @@ - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process12-subplot-2.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process12-subplot-2.svg index c1531d3b..79f8a6e0 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process12-subplot-2.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process12-subplot-2.svg @@ -27,31 +27,33 @@ - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -60,20 +62,22 @@ - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process12-subplot-3.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process12-subplot-3.svg index d31ec0f5..888a86b8 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process12-subplot-3.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process12-subplot-3.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process13-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process13-subplot-1.svg index babbb397..f48cefa9 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process13-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process13-subplot-1.svg @@ -27,53 +27,57 @@ - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 - + - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process13-subplot-2.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process13-subplot-2.svg index 47b7469f..d66633e2 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process13-subplot-2.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process13-subplot-2.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process14-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process14-subplot-1.svg index e86849aa..9e998722 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process14-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process14-subplot-1.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process16-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process16-subplot-1.svg index 8cbedfb8..644d94af 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process16-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process16-subplot-1.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process17-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process17-subplot-1.svg index 49823fe1..d9919b42 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process17-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process17-subplot-1.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process18-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process18-subplot-1.svg index edb83016..8cdb87b4 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process18-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process18-subplot-1.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LB = 0 - -UB = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LB = 0 + +UB = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process19-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process19-subplot-1.svg index c17625ba..38bb326e 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process19-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process19-subplot-1.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process2-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process2-subplot-1.svg index 928be8b4..186edd56 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process2-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process2-subplot-1.svg @@ -27,53 +27,57 @@ - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 - + - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process2-subplot-2.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process2-subplot-2.svg index cc299645..8f0567c4 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process2-subplot-2.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process2-subplot-2.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process20-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process20-subplot-1.svg index 9ab5e607..c3c494d3 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process20-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process20-subplot-1.svg @@ -27,31 +27,33 @@ - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -60,20 +62,22 @@ - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process20-subplot-2.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process20-subplot-2.svg index 03f9e3a5..83b715f9 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process20-subplot-2.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process20-subplot-2.svg @@ -27,60 +27,82 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + Target = 6 - -LSL = 0 - -USL = 12 - + +LSL = 0 + +USL = 12 + - - + + + + + + + - - + + + + + + -2 -4 +-1 +0 +1 +2 +3 +4 +5 6 -8 -10 -12 +7 +8 +9 +10 +11 +12 +13 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process20-subplot-3.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process20-subplot-3.svg index 79fde95c..e2f4747b 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process20-subplot-3.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process20-subplot-3.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process3-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process3-subplot-1.svg index 5701386e..72a847fe 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process3-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process3-subplot-1.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process4-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process4-subplot-1.svg index 928be8b4..186edd56 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process4-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process4-subplot-1.svg @@ -27,53 +27,57 @@ - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 - + - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process4-subplot-2.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process4-subplot-2.svg index cc299645..8f0567c4 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process4-subplot-2.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process4-subplot-2.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process5-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process5-subplot-1.svg index 33a15c98..5e5148c5 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process5-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process5-subplot-1.svg @@ -27,30 +27,32 @@ - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -59,20 +61,22 @@ - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process5-subplot-2.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process5-subplot-2.svg index 558f8007..add6108e 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process5-subplot-2.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process5-subplot-2.svg @@ -27,32 +27,34 @@ - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -61,22 +63,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process6-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process6-subplot-1.svg index 3c6281bc..b990e906 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process6-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process6-subplot-1.svg @@ -27,30 +27,32 @@ - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -59,20 +61,22 @@ - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process6-subplot-2.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process6-subplot-2.svg index da4c48e6..40d280c6 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process6-subplot-2.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process6-subplot-2.svg @@ -27,32 +27,34 @@ - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -61,22 +63,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process7-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process7-subplot-1.svg index b85b529a..82d17e1b 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process7-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process7-subplot-1.svg @@ -27,30 +27,32 @@ - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -59,20 +61,22 @@ - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process7-subplot-2.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process7-subplot-2.svg index cc4df7fd..9607ba86 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process7-subplot-2.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process7-subplot-2.svg @@ -27,32 +27,34 @@ - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -61,22 +63,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process8-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process8-subplot-1.svg index 2607d1b7..96835c8f 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process8-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process8-subplot-1.svg @@ -27,52 +27,56 @@ - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 - + - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process8-subplot-2.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process8-subplot-2.svg index c281d977..f701f321 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process8-subplot-2.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process8-subplot-2.svg @@ -27,32 +27,34 @@ - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -61,22 +63,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process9-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process9-subplot-1.svg index 30fc8874..0043d17f 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process9-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process9-subplot-1.svg @@ -27,53 +27,57 @@ - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 - + - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process9-subplot-2.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process9-subplot-2.svg index cc299645..8f0567c4 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process9-subplot-2.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-process9-subplot-2.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw1-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw1-subplot-1.svg index d241e967..88e8de84 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw1-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw1-subplot-1.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw10-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw10-subplot-1.svg index b97b1e45..2d1bd999 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw10-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw10-subplot-1.svg @@ -27,53 +27,57 @@ - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 - + - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw10-subplot-2.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw10-subplot-2.svg index fac7c4e6..f986d8cb 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw10-subplot-2.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw10-subplot-2.svg @@ -27,31 +27,33 @@ - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -60,20 +62,22 @@ - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw10-subplot-3.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw10-subplot-3.svg index 71ec7d33..12e5af6a 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw10-subplot-3.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw10-subplot-3.svg @@ -27,60 +27,82 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + Target = 6 - -LSL = 0 - -USL = 12 - + +LSL = 0 + +USL = 12 + - - + + + + + + + - - + + + + + + -2 -4 +-1 +0 +1 +2 +3 +4 +5 6 -8 -10 -12 +7 +8 +9 +10 +11 +12 +13 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw12-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw12-subplot-1.svg index b57b2306..733d3c88 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw12-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw12-subplot-1.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw14-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw14-subplot-1.svg index 02402de9..3c439432 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw14-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw14-subplot-1.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LB = 0 - -UB = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LB = 0 + +UB = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw15-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw15-subplot-1.svg index 50ebbbd1..fbd9a0ee 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw15-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw15-subplot-1.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw2-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw2-subplot-1.svg index 7e5087a5..c2b1a849 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw2-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw2-subplot-1.svg @@ -27,31 +27,33 @@ - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -60,20 +62,22 @@ - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw2-subplot-2.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw2-subplot-2.svg index 059bc10b..7344d5ae 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw2-subplot-2.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw2-subplot-2.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw3-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw3-subplot-1.svg index fd4847a2..42ad7548 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw3-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw3-subplot-1.svg @@ -27,32 +27,34 @@ - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -61,22 +63,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw4-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw4-subplot-1.svg index f0c6314c..2ea61a06 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw4-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw4-subplot-1.svg @@ -27,32 +27,34 @@ - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -61,22 +63,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw5-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw5-subplot-1.svg index f268f920..e255c535 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw5-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw5-subplot-1.svg @@ -27,32 +27,34 @@ - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -61,22 +63,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw6-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw6-subplot-1.svg index dd5f6b7e..0eb54d20 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw6-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw6-subplot-1.svg @@ -27,32 +27,34 @@ - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -61,22 +63,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw7-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw7-subplot-1.svg index 31293634..27c9d124 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw7-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processw7-subplot-1.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report21-subplot-7.svg b/tests/testthat/_snaps/processCapabilityStudies/process-capability-report21-subplot-7.svg index 40127d70..a2a84f4f 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report21-subplot-7.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/process-capability-report21-subplot-7.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report22-subplot-4.svg b/tests/testthat/_snaps/processCapabilityStudies/process-capability-report22-subplot-4.svg index cc299645..8f0567c4 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report22-subplot-4.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/process-capability-report22-subplot-4.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report22-subplot-9.svg b/tests/testthat/_snaps/processCapabilityStudies/process-capability-report22-subplot-9.svg index 928be8b4..186edd56 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report22-subplot-9.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/process-capability-report22-subplot-9.svg @@ -27,53 +27,57 @@ - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 - + - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report23-subplot-4.svg b/tests/testthat/_snaps/processCapabilityStudies/process-capability-report23-subplot-4.svg index 558f8007..add6108e 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report23-subplot-4.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/process-capability-report23-subplot-4.svg @@ -27,32 +27,34 @@ - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -61,22 +63,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report23-subplot-9.svg b/tests/testthat/_snaps/processCapabilityStudies/process-capability-report23-subplot-9.svg index 33a15c98..5e5148c5 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report23-subplot-9.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/process-capability-report23-subplot-9.svg @@ -27,30 +27,32 @@ - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -59,20 +61,22 @@ - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report24-subplot-5.svg b/tests/testthat/_snaps/processCapabilityStudies/process-capability-report24-subplot-5.svg index 36fe77a8..d3bfdcbe 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report24-subplot-5.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/process-capability-report24-subplot-5.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw16-subplot-7.svg b/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw16-subplot-7.svg index 67f3d608..4ef1a80b 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw16-subplot-7.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw16-subplot-7.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw17-subplot-4.svg b/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw17-subplot-4.svg index 059bc10b..7344d5ae 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw17-subplot-4.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw17-subplot-4.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw17-subplot-9.svg b/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw17-subplot-9.svg index 7e5087a5..c2b1a849 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw17-subplot-9.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw17-subplot-9.svg @@ -27,31 +27,33 @@ - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -60,20 +62,22 @@ - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw18-subplot-4.svg b/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw18-subplot-4.svg index 06dcf563..3e8d4030 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw18-subplot-4.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw18-subplot-4.svg @@ -27,32 +27,34 @@ - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -61,22 +63,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw18-subplot-9.svg b/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw18-subplot-9.svg index e7e8021c..8e0668bd 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw18-subplot-9.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw18-subplot-9.svg @@ -27,30 +27,32 @@ - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -59,20 +61,22 @@ - - - - - - + + + + + + + -0 -2 -4 -6 -8 -10 -12 +-2 +0 +2 +4 +6 +8 +10 +12 14 Measurement Density diff --git a/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw19-subplot-5.svg b/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw19-subplot-5.svg index c1f341a1..8483b074 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw19-subplot-5.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw19-subplot-5.svg @@ -27,33 +27,35 @@ - - - - - - - - - - - - - - - - - - - - - - -Target = 6 - -LSL = 0 - -USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 @@ -62,22 +64,24 @@ - - - - - - - + + + + + + + + -0 -2 -4 -6 -8 -10 -12 -14 +-2 +0 +2 +4 +6 +8 +10 +12 +14 16 Measurement Density From 39d8cfbd7e9d3ebaff907940c63e3495c68c4baf Mon Sep 17 00:00:00 2001 From: JTPetter Date: Wed, 3 Dec 2025 16:36:54 +0100 Subject: [PATCH 7/9] Rule to consider hist. dist. in xlimits --- R/processCapabilityStudies.R | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/R/processCapabilityStudies.R b/R/processCapabilityStudies.R index 75f4868d..919a8bf5 100644 --- a/R/processCapabilityStudies.R +++ b/R/processCapabilityStudies.R @@ -686,11 +686,16 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { if (options[["target"]] && options[["processCapabilityPlotSpecificationLimits"]]) xLimits <- range(xLimits, options[["targetValue"]]) + # Addition to consider that if distributions are set historically, they may fall outside the usual limits if (distribution == "normal" && options[["historicalMean"]]) - xLimits <- range(xLimits, options[["historicalMeanValue"]] - 2 * sdo, options[["historicalMeanValue"]] + 2 * sdo) - # if (distribution == "weibull" || distribution == "3ParameterWeibull" && options[["historicalShape"]]) - # xLimits <- range(xLimits, options[["historicalShapeValue"]]) - + xLimits <- range(xLimits, options[["historicalMeanValue"]] - 1.5 * sdo, options[["historicalMeanValue"]] + 1.5 * sdo) + if (distribution == "weibull" || distribution == "3ParameterWeibull" && options[["historicalShape"]]) { + weibullCenterEstimate <- sdo * (options[["historicalShapeValue"]] + 1) + xLimits <- range(xLimits, weibullCenterEstimate - 1.5 * sdo, weibullCenterEstimate + 1.5 * sdo) + } + if (distribution == "lognormal" || distribution == "3ParameterLognormal" && options[["historicalLogMean"]]) + xLimits <- range(xLimits, exp(options[["historicalLogMeanValue"]]) - 1.5 * sdo, + exp(options[["historicalLogMeanValue"]]) + 1.5 * sdo) # Get xBreaks based on the data, with an axis that also spans the limits xBreaks <- jaspGraphs::getPrettyAxisBreaks(c(allData)) From 16fb0dcbcdcb0becdb5698ab58025c29bee5b62f Mon Sep 17 00:00:00 2001 From: JTPetter Date: Thu, 4 Dec 2025 17:59:17 +0100 Subject: [PATCH 8/9] Unit tests part 1 --- R/processCapabilityStudies.R | 6 +- ...capability-of-the-processl25-subplot-1.svg | 100 ++++ ...capability-of-the-processl26-subplot-1.svg | 100 ++++ ...capability-of-the-processl27-subplot-1.svg | 156 ++++++ ...capability-of-the-processl28-subplot-1.svg | 94 ++++ ...capability-of-the-processl29-subplot-1.svg | 94 ++++ ...capability-of-the-processl30-subplot-1.svg | 98 ++++ ...capability-of-the-processl31-subplot-1.svg | 94 ++++ ...capability-of-the-processl32-subplot-1.svg | 94 ++++ ...capability-of-the-processl33-subplot-1.svg | 178 +++++++ .../testthat/test-processCapabilityStudies.R | 483 ++++++++++++++++++ 11 files changed, 1493 insertions(+), 4 deletions(-) create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl25-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl26-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl27-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl28-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl29-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl30-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl31-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl32-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl33-subplot-1.svg diff --git a/R/processCapabilityStudies.R b/R/processCapabilityStudies.R index 919a8bf5..0c87eb22 100644 --- a/R/processCapabilityStudies.R +++ b/R/processCapabilityStudies.R @@ -689,10 +689,8 @@ processCapabilityStudies <- function(jaspResults, dataset, options) { # Addition to consider that if distributions are set historically, they may fall outside the usual limits if (distribution == "normal" && options[["historicalMean"]]) xLimits <- range(xLimits, options[["historicalMeanValue"]] - 1.5 * sdo, options[["historicalMeanValue"]] + 1.5 * sdo) - if (distribution == "weibull" || distribution == "3ParameterWeibull" && options[["historicalShape"]]) { - weibullCenterEstimate <- sdo * (options[["historicalShapeValue"]] + 1) - xLimits <- range(xLimits, weibullCenterEstimate - 1.5 * sdo, weibullCenterEstimate + 1.5 * sdo) - } + if (distribution == "weibull" || distribution == "3ParameterWeibull" && options[["historicalScale"]]) + xLimits <- range(xLimits, options[["historicalScaleValue"]] - 1.5 * sdo, options[["historicalScaleValue"]] + 1.5 * sdo) if (distribution == "lognormal" || distribution == "3ParameterLognormal" && options[["historicalLogMean"]]) xLimits <- range(xLimits, exp(options[["historicalLogMeanValue"]]) - 1.5 * sdo, exp(options[["historicalLogMeanValue"]]) + 1.5 * sdo) diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl25-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl25-subplot-1.svg new file mode 100644 index 00000000..0ae80ded --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl25-subplot-1.svg @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + + + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement +Density + + + + + + +Normal dist. +(std. dev. total) +Normal dist. +(std. dev. within) +capability-of-the-processL25-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl26-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl26-subplot-1.svg new file mode 100644 index 00000000..9d480fb4 --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl26-subplot-1.svg @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + + + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement +Density + + + + + + +Normal dist. +(std. dev. total) +Normal dist. +(std. dev. within) +capability-of-the-processL26-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl27-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl27-subplot-1.svg new file mode 100644 index 00000000..df2918c5 --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl27-subplot-1.svg @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +18 +20 +22 +24 +26 +28 +30 +32 +34 +36 +38 +40 +42 +44 +Measurement +Density + + + + + + +Normal dist. +(std. dev. total) +Normal dist. +(std. dev. within) +capability-of-the-processL27-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl28-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl28-subplot-1.svg new file mode 100644 index 00000000..5810bf96 --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl28-subplot-1.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + + + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement +Density + + + + +Weibull dist. +capability-of-the-processL28-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl29-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl29-subplot-1.svg new file mode 100644 index 00000000..bd82ac24 --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl29-subplot-1.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + + + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement +Density + + + + +Weibull dist. +capability-of-the-processL29-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl30-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl30-subplot-1.svg new file mode 100644 index 00000000..79331f06 --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl30-subplot-1.svg @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + + + + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +18 +Measurement +Density + + + + +Weibull dist. +capability-of-the-processL30-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl31-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl31-subplot-1.svg new file mode 100644 index 00000000..1738c948 --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl31-subplot-1.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + + + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement +Density + + + + +Lognormal dist. +capability-of-the-processL31-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl32-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl32-subplot-1.svg new file mode 100644 index 00000000..d586ae16 --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl32-subplot-1.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + + + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement +Density + + + + +Lognormal dist. +capability-of-the-processL32-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl33-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl33-subplot-1.svg new file mode 100644 index 00000000..a8109edb --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl33-subplot-1.svg @@ -0,0 +1,178 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +18 +20 +22 +24 +26 +28 +30 +32 +34 +36 +38 +40 +42 +44 +46 +48 +50 +52 +54 +56 +58 +Measurement +Density + + + + +Lognormal dist. +capability-of-the-processL33-subplot-1 + + diff --git a/tests/testthat/test-processCapabilityStudies.R b/tests/testthat/test-processCapabilityStudies.R index ffba70d1..c2a551f0 100644 --- a/tests/testthat/test-processCapabilityStudies.R +++ b/tests/testthat/test-processCapabilityStudies.R @@ -1708,6 +1708,489 @@ test_that("LF24 (Normal) Basic test of report functionality with removed element jaspTools::expect_equal_plots(testPlot, "process-capability-report24") }) + +## Test of historical parameter settings #### + +### Normal distribution with one historical param. (verified with other software) #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "normalCapabilityAnalysis" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 0 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalMean <- TRUE +options$historicalMeanValue <- 6 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF25.1 Normal distribution with one historical param. - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL25") +}) + +test_that("LF25.2 Normal distribution with one historical param. - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis_capabilityTableOverall"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0.93, 0.83, 1.04, 1.08, 1.08, 0.94, 1.21, 1.08, 0.95, 1.08, 1.2 + )) +}) + +test_that("LF25.3 Normal distribution with one historical param. - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis_capabilityTablePerformance"]][["data"]] + jaspTools::expect_equal_tables(table, + list(614.34, 586.56, 0, "ppm < LSL", 614.34, 586.56, 10000, "ppm > USL", + 1228.68, 1173.12, 10000, "ppm total")) +}) + +test_that("LF25.4 Normal distribution with one historical param. - Process capability (within) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis_capabilityTableWithin"]][["data"]] + jaspTools::expect_equal_tables(table, + list(1.08, 1.08, 0.94, 1.23, 1.08, 0.94, 1.08, 1.22)) +}) + +test_that("LF25.5 Normal distribution with one historical param. - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis_processSummaryTable"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0, 6, 100, 1.85635681000733, 1.84880707556386, 6, 12)) +}) + +### Normal distribution with all historical param. (verified with other software) #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "normalCapabilityAnalysis" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 0 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalMean <- TRUE +options$historicalMeanValue <- 6 +options$historicalStdDev <- TRUE +options$historicalStdDevValue <- 3 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF26.1 Normal distribution with all historical param. - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL26") +}) + +test_that("LF26.2 Normal distribution with all historical param. - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis_capabilityTableOverall"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0.93, 0.83, 1.04, 1.08, 1.08, 0.94, 1.21, 1.08, 0.95, 1.08, 1.2 + )) +}) + +test_that("LF26.3 Normal distribution with all historical param. - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis_capabilityTablePerformance"]][["data"]] + jaspTools::expect_equal_tables(table, + list(614.34, 22750.13, 0, "ppm < LSL", 614.34, 22750.13, 10000, + "ppm > USL", 1228.68, 45500.26, 10000, "ppm total")) +}) + +test_that("LF26.4 Normal distribution with all historical param. - Process capability (within) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis_capabilityTableWithin"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0.67, 0.67, 0.57, 0.77, 0.67, 0.58, 0.67, 0.75)) +}) + +test_that("LF26.5 Normal distribution with all historical param. - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis_processSummaryTable"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0, 6, 100, 1.85635681000733, 3, 6, 12)) +}) + +### Normal distribution with mismatching historical dist. (verified with other software) #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "normalCapabilityAnalysis" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 0 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalMean <- TRUE +options$historicalMeanValue <- 40 +options$historicalStdDev <- TRUE +options$historicalStdDevValue <- 15 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF27.1 Normal distribution with mismatching historical dist. - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL27") +}) + +test_that("LF27.2 Normal distribution with mismatching historical dist. - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis_capabilityTableOverall"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0.93, 0.93, 0.94, 1.08, -5.03, -5.62, -4.44, 7.18, 0.95, -5.03, + 1.2)) +}) + +test_that("LF27.3 Normal distribution with mismatching historical dist. - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis_capabilityTablePerformance"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0, 3830.38, 0, "ppm < LSL", 1e+06, 969025.92, 10000, "ppm > USL", + 1e+06, 972856.3, 10000, "ppm total")) +}) + +test_that("LF27.4 Normal distribution with mismatching historical dist. - Process capability (within) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis_capabilityTableWithin"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0.13, -0.62, -0.72, -0.53, 0.89, 0.12, -0.62, 0.15)) +}) + +test_that("LF27.5 Normal distribution with mismatching historical dist. - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_normalCapabilityAnalysis_processSummaryTable"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0, 40, 100, 1.85635681000733, 15, 6, 12)) +}) + +### Weibull distribution with one historical param. (verified with other software) #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "weibull" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 0 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalShape <- TRUE +options$historicalShapeValue <- 6 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF28.1 Weibull distribution with one historical param. - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0, 0, "ppm < LSL", 1.53, 10000, "ppm > USL", 1.53, 10000, + "Total ppm")) +}) + +test_that("LF28.2 Weibull distribution with one historical param. - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL28") +}) + +test_that("LF28.3 Weibull distribution with one historical param. - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list("", 1.56, "", 1.56)) +}) + +test_that("LF28.4 Weibull distribution with one historical param. - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(6, 0, 7.08, 100, 1.85635681000733, 6, 7.78727631111372, 12)) +}) + +### Weibull distribution with all historical param. (verified with other software) #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "weibull" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 0 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalShape <- TRUE +options$historicalShapeValue <- 6 +options$historicalScale <- TRUE +options$historicalScaleValue <- 10 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF29.1 Weibull distribution with all historical param. - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0, 0, "ppm < LSL", 50489.8, 10000, "ppm > USL", 50489.8, + 10000, "Total ppm")) +}) + +test_that("LF29.2 Weibull distribution with all historical param. - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL29") +}) + +test_that("LF29.3 Weibull distribution with all historical param. - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list("", 0.55, "", 0.55)) +}) + +test_that("LF29.4 Weibull distribution with all historical param. - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(6, 0, 7.08, 100, 1.85635681000733, 6, 10, 12)) +}) + +### Weibull distribution with mismatching historical dist. (verified with other software) #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "weibull" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 0 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalShape <- TRUE +options$historicalShapeValue <- 40 +options$historicalScale <- TRUE +options$historicalScaleValue <- 15 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF30.1 Weibull distribution with mismatching historical dist. - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0, 0, "ppm < LSL", 999867.09, 10000, "ppm > USL", 999867.09, + 10000, "Total ppm")) +}) + +test_that("LF30.2 Weibull distribution with mismatching historical dist. - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL30") +}) + +test_that("LF30.3 Weibull distribution with mismatching historical dist. - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list("", -1.22, "", -1.22)) +}) + +test_that("LF30.4 Weibull distribution with mismatching historical dist. - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(40, 0, 7.08, 100, 1.85635681000733, 6, 15, 12)) +}) + +### Lognormal distribution with one historical param. (verified with other software) #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "lognormal" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 0 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalLogMean <- TRUE +options$historicalLogMeanValue <- 2 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF31.1 Lognormal distribution with one historical param. - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0, 0, "ppm < LSL", 37860.93, 10000, "ppm > USL", 37860.93, + 10000, "Total ppm")) +}) + +test_that("LF31.2 Lognormal distribution with one historical param. - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL31") +}) + +test_that("LF31.3 Lognormal distribution with one historical param. - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list("", 0.59, "", 0.59)) +}) + +test_that("LF31.4 Lognormal distribution with one historical param. - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(2, 0, 7.08, 100, 1.85635681000733, 6, 0.273022707246043, 12)) +}) + +### Lognormal distribution with all historical param. (verified with other software) #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "lognormal" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 0 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalLogMean <- TRUE +options$historicalLogMeanValue <- 2 +options$historicalLogStdDev <- TRUE +options$historicalLogStdDevValue <- 0.3 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF32.1 Lognormal distribution with all historical param. - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0, 0, "ppm < LSL", 53008.74, 10000, "ppm > USL", 53008.74, + 10000, "Total ppm")) +}) + +test_that("LF32.2 Lognormal distribution with all historical param. - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL32") +}) + +test_that("LF32.3 Lognormal distribution with all historical param. - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list("", 0.54, "", 0.54)) +}) + +test_that("LF32.4 Lognormal distribution with all historical param. - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(2, 0, 7.08, 100, 1.85635681000733, 6, 0.3, 12)) +}) + +### Lognormal distribution with mismatching historical dist. (verified with other software) #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "lognormal" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 0 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalLogMean <- TRUE +options$historicalLogMeanValue <- 4 +options$historicalLogStdDev <- TRUE +options$historicalLogStdDevValue <- 0.5 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF33.1 Lognormal distribution with mismatching historical dist. - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0, 0, "ppm < LSL", 998777.99, 10000, "ppm > USL", 998777.99, + 10000, "Total ppm")) +}) + +test_that("LF33.2 Lognormal distribution with mismatching historical dist. - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL33") +}) + +test_that("LF33.3 Lognormal distribution with mismatching historical dist. - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list("", -1.01, "", -1.01)) +}) + +test_that("LF33.4 Lognormal distribution with mismatching historical dist. - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(4, 0, 7.08, 100, 1.85635681000733, 6, 0.5, 12)) +}) + +### 3-Parameter-Weibull distribution with one historical param. (verified with other software) #### + +### 3-Parameter-Weibull distribution with all historical param. (verified with other software) #### + +### 3-Parameter-Weibull distribution with mismatching historical dist. (verified with other software) #### + +### 3-Parameter-Lognormal distribution with one historical param. (verified with other software) #### + +### 3-Parameter-Lognormal distribution with all historical param. (verified with other software) #### + +### 3-Parameter-Lognormal distribution with mismatching historical dist. (verified with other software) #### + # Wide / Row format #### ## (Normal) Basic tests #### From 6920060f7d9d00380bdfaab475243a00ef82f95c Mon Sep 17 00:00:00 2001 From: JTPetter Date: Fri, 5 Dec 2025 16:46:14 +0100 Subject: [PATCH 9/9] Finalize unit tests and add help files --- inst/help/processCapabilityStudies.md | 1 + ...capability-of-the-processl34-subplot-1.svg | 94 ++++++ ...capability-of-the-processl35-subplot-1.svg | 94 ++++++ ...capability-of-the-processl36-subplot-1.svg | 98 ++++++ ...capability-of-the-processl37-subplot-1.svg | 95 ++++++ ...capability-of-the-processl38-subplot-1.svg | 99 ++++++ ...capability-of-the-processl39-subplot-1.svg | 179 +++++++++++ .../testthat/test-processCapabilityStudies.R | 300 ++++++++++++++++++ 8 files changed, 960 insertions(+) create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl34-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl35-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl36-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl37-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl38-subplot-1.svg create mode 100644 tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl39-subplot-1.svg diff --git a/inst/help/processCapabilityStudies.md b/inst/help/processCapabilityStudies.md index 907bff23..525ce38b 100644 --- a/inst/help/processCapabilityStudies.md +++ b/inst/help/processCapabilityStudies.md @@ -34,6 +34,7 @@ The size of the subgroups is relevant for the calculation of the process varianc - Type of data distribution: indicate whether the data approximates a normal distribution or another distribution (the most commonly used distributions are: Weibull, Lognormal, 3-parameter Weibull, and 3-parameter lognorma) - Specify a distribution: the non-normal distribution to be used. - Non-normal capability statistics: the method used to calculate the capability statistics for non-normally distributed data. + - Historical parameters: Select which parameters should use fixed historical values instead of being estimated. Note that if only some parameters are set historically, JASP currently estimates all parameters first and then replaces the selected ones with their historical values; it does not keep them fixed during estimation. #### Capability studies - Specification limits: diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl34-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl34-subplot-1.svg new file mode 100644 index 00000000..ff67e093 --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl34-subplot-1.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + + + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement +Density + + + + +3-parameter Weibull dist. +capability-of-the-processL34-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl35-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl35-subplot-1.svg new file mode 100644 index 00000000..3abb31eb --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl35-subplot-1.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + + + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement +Density + + + + +3-parameter Weibull dist. +capability-of-the-processL35-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl36-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl36-subplot-1.svg new file mode 100644 index 00000000..98d560c2 --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl36-subplot-1.svg @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + + + + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +18 +Measurement +Density + + + + +3-parameter Weibull dist. +capability-of-the-processL36-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl37-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl37-subplot-1.svg new file mode 100644 index 00000000..8b418dc9 --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl37-subplot-1.svg @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + + + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +Measurement +Density + + + + +3-parameter +lognormal dist. +capability-of-the-processL37-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl38-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl38-subplot-1.svg new file mode 100644 index 00000000..5006e982 --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl38-subplot-1.svg @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + + + + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +18 +Measurement +Density + + + + +3-parameter +lognormal dist. +capability-of-the-processL38-subplot-1 + + diff --git a/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl39-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl39-subplot-1.svg new file mode 100644 index 00000000..060becd6 --- /dev/null +++ b/tests/testthat/_snaps/processCapabilityStudies/capability-of-the-processl39-subplot-1.svg @@ -0,0 +1,179 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Target = 6 + +LSL = 0 + +USL = 12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-2 +0 +2 +4 +6 +8 +10 +12 +14 +16 +18 +20 +22 +24 +26 +28 +30 +32 +34 +36 +38 +40 +42 +44 +46 +48 +50 +52 +54 +56 +58 +Measurement +Density + + + + +3-parameter +lognormal dist. +capability-of-the-processL39-subplot-1 + + diff --git a/tests/testthat/test-processCapabilityStudies.R b/tests/testthat/test-processCapabilityStudies.R index c2a551f0..eda0039f 100644 --- a/tests/testthat/test-processCapabilityStudies.R +++ b/tests/testthat/test-processCapabilityStudies.R @@ -2180,16 +2180,316 @@ test_that("LF33.4 Lognormal distribution with mismatching historical dist. - Pro }) ### 3-Parameter-Weibull distribution with one historical param. (verified with other software) #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "3ParameterWeibull" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 0 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalThreshold <- TRUE +options$historicalThresholdValue <- 3 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF34.1 3ParameterWeibull distribution with one historical param. - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0, 0, "ppm < LSL", 11678.25, 10000, "ppm > USL", 11678.25, + 10000, "Total ppm")) +}) + +test_that("LF34.2 3ParameterWeibull distribution with one historical param. - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL34") +}) + +test_that("LF34.3 3ParameterWeibull distribution with one historical param. - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list("", 0.76, "", 0.76)) +}) + +test_that("LF34.4 3ParameterWeibull distribution with one historical param. - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(2.64846838111814, 0, 7.08, 100, 1.85635681000733, 6, 5.1219561122954, + 3, 12)) +}) ### 3-Parameter-Weibull distribution with all historical param. (verified with other software) #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "3ParameterWeibull" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 0 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalThreshold <- TRUE +options$historicalThresholdValue <- 3 +options$historicalShape <- TRUE +options$historicalShapeValue <- 2.5 +options$historicalScale <- TRUE +options$historicalScaleValue <- 5 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF35.1 3ParameterWeibull distribution with all historical param. - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0, 0, "ppm < LSL", 12946.68, 10000, "ppm > USL", 12946.68, + 10000, "Total ppm")) +}) + +test_that("LF35.2 3ParameterWeibull distribution with all historical param. - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL35") +}) + +test_that("LF35.3 3ParameterWeibull distribution with all historical param. - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list("", 0.74, "", 0.74)) +}) + +test_that("LF35.4 3ParameterWeibull distribution with all historical param. - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(2.5, 0, 7.08, 100, 1.85635681000733, 6, 5, 3, 12)) +}) ### 3-Parameter-Weibull distribution with mismatching historical dist. (verified with other software) #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "3ParameterWeibull" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 0 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalThreshold <- TRUE +options$historicalThresholdValue <- 3 +options$historicalShape <- TRUE +options$historicalShapeValue <- 16 +options$historicalScale <- TRUE +options$historicalScaleValue <- 15 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF36.1 3ParameterWeibull distribution with mismatching historical dist. - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0, 0, "ppm < LSL", 999717.93, 10000, "ppm > USL", 999717.93, + 10000, "Total ppm")) +}) + +test_that("LF36.2 3ParameterWeibull distribution with mismatching historical dist. - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL36") +}) + +test_that("LF36.3 3ParameterWeibull distribution with mismatching historical dist. - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list("", -1.15, "", -1.15)) +}) + +test_that("LF36.4 3ParameterWeibull distribution with mismatching historical dist. - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(16, 0, 7.08, 100, 1.85635681000733, 6, 15, 3, 12)) +}) ### 3-Parameter-Lognormal distribution with one historical param. (verified with other software) #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "3ParameterLognormal" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 0 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalThreshold <- TRUE +options$historicalThresholdValue <- -8 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF37.1 3ParameterLognormal distribution with one historical param. - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0.12, 0, "ppm < LSL", 9380.21, 10000, "ppm > USL", 9380.33, + 10000, "Total ppm")) +}) + +test_that("LF37.2 3ParameterLognormal distribution with one historical param. - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL37") +}) + +test_that("LF37.3 3ParameterLognormal distribution with one historical param. - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(1.25, 0.78, 1.72, 0.78)) +}) + +test_that("LF37.4 3ParameterLognormal distribution with one historical param. - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(2.70930280255199, 0, 7.08, 100, 1.85635681000733, 6, 0.121871527001624, + -8, 12)) +}) ### 3-Parameter-Lognormal distribution with all historical param. (verified with other software) #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "3ParameterLognormal" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 0 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalLogMean <- TRUE +options$historicalLogMeanValue <- 2.7 +options$historicalLogStdDev <- TRUE +options$historicalLogStdDevValue <- 0.12 +options$historicalThreshold <- TRUE +options$historicalThresholdValue <- -8 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF38.1 3ParameterLognormal distribution with all historical param. - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0.12, 0, "ppm < LSL", 6861.46, 10000, "ppm > USL", 6861.58, + 10000, "Total ppm")) +}) + +test_that("LF38.2 3ParameterLognormal distribution with all historical param. - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL38") +}) + +test_that("LF38.3 3ParameterLognormal distribution with all historical param. - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(1.27, 0.82, 1.72, 0.82)) +}) + +test_that("LF38.4 3ParameterLognormal distribution with all historical param. - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(2.7, 0, 7.08, 100, 1.85635681000733, 6, 0.12, -8, 12)) +}) ### 3-Parameter-Lognormal distribution with mismatching historical dist. (verified with other software) #### +options <- analysisOptions("processCapabilityStudies") +options$measurementLongFormat <- "Diameter" +options$subgroupSizeType <- "manual" +options$manualSubgroupSizeValue <- 5 +options$capabilityStudyType <- "nonNormalCapabilityAnalysis" +options$nonNormalDistribution <- "3ParameterLognormal" +options$nonNormalMethod <- "nonConformance" +options$controlChartSdEstimationMethodGroupSizeLargerThanOne <- "sBar" +options$controlChart <- FALSE +options$histogram <- FALSE +options$probabilityPlot <- FALSE +options$lowerSpecificationLimit <- TRUE +options$target <- TRUE +options$upperSpecificationLimit <- TRUE +options$lowerSpecificationLimitValue <- 0 +options$targetValue <- 6 +options$upperSpecificationLimitValue <- 12 +options$historicalLogMean <- TRUE +options$historicalLogMeanValue <- 4 +options$historicalLogStdDev <- TRUE +options$historicalLogStdDevValue <- 0.12 +options$historicalThreshold <- TRUE +options$historicalThresholdValue <- -8 +set.seed(1) +results <- runAnalysis("processCapabilityStudies", + "datasets/processCapabilityStudy/processCapabilityAnalysisLongFormatDebug.csv", options) + +test_that("LF39.1 3ParameterLognormal distribution with mismatching historical dist. - Non-conformance statistics table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_PerformanceNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0, 0, "ppm < LSL", 1e+06, 10000, "ppm > USL", 1e+06, 10000, + "Total ppm")) +}) + +test_that("LF39.2 3ParameterLognormal distribution with mismatching historical dist. - Capability of the process plot matches", { + plotName <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_capabilityPlot"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "capability-of-the-processL39") +}) + +test_that("LF39.3 3ParameterLognormal distribution with mismatching historical dist. - Process performance (total) table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_overallCapabilityNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(1.27, -2.79, 5.33, -2.79)) +}) + +test_that("LF39.4 3ParameterLognormal distribution with mismatching historical dist. - Process summary table results match", { + table <- results[["results"]][["capabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis"]][["collection"]][["capabilityAnalysis_nonNormalCapabilityAnalysis_summaryTableNonNormal"]][["data"]] + jaspTools::expect_equal_tables(table, + list(4, 0, 7.08, 100, 1.85635681000733, 6, 0.12, -8, 12)) +}) # Wide / Row format ####