diff --git a/DESCRIPTION b/DESCRIPTION index 2f5769a5..02fbea40 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -23,6 +23,7 @@ Imports: ggrepel, goftest, ggpp, + emmeans, irr, jaspBase, jaspDescriptives, diff --git a/R/doeAnalysis.R b/R/doeAnalysis.R index bc4cd1f7..8cb6733b 100644 --- a/R/doeAnalysis.R +++ b/R/doeAnalysis.R @@ -102,9 +102,17 @@ doeAnalysis <- function(jaspResults, dataset, options, ...) { .doeAnalysisCheckErrors(dataset, options, continuousPredictors, discretePredictors, blocks, covariates, dependent, ready) - # Create containers for response variable(s) - for (dep in dependent) { - jaspResults[[dep]] <- createJaspContainer(title = dep) + # Create containers for response variable(s). Persist across invocations so + # display-only option changes (e.g. plot CI width) do not wipe the cached + # model fit. Low position keeps model output above the factorial plots (12). + for (depIdx in seq_along(dependent)) { + dep <- dependent[[depIdx]] + if (is.null(jaspResults[[dep]])) { + modelContainer <- createJaspContainer(title = dep) + modelContainer$dependOn(options = .doeAnalysisBaseDependencies()) + modelContainer$position <- depIdx + jaspResults[[dep]] <- modelContainer + } } p <- try(.doeAnalysisMakeState(jaspResults, dataset, options, continuousPredictors, discretePredictors, blocks, covariates, dependent, stepwiseMethod, ready)) @@ -126,6 +134,7 @@ doeAnalysis <- function(jaspResults, dataset, options, ...) { .doeAnalysisStepwiseTable(jaspResults, dependent, options, ready, coded, stepwiseMethod) .doeAnalysisPlotPareto(jaspResults, dependent, options, blocks, covariates, ready) .doeAnalysisPlotEffectNormalDistribution(jaspResults, dependent, options, blocks, covariates, ready) + .doeAnalysisPlotFactorialPlots(jaspResults, dependent, options, ready) .doeAnalysisPlotQQResiduals(jaspResults, dependent, options, ready) .doeAnalysisPlotHistResiduals(jaspResults, dependent, options, ready) .doeAnalysisPlotFittedVsResiduals(jaspResults, dependent, options, ready) @@ -186,6 +195,10 @@ doeAnalysis <- function(jaspResults, dataset, options, ...) { } for (dep in dependent) { + # Skip refit when the cached fit survived (base deps unchanged) + if (!is.null(jaspResults[[dep]][["doeResult"]])) + next + currentDependent <- dep result <- list() @@ -1523,7 +1536,7 @@ get_levels <- function(var, num_levels, dataset) { .doeAnalysisAnovaTable <- function(jaspResults, dependent, options, ready, coded) { for (dep in dependent) { - if (!is.null(jaspResults[["tableAnova"]])) { + if (!is.null(jaspResults[[dep]][["tableAnova"]])) { return() } @@ -1914,6 +1927,521 @@ get_levels <- function(var, num_levels, dataset) { } } +.doeAnalysisPlotFactorCandidates <- function(options, model = NULL) { + # Collect candidate factors from the active design mode. + if (options[["designType"]] == "factorialDesign") { + factors <- c(unlist(options[["fixedFactorsFactorial"]]), unlist(options[["continuousFactorsFactorial"]])) + } else { + factors <- c(unlist(options[["fixedFactorsResponseSurface"]]), unlist(options[["continuousFactorsResponseSurface"]])) + } + + factors <- factors[factors != ""] + factors <- unique(factors) + + if (!is.null(model)) { + modelVars <- colnames(model$model) + responseVars <- all.vars(stats::formula(model)[[2]]) + predictorVars <- setdiff(modelVars, responseVars) + factors <- factors[factors %in% predictorVars] + + # Fallback for encoded/renamed predictor columns in the model frame. + if (length(factors) == 0) { + factors <- predictorVars + } + } + + return(factors) +} + +.doeAnalysisPlotFactorType <- function(factorName, options) { + continuousFactors <- if (options[["designType"]] == "factorialDesign") { + options[["continuousFactorsFactorial"]] + } else { + options[["continuousFactorsResponseSurface"]] + } + + if (factorName %in% continuousFactors) { + return("continuous") + } + + return("discrete") +} + +.doeAnalysisPlotFactorValues <- function(model, factorName, factorType, gridResolution = 51, outerLimitsOnly = FALSE) { + values <- model.frame(model)[[factorName]] + + if (factorType == "continuous") { + numericValues <- suppressWarnings(as.numeric(values)) + numericValues <- numericValues[is.finite(numericValues)] + + if (length(numericValues) == 0) { + return(numeric()) + } + + if (outerLimitsOnly) { + return(sort(unique(range(numericValues)))) + } + + if (length(unique(numericValues)) == 1) { + return(unique(numericValues)) + } + + return(seq(min(numericValues), max(numericValues), length.out = gridResolution)) + } + + if (is.factor(values)) { + return(levels(values)) + } + + return(unique(values)) +} + +.doeAnalysisInteractionPlotOrder <- function(factorA, factorB, options) { + typeA <- .doeAnalysisPlotFactorType(factorA, options) + typeB <- .doeAnalysisPlotFactorType(factorB, options) + + if (typeA == "continuous" && typeB != "continuous") { + return(c(factorA, factorB)) + } + + if (typeA != "continuous" && typeB == "continuous") { + return(c(factorB, factorA)) + } + + return(c(factorA, factorB)) +} + +.doeAnalysisEmmeansByTerms <- function(model, termNames, level, includeCi = TRUE, options = NULL, gridResolution = 51) { + # Use emmeans on the already fitted model; never refit here. + + specs <- if (length(termNames) == 1) { + as.formula(paste0("~", termNames)) + } else { + as.formula(paste0("~", termNames[1], "*", termNames[2])) + } + + # Continuous factors are evaluated on a prediction grid; discrete factors keep their levels. + modelData <- model.frame(model) + atList <- list() + + for (termIdx in seq_along(termNames)) { + termName <- termNames[[termIdx]] + if (!termName %in% names(modelData)) { + next + } + + factorType <- if (is.null(options)) { + if (is.numeric(modelData[[termName]]) && !is.factor(modelData[[termName]])) "continuous" else "discrete" + } else { + .doeAnalysisPlotFactorType(termName, options) + } + + if (factorType == "continuous") { + outerLimitsOnly <- length(termNames) > 1 && termIdx == 2 + atList[[termName]] <- .doeAnalysisPlotFactorValues( + model = model, + factorName = termName, + factorType = factorType, + gridResolution = gridResolution, + outerLimitsOnly = outerLimitsOnly + ) + } else { + atList[[termName]] <- .doeAnalysisPlotFactorValues( + model = model, + factorName = termName, + factorType = factorType + ) + } + } + + emmArgs <- list(specs = specs, level = level) + if (length(atList) > 0) { + emmArgs[["at"]] <- atList + } + + # Try emmeans first; fall back to direct prediction for squared terms. + tryCatch({ + if (includeCi) { + emm <- do.call(emmeans::emmeans, c(list(model), emmArgs)) + return(as.data.frame(emm)) + } + + emm <- do.call(emmeans::emmeans, c(list(model), emmArgs)) + return(as.data.frame(emm, infer = c(FALSE, FALSE))) + }, error = function(e) { + tryCatch({ + return(.doeAnalysisPredictByTerms(model, termNames, level, includeCi, options, gridResolution)) + }, error = function(e2) { + stop(gettextf("Error computing emmeans for terms '%s': %s. Prediction fallback failed: %s.", + paste(termNames, collapse = ", "), conditionMessage(e), conditionMessage(e2))) + }) + }) +} + +.doeAnalysisPredictByTerms <- function(model, termNames, level, includeCi, options = NULL, gridResolution = 51) { + modelData <- model.frame(model) + responseVars <- all.vars(stats::formula(model)[[2]]) + predictorNames <- setdiff(names(modelData), responseVars) + + termValues <- list() + for (termIdx in seq_along(termNames)) { + termName <- termNames[[termIdx]] + if (!termName %in% names(modelData)) { + next + } + + factorType <- if (is.null(options)) { + if (is.numeric(modelData[[termName]]) && !is.factor(modelData[[termName]])) "continuous" else "discrete" + } else { + .doeAnalysisPlotFactorType(termName, options) + } + + if (factorType == "continuous") { + outerLimitsOnly <- length(termNames) > 1 && termIdx == 2 + termValues[[termName]] <- .doeAnalysisPlotFactorValues( + model = model, + factorName = termName, + factorType = factorType, + gridResolution = gridResolution, + outerLimitsOnly = outerLimitsOnly + ) + } else { + termValues[[termName]] <- .doeAnalysisPlotFactorValues( + model = model, + factorName = termName, + factorType = factorType + ) + } + } + + grid <- expand.grid(termValues, stringsAsFactors = FALSE) + + for (pred in setdiff(predictorNames, termNames)) { + predValues <- modelData[[pred]] + if (is.factor(predValues)) { + grid[[pred]] <- factor(levels(predValues)[[1]], levels = levels(predValues)) + } else if (is.character(predValues)) { + predNonMissing <- predValues[!is.na(predValues)] + grid[[pred]] <- if (length(predNonMissing) > 0) predNonMissing[[1]] else "" + } else { + grid[[pred]] <- mean(predValues, na.rm = TRUE) + } + } + + for (termName in termNames) { + if (termName %in% names(modelData) && is.factor(modelData[[termName]])) { + grid[[termName]] <- factor(grid[[termName]], levels = levels(modelData[[termName]])) + } + } + + if (includeCi) { + pred <- stats::predict(model, newdata = grid, se.fit = TRUE) + df <- stats::df.residual(model) + tcrit <- stats::qt((1 + level) / 2, df) + emmean <- pred$fit + se <- pred$se.fit + lower <- emmean - tcrit * se + upper <- emmean + tcrit * se + } else { + emmean <- stats::predict(model, newdata = grid) + } + + out <- grid[, termNames, drop = FALSE] + out$emmean <- emmean + if (includeCi) { + out$lower.CL <- lower + out$upper.CL <- upper + } + + return(out) +} + +.doeAnalysisNormalizeCiLevel <- function(level) { + if (is.null(level) || !is.finite(level)) { + return(0.95) + } + + if (level > 1) { + return(level / 100) + } + + return(level) +} + +.doeAnalysisPlotFactorialPlots <- function(jaspResults, dependent, options, ready) { + if (!options[["mainEffectsPlot"]] && !options[["interactionPlot"]]) { + return() + } + + # Nest a Factorial Plots container inside each response container. + for (dep in dependent) { + if (!is.null(jaspResults[[dep]][["factorialPlots"]])) { + next + } + + container <- createJaspContainer(title = gettext("Factorial Plots")) + # Parent response container already carries the base (model) dependencies; + # only the plot-specific options need to invalidate this sub-container. + container$dependOn(options = c("mainEffectsPlot", "mainEffectsPlotCi", "mainEffectsPlotCiLevel", + "interactionPlot", "interactionPlotCi", "interactionPlotCiLevel")) + container$position <- 13 + jaspResults[[dep]][["factorialPlots"]] <- container + + if (!ready || is.null(jaspResults[[dep]][["doeResult"]]) || jaspResults[[dep]]$getError()) { + next + } + + if (options[["mainEffectsPlot"]]) { + .doeAnalysisPlotMainEffectsSubplots(container, dep, options, jaspResults, ready) + } + + if (options[["interactionPlot"]]) { + .doeAnalysisPlotInteractionEffectsSubplots(container, dep, options, jaspResults, ready) + } + } +} + +.doeAnalysisPlotMainEffectsSubplots <- function(depContainer, dep, options, jaspResults, ready) { + mainEffectContainer <- createJaspContainer(title = gettext("Main Effects")) + mainEffectContainer$position <- 1 + depContainer[["mainEffect"]] <- mainEffectContainer + + includeCi <- isTRUE(options[["mainEffectsPlotCi"]]) + ciLevel <- .doeAnalysisNormalizeCiLevel(options[["mainEffectsPlotCiLevel"]]) + + result <- jaspResults[[dep]][["doeResult"]]$object[["regression"]] + model <- result[["object"]] + factors <- .doeAnalysisPlotFactorCandidates(options, model) + + # Build one plot per factor inside the main effects container. + plotCount <- 0 + emmErrors <- character(0) + for (factorName in factors) { + if (!factorName %in% names(model$model)) { + next + } + + predictor <- model$model[[factorName]] + predictor <- predictor[!is.na(predictor)] + if (length(unique(predictor)) < 2) { + next + } + + emm <- try(.doeAnalysisEmmeansByTerms(model, factorName, ciLevel, includeCi = includeCi, options = options)) + if (isTryError(emm)) { + emmErrors <- c(emmErrors, .extractErrorMessage(emm)) + next + } + + if (!factorName %in% names(emm)) { + emmErrors <- c(emmErrors, gettextf("Estimated means output did not contain factor '%s'.", factorName)) + next + } + + factorType <- .doeAnalysisPlotFactorType(factorName, options) + if (factorType == "continuous") { + emm[["x"]] <- as.numeric(emm[[factorName]]) + xBreaks <- sort(unique(c(min(emm[["x"]], na.rm = TRUE), max(emm[["x"]], na.rm = TRUE)))) + } else { + emm[["x"]] <- as.character(emm[[factorName]]) + + uniqueX <- unique(emm[["x"]]) + numericX <- suppressWarnings(as.numeric(uniqueX)) + if (!anyNA(numericX)) { + sortedLevels <- as.character(sort(numericX)) + emm[["x"]] <- factor(emm[["x"]], levels = sortedLevels) + } else if (is.factor(emm[[factorName]])) { + emm[["x"]] <- factor(emm[["x"]], levels = levels(emm[[factorName]])) + } + } + + factorPlot <- createJaspPlot(title = gettextf("Main Effect: %s", factorName), width = 500, height = 500) + + # Filter points: continuous factors show outer limits only, discrete show all levels + emmForPoints <- if (factorType == "continuous") { + emm[emm[["x"]] %in% xBreaks, ] + } else { + emm + } + + p <- ggplot2::ggplot(emm, ggplot2::aes(x = x, y = emmean, group = 1)) + + ggplot2::geom_line(color = "black", linewidth = 0.9) + + ggplot2::geom_point(data = emmForPoints, color = "black", fill = "black", shape = 21, size = 3.2, stroke = 0.2) + + ggplot2::scale_y_continuous(name = dep, expand = ggplot2::expansion(mult = c(0.15, 0.15))) + + jaspGraphs::geom_rangeframe() + + jaspGraphs::themeJaspRaw() + + ggplot2::theme(plot.margin = ggplot2::margin(10, 10, 10, 10, unit = "pt")) + + if (factorType == "continuous") { + p <- p + ggplot2::scale_x_continuous(name = factorName, breaks = xBreaks, expand = ggplot2::expansion(mult = c(0.15, 0.15))) + } else { + p <- p + ggplot2::scale_x_discrete(name = factorName, expand = ggplot2::expansion(add = c(0.5, 0.5))) + } + + if (includeCi && all(c("lower.CL", "upper.CL") %in% names(emm))) { + p <- p + ggplot2::geom_errorbar(ggplot2::aes(ymin = lower.CL, ymax = upper.CL), width = 0.25, linewidth = 0.6) + } + + factorPlot$plotObject <- p + factorPlotKey <- gsub("[^[:alnum:]_]", "_", paste0("mainEffect_", factorName)) + mainEffectContainer[[factorPlotKey]] <- factorPlot + plotCount <- plotCount + 1 + } + + if (plotCount == 0) { + errorPlot <- createJaspPlot(title = gettext("Main Effects"), width = 900, height = 500) + if (length(emmErrors) > 0) { + errorPlot$setError(gettextf("Failed to compute main effects plot: %s", emmErrors[[1]])) + } else { + errorPlot$setError(gettext("Main effects plot requires at least one factor with two or more levels.")) + } + mainEffectContainer[["plot"]] <- errorPlot + } +} + +.doeAnalysisPlotInteractionEffectsSubplots <- function(depContainer, dep, options, jaspResults, ready) { + interactionEffectContainer <- createJaspContainer(title = gettext("Interaction Effects")) + interactionEffectContainer$position <- 2 + depContainer[["interactionEffect"]] <- interactionEffectContainer + + includeCi <- isTRUE(options[["interactionPlotCi"]]) + ciLevel <- .doeAnalysisNormalizeCiLevel(options[["interactionPlotCiLevel"]]) + + result <- jaspResults[[dep]][["doeResult"]]$object[["regression"]] + model <- result[["object"]] + factors <- .doeAnalysisPlotFactorCandidates(options, model) + # Pairwise interactions for all available factors. + factorPairs <- if (length(factors) > 1) utils::combn(factors, 2, simplify = FALSE) else list() + + if (length(factorPairs) == 0) { + errorPlot <- createJaspPlot(title = gettext("Interaction Effects"), width = 1000, height = 600) + errorPlot$setError(gettext("Interaction plot requires at least two factors with two or more levels.")) + interactionEffectContainer[["plot"]] <- errorPlot + return() + } + + # Each pair contributes one separate interaction plot. + plotCount <- 0 + emmErrors <- character(0) + for (pair in factorPairs) { + orderedPair <- .doeAnalysisInteractionPlotOrder(pair[[1]], pair[[2]], options) + factorA <- orderedPair[[1]] + factorB <- orderedPair[[2]] + + if (!all(c(factorA, factorB) %in% names(model$model))) { + next + } + + predictorA <- model$model[[factorA]] + predictorB <- model$model[[factorB]] + predictorA <- predictorA[!is.na(predictorA)] + predictorB <- predictorB[!is.na(predictorB)] + if (length(unique(predictorA)) < 2 || length(unique(predictorB)) < 2) { + next + } + + emm <- try(.doeAnalysisEmmeansByTerms(model, c(factorA, factorB), ciLevel, includeCi = includeCi, options = options)) + if (isTryError(emm)) { + emmErrors <- c(emmErrors, .extractErrorMessage(emm)) + next + } + + if (!all(c(factorA, factorB) %in% names(emm))) { + emmErrors <- c(emmErrors, gettextf("Estimated means output did not contain factors '%1$s' and '%2$s'.", factorA, factorB)) + next + } + + xFactorType <- .doeAnalysisPlotFactorType(factorA, options) + traceFactorType <- .doeAnalysisPlotFactorType(factorB, options) + + if (xFactorType == "continuous") { + emm[["x"]] <- as.numeric(emm[[factorA]]) + xBreaks <- sort(unique(c(min(emm[["x"]], na.rm = TRUE), max(emm[["x"]], na.rm = TRUE)))) + } else { + emm[["x"]] <- as.character(emm[[factorA]]) + + uniqueX <- unique(emm[["x"]]) + numericX <- suppressWarnings(as.numeric(uniqueX)) + if (!anyNA(numericX)) { + sortedLevels <- as.character(sort(numericX)) + emm[["x"]] <- factor(emm[["x"]], levels = sortedLevels) + } else if (is.factor(emm[[factorA]])) { + emm[["x"]] <- factor(emm[["x"]], levels = levels(emm[[factorA]])) + } + } + + if (traceFactorType == "continuous") { + traceValues <- as.character(emm[[factorB]]) + traceNumeric <- suppressWarnings(as.numeric(traceValues)) + if (!anyNA(traceNumeric)) { + emm[["trace"]] <- factor(traceValues, levels = as.character(sort(unique(traceNumeric)))) + } else { + emm[["trace"]] <- factor(traceValues) + } + } else { + emm[["trace"]] <- as.character(emm[[factorB]]) + if (is.factor(emm[[factorB]])) { + emm[["trace"]] <- factor(emm[["trace"]], levels = levels(emm[[factorB]])) + } + } + + pairTitle <- gettextf("Interaction: %1$s x %2$s", factorA, factorB) + pairPlot <- createJaspPlot(title = pairTitle, width = 600, height = 500) + + # Filter points: continuous x-axis shows outer limits only, discrete shows all + emmForPoints <- if (xFactorType == "continuous") { + emm[emm[["x"]] %in% xBreaks, ] + } else { + emm + } + + hasCi <- includeCi && all(c("lower.CL", "upper.CL") %in% names(emm)) + + p <- ggplot2::ggplot(emm, ggplot2::aes(x = x, y = emmean, color = trace, group = trace)) + + # Continuous x: faded confidence bands drawn underneath the traces + if (hasCi && xFactorType == "continuous") { + p <- p + ggplot2::geom_ribbon(ggplot2::aes(ymin = lower.CL, ymax = upper.CL, fill = trace), + alpha = 0.3, color = NA, show.legend = FALSE) + } + + p <- p + + ggplot2::geom_line(linewidth = 0.95) + + ggplot2::geom_point(data = emmForPoints, shape = 21, ggplot2::aes(fill = trace), size = 3.2, stroke = 0.2) + + ggplot2::scale_y_continuous(name = dep, expand = ggplot2::expansion(mult = c(0.15, 0.15))) + + ggplot2::labs(color = factorB, fill = factorB) + + jaspGraphs::geom_rangeframe() + + jaspGraphs::themeJaspRaw() + + ggplot2::theme(legend.position = "right", plot.margin = ggplot2::margin(10, 10, 10, 10, unit = "pt")) + + if (xFactorType == "continuous") { + p <- p + ggplot2::scale_x_continuous(name = factorA, breaks = xBreaks, expand = ggplot2::expansion(mult = c(0.15, 0.15))) + } else { + p <- p + ggplot2::scale_x_discrete(name = factorA, expand = ggplot2::expansion(add = c(0.5, 0.5))) + } + + # Discrete x: error bars at each level + if (hasCi && xFactorType != "continuous") { + p <- p + ggplot2::geom_errorbar(ggplot2::aes(ymin = lower.CL, ymax = upper.CL), width = 0.25, linewidth = 0.6) + } + + pairPlot$plotObject <- p + pairPlotKey <- gsub("[^[:alnum:]_]", "_", paste0("interaction_", factorA, "_x_", factorB)) + interactionEffectContainer[[pairPlotKey]] <- pairPlot + plotCount <- plotCount + 1 + } + + if (plotCount == 0) { + errorPlot <- createJaspPlot(title = gettext("Interaction Effects"), width = 1000, height = 600) + if (length(emmErrors) > 0) { + errorPlot$setError(gettextf("Failed to compute interaction plot: %s", emmErrors[[1]])) + } else { + errorPlot$setError(gettext("Interaction plot requires at least two factors with two or more levels.")) + } + interactionEffectContainer[["plot"]] <- errorPlot + } +} + .doeAnalysisCheckErrors <- function(dataset, options, continuousPredictors, discretePredictors, blocks, covariates, dependent, ready) { if (!ready) { return() diff --git a/inst/qml/doeAnalysis.qml b/inst/qml/doeAnalysis.qml index c938e422..7bdde355 100644 --- a/inst/qml/doeAnalysis.qml +++ b/inst/qml/doeAnalysis.qml @@ -341,11 +341,12 @@ Form Section { title: qsTr("Plots") - columns: 1 + columns: 2 Group { title: qsTr("Residuals Plots") + columns: 2 CheckBox { @@ -378,9 +379,56 @@ Form } } + Group + { + title: qsTr("Factorial Plots") + columns: 2 + + CheckBox + { + name: "mainEffectsPlot" + label: qsTr("Main effect plots") + checked: false + + CheckBox + { + name: "mainEffectsPlotCi" + label: qsTr("Confidence interval") + checked: true + childrenOnSameRow: true + + CIField + { + name: "mainEffectsPlotCiLevel" + } + } + } + + CheckBox + { + name: "interactionPlot" + label: qsTr("Interaction plots") + checked: false + + CheckBox + { + name: "interactionPlotCi" + label: qsTr("Confidence interval") + checked: true + childrenOnSameRow: true + + CIField + { + name: "interactionPlotCiLevel" + } + } + } + } + Group { title: qsTr("Other Plots") + columns: 2 CheckBox { diff --git a/renv.lock b/renv.lock index c5e1031f..34d1024d 100644 --- a/renv.lock +++ b/renv.lock @@ -2520,6 +2520,88 @@ "Author": "Robin K. S. Hankin [aut, cre] (ORCID: )", "Repository": "CRAN" }, + "emmeans": { + "Package": "emmeans", + "Version": "2.0.3", + "Source": "Repository", + "Type": "Package", + "Title": "Estimated Marginal Means, aka Least-Squares Means", + "Date": "2026-03-30", + "Authors@R": "c(person(\"Russell V.\", \"Lenth\", role = c(\"aut\", \"cph\"), email = \"russell-lenth@uiowa.edu\"), person(\"Julia\", \"Piaskowski\", role = c(\"cre\", \"aut\"), email = \"julia.piask@gmail.com\"), person(\"Balazs\", \"Banfai\", role = \"ctb\"), person(\"Ben\", \"Bolker\", role = \"ctb\"), person(\"Paul\", \"Buerkner\", role = \"ctb\"), person(\"Iago\", \"Giné-Vázquez\", role = \"ctb\"), person(\"Maxime\", \"Hervé\", role = \"ctb\"), person(\"Maarten\", \"Jung\", role = \"ctb\"), person(\"Jonathon\", \"Love\", role = \"ctb\"), person(\"Fernando\", \"Miguez\", role = \"ctb\"), person(\"Hannes\", \"Riebl\", role = \"ctb\"), person(\"Henrik\", \"Singmann\", role = \"ctb\"))", + "Maintainer": "Julia Piaskowski ", + "Depends": [ + "R (>= 4.1.0)" + ], + "Imports": [ + "estimability (>= 1.4.1)", + "graphics", + "methods", + "mvtnorm", + "numDeriv", + "rlang", + "stats", + "utils" + ], + "Suggests": [ + "bayesplot", + "bayestestR", + "biglm", + "brms", + "car", + "coda (>= 0.17)", + "compositions", + "ggplot2 (>= 4.0.0)", + "knitr", + "lattice", + "lme4", + "lmerTest (>= 2.0.32)", + "logspline", + "MASS", + "mediation", + "mgcv", + "multcomp", + "multcompView", + "MuMIn", + "nlme", + "ordinal (>= 2014.11-12)", + "pbkrtest (>= 0.4-1)", + "rmarkdown", + "robmixglm", + "rsm", + "sandwich", + "scales", + "splines", + "testthat", + "tibble", + "xtable (>= 1.8-2)" + ], + "Enhances": [ + "CARBayes", + "coxme", + "gee", + "geepack", + "MCMCglmm", + "MCMCpack", + "mice", + "nnet", + "pscl", + "rstanarm", + "sommer", + "survival" + ], + "URL": "https://rvlenth.github.io/emmeans/, https://github.com/rvlenth/emmeans/", + "BugReports": "https://github.com/rvlenth/emmeans/issues", + "LazyData": "yes", + "ByteCompile": "yes", + "Description": "Obtain estimated marginal means (EMMs) for many linear, generalized linear, and mixed models. Compute contrasts or linear functions of EMMs, trends, and comparisons of slopes. Plots and other displays. Least-squares means are discussed, and the term \"estimated marginal means\" is suggested, in Searle, Speed, and Milliken (1980) Population marginal means in the linear model: An alternative to least squares means, The American Statistician 34(4), 216-221 .", + "License": "GPL-2 | GPL-3", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.3", + "VignetteBuilder": "knitr", + "NeedsCompilation": "no", + "Author": "Russell V. Lenth [aut, cph], Julia Piaskowski [cre, aut], Balazs Banfai [ctb], Ben Bolker [ctb], Paul Buerkner [ctb], Iago Giné-Vázquez [ctb], Maxime Hervé [ctb], Maarten Jung [ctb], Jonathon Love [ctb], Fernando Miguez [ctb], Hannes Riebl [ctb], Henrik Singmann [ctb]", + "Repository": "RSPM" + }, "estimability": { "Package": "estimability", "Version": "1.5.1", diff --git a/tests/testthat/_snaps/doeAnalysis/contour-plot54.svg b/tests/testthat/_snaps/doeAnalysis/contour-plot54.svg deleted file mode 100644 index 41b90d9a..00000000 --- a/tests/testthat/_snaps/doeAnalysis/contour-plot54.svg +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - --1 -0 -1 - - - - - - - --1 -0 -1 -A -Slice at C = 0 -B - - -Result - - - - - - - - - - -88.9 – 92.8 -92.8 – 96.8 -96.8 – 101 -101 – 105 -105 – 109 -contour-plot54 - - diff --git a/tests/testthat/_snaps/doeAnalysis/contour-plot57.svg b/tests/testthat/_snaps/doeAnalysis/contour-plot57.svg new file mode 100644 index 00000000..4c273767 --- /dev/null +++ b/tests/testthat/_snaps/doeAnalysis/contour-plot57.svg @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-1 +0 +1 + + + + + + + +-1 +0 +1 +A +Slice at C = 0 +B + + +Result + + + + + + + + + + +88.9 – 92.8 +92.8 – 96.8 +96.8 – 101 +101 – 105 +105 – 109 + + + diff --git a/tests/testthat/_snaps/doeAnalysis/interaction-angle-x-ball-55-06.svg b/tests/testthat/_snaps/doeAnalysis/interaction-angle-x-ball-55-06.svg new file mode 100644 index 00000000..08112224 --- /dev/null +++ b/tests/testthat/_snaps/doeAnalysis/interaction-angle-x-ball-55-06.svg @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +220 +240 +260 +280 +300 + + + + + + + + +2 +3 +Angle +Distance + + +Ball + + + + + + +Plastic +Tennis + + + diff --git a/tests/testthat/_snaps/doeAnalysis/interaction-angle-x-vertical-55-05.svg b/tests/testthat/_snaps/doeAnalysis/interaction-angle-x-vertical-55-05.svg new file mode 100644 index 00000000..3b93b22a --- /dev/null +++ b/tests/testthat/_snaps/doeAnalysis/interaction-angle-x-vertical-55-05.svg @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +200 +250 +300 + + + + + + +2 +3 +Angle +Distance + + +Vertical + + + + + + +1 +2 + + + diff --git a/tests/testthat/_snaps/doeAnalysis/interaction-ball-x-angle-55-06.svg b/tests/testthat/_snaps/doeAnalysis/interaction-ball-x-angle-55-06.svg new file mode 100644 index 00000000..363a6a19 --- /dev/null +++ b/tests/testthat/_snaps/doeAnalysis/interaction-ball-x-angle-55-06.svg @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +220 +240 +260 +280 +300 + + + + + + + + +Plastic +Tennis +Ball +Distance + + +Angle + + + + + + + + +2 +3 +interaction-ball-x-angle-55-06 + + diff --git a/tests/testthat/_snaps/doeAnalysis/interaction-ball-x-vertical-55-07.svg b/tests/testthat/_snaps/doeAnalysis/interaction-ball-x-vertical-55-07.svg new file mode 100644 index 00000000..00a5b5eb --- /dev/null +++ b/tests/testthat/_snaps/doeAnalysis/interaction-ball-x-vertical-55-07.svg @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +200 +225 +250 +275 +300 + + + + + + + + +Plastic +Tennis +Ball +Distance + + +Vertical + + + + + + + + +1 +2 +interaction-ball-x-vertical-55-07 + + diff --git a/tests/testthat/_snaps/doeAnalysis/interaction-injpress-x-injtemp-54-05.svg b/tests/testthat/_snaps/doeAnalysis/interaction-injpress-x-injtemp-54-05.svg new file mode 100644 index 00000000..252a086d --- /dev/null +++ b/tests/testthat/_snaps/doeAnalysis/interaction-injpress-x-injtemp-54-05.svg @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.75 +1.00 +1.25 +1.50 + + + + + + + +75 +150 +InjPress +Density + + +InjTemp + + + + + + +85 +100 + + + diff --git a/tests/testthat/_snaps/doeAnalysis/interaction-injpress-x-injtemp-54-15.svg b/tests/testthat/_snaps/doeAnalysis/interaction-injpress-x-injtemp-54-15.svg new file mode 100644 index 00000000..38df79c4 --- /dev/null +++ b/tests/testthat/_snaps/doeAnalysis/interaction-injpress-x-injtemp-54-15.svg @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +20 +25 +30 +35 +40 + + + + + + + + +75 +150 +InjPress +Strength + + +InjTemp + + + + + + +85 +100 + + + diff --git a/tests/testthat/_snaps/doeAnalysis/interaction-material-x-injpress-54-06.svg b/tests/testthat/_snaps/doeAnalysis/interaction-material-x-injpress-54-06.svg new file mode 100644 index 00000000..eee4611a --- /dev/null +++ b/tests/testthat/_snaps/doeAnalysis/interaction-material-x-injpress-54-06.svg @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.6 +0.9 +1.2 +1.5 + + + + + + + +75 +150 +InjPress +Density + + +Material + + + + + + +Formula1 +Formula2 + + + diff --git a/tests/testthat/_snaps/doeAnalysis/interaction-material-x-injpress-54-16.svg b/tests/testthat/_snaps/doeAnalysis/interaction-material-x-injpress-54-16.svg new file mode 100644 index 00000000..fad00dc7 --- /dev/null +++ b/tests/testthat/_snaps/doeAnalysis/interaction-material-x-injpress-54-16.svg @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +20 +25 +30 +35 +40 + + + + + + + + +75 +150 +InjPress +Strength + + +Material + + + + + + +Formula1 +Formula2 + + + diff --git a/tests/testthat/_snaps/doeAnalysis/interaction-material-x-injtemp-54-07.svg b/tests/testthat/_snaps/doeAnalysis/interaction-material-x-injtemp-54-07.svg new file mode 100644 index 00000000..a33f837e --- /dev/null +++ b/tests/testthat/_snaps/doeAnalysis/interaction-material-x-injtemp-54-07.svg @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.6 +0.8 +1.0 +1.2 +1.4 + + + + + + + + +85 +100 +InjTemp +Density + + +Material + + + + + + +Formula1 +Formula2 + + + diff --git a/tests/testthat/_snaps/doeAnalysis/interaction-material-x-injtemp-54-17.svg b/tests/testthat/_snaps/doeAnalysis/interaction-material-x-injtemp-54-17.svg new file mode 100644 index 00000000..2221fcda --- /dev/null +++ b/tests/testthat/_snaps/doeAnalysis/interaction-material-x-injtemp-54-17.svg @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +20 +25 +30 +35 +40 + + + + + + + + +85 +100 +InjTemp +Strength + + +Material + + + + + + +Formula1 +Formula2 + + + diff --git a/tests/testthat/_snaps/doeAnalysis/interaction-pressure-x-nozzle-56-11.svg b/tests/testthat/_snaps/doeAnalysis/interaction-pressure-x-nozzle-56-11.svg new file mode 100644 index 00000000..b37a1c49 --- /dev/null +++ b/tests/testthat/_snaps/doeAnalysis/interaction-pressure-x-nozzle-56-11.svg @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +50 +100 + + + + + +10 +20 +Pressure +Cost + + +Nozzle + + + + + + + + + +1 +2 +3 + + + diff --git a/tests/testthat/_snaps/doeAnalysis/interaction-pressure-x-nozzle-56-17.svg b/tests/testthat/_snaps/doeAnalysis/interaction-pressure-x-nozzle-56-17.svg new file mode 100644 index 00000000..f127e231 --- /dev/null +++ b/tests/testthat/_snaps/doeAnalysis/interaction-pressure-x-nozzle-56-17.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-100 +-50 +0 +50 + + + + + + + +10 +20 +Pressure +Syruploss + + +Nozzle + + + + + + + + + +1 +2 +3 + + + diff --git a/tests/testthat/_snaps/doeAnalysis/interaction-speed-x-nozzle-56-12.svg b/tests/testthat/_snaps/doeAnalysis/interaction-speed-x-nozzle-56-12.svg new file mode 100644 index 00000000..06f2ef44 --- /dev/null +++ b/tests/testthat/_snaps/doeAnalysis/interaction-speed-x-nozzle-56-12.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +100 +125 +150 +175 + + + + + + + +100 +140 +Speed +Cost + + +Nozzle + + + + + + + + + +1 +2 +3 + + + diff --git a/tests/testthat/_snaps/doeAnalysis/interaction-speed-x-nozzle-56-18.svg b/tests/testthat/_snaps/doeAnalysis/interaction-speed-x-nozzle-56-18.svg new file mode 100644 index 00000000..ef143eb2 --- /dev/null +++ b/tests/testthat/_snaps/doeAnalysis/interaction-speed-x-nozzle-56-18.svg @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0 +50 +100 + + + + + + +100 +140 +Speed +Syruploss + + +Nozzle + + + + + + + + + +1 +2 +3 + + + diff --git a/tests/testthat/_snaps/doeAnalysis/interaction-speed-x-pressure-56-13.svg b/tests/testthat/_snaps/doeAnalysis/interaction-speed-x-pressure-56-13.svg new file mode 100644 index 00000000..c934ef74 --- /dev/null +++ b/tests/testthat/_snaps/doeAnalysis/interaction-speed-x-pressure-56-13.svg @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +40 +80 +120 +160 + + + + + + + +100 +140 +Speed +Cost + + +Pressure + + + + + + +10 +20 + + + diff --git a/tests/testthat/_snaps/doeAnalysis/interaction-speed-x-pressure-56-19.svg b/tests/testthat/_snaps/doeAnalysis/interaction-speed-x-pressure-56-19.svg new file mode 100644 index 00000000..85d6d283 --- /dev/null +++ b/tests/testthat/_snaps/doeAnalysis/interaction-speed-x-pressure-56-19.svg @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-100 +-50 +0 +50 + + + + + + + +100 +140 +Speed +Syruploss + + +Pressure + + + + + + +10 +20 + + + diff --git a/tests/testthat/_snaps/doeAnalysis/interaction-vertical-x-ball-55-07.svg b/tests/testthat/_snaps/doeAnalysis/interaction-vertical-x-ball-55-07.svg new file mode 100644 index 00000000..c67f731d --- /dev/null +++ b/tests/testthat/_snaps/doeAnalysis/interaction-vertical-x-ball-55-07.svg @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +200 +225 +250 +275 +300 +325 + + + + + + + + + +1 +2 +Vertical +Distance + + +Ball + + + + + + +Plastic +Tennis + + + diff --git a/tests/testthat/_snaps/doeAnalysis/main-effect-angle-55-08.svg b/tests/testthat/_snaps/doeAnalysis/main-effect-angle-55-08.svg new file mode 100644 index 00000000..46d65244 --- /dev/null +++ b/tests/testthat/_snaps/doeAnalysis/main-effect-angle-55-08.svg @@ -0,0 +1,215 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +230 +240 +250 +260 +270 +280 +290 + + + + + + + + + + +2 +3 +Angle +Distance +main-effect-angle-55-08 + + diff --git a/tests/testthat/_snaps/doeAnalysis/main-effect-ball-55-09.svg b/tests/testthat/_snaps/doeAnalysis/main-effect-ball-55-09.svg new file mode 100644 index 00000000..8a0fba43 --- /dev/null +++ b/tests/testthat/_snaps/doeAnalysis/main-effect-ball-55-09.svg @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +240 +250 +260 +270 +280 + + + + + + + + +Plastic +Tennis +Ball +Distance +main-effect-ball-55-09 + + diff --git a/tests/testthat/_snaps/doeAnalysis/main-effect-injpress-54-08.svg b/tests/testthat/_snaps/doeAnalysis/main-effect-injpress-54-08.svg new file mode 100644 index 00000000..31b3bd78 --- /dev/null +++ b/tests/testthat/_snaps/doeAnalysis/main-effect-injpress-54-08.svg @@ -0,0 +1,209 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.8 +1.0 +1.2 +1.4 + + + + + + + +75 +150 +InjPress +Density +main-effect-injpress-54-08 + + diff --git a/tests/testthat/_snaps/doeAnalysis/main-effect-injpress-54-18.svg b/tests/testthat/_snaps/doeAnalysis/main-effect-injpress-54-18.svg new file mode 100644 index 00000000..ad99b113 --- /dev/null +++ b/tests/testthat/_snaps/doeAnalysis/main-effect-injpress-54-18.svg @@ -0,0 +1,209 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +24 +28 +32 +36 + + + + + + + +75 +150 +InjPress +Strength +main-effect-injpress-54-18 + + diff --git a/tests/testthat/_snaps/doeAnalysis/main-effect-injtemp-54-09.svg b/tests/testthat/_snaps/doeAnalysis/main-effect-injtemp-54-09.svg new file mode 100644 index 00000000..2b9e7cda --- /dev/null +++ b/tests/testthat/_snaps/doeAnalysis/main-effect-injtemp-54-09.svg @@ -0,0 +1,207 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.9 +1.0 +1.1 + + + + + + +85 +100 +InjTemp +Density +main-effect-injtemp-54-09 + + diff --git a/tests/testthat/_snaps/doeAnalysis/main-effect-injtemp-54-19.svg b/tests/testthat/_snaps/doeAnalysis/main-effect-injtemp-54-19.svg new file mode 100644 index 00000000..9eff5fba --- /dev/null +++ b/tests/testthat/_snaps/doeAnalysis/main-effect-injtemp-54-19.svg @@ -0,0 +1,209 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +24 +27 +30 +33 + + + + + + + +85 +100 +InjTemp +Strength +main-effect-injtemp-54-19 + + diff --git a/tests/testthat/_snaps/doeAnalysis/main-effect-material-54-10.svg b/tests/testthat/_snaps/doeAnalysis/main-effect-material-54-10.svg new file mode 100644 index 00000000..acf32512 --- /dev/null +++ b/tests/testthat/_snaps/doeAnalysis/main-effect-material-54-10.svg @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.8 +1.0 +1.2 +1.4 + + + + + + + +Formula1 +Formula2 +Material +Density +main-effect-material-54-10 + + diff --git a/tests/testthat/_snaps/doeAnalysis/main-effect-material-54-20.svg b/tests/testthat/_snaps/doeAnalysis/main-effect-material-54-20.svg new file mode 100644 index 00000000..810418d5 --- /dev/null +++ b/tests/testthat/_snaps/doeAnalysis/main-effect-material-54-20.svg @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +22 +26 +30 +34 + + + + + + + +Formula1 +Formula2 +Material +Strength +main-effect-material-54-20 + + diff --git a/tests/testthat/_snaps/doeAnalysis/main-effect-nozzle-56-14.svg b/tests/testthat/_snaps/doeAnalysis/main-effect-nozzle-56-14.svg new file mode 100644 index 00000000..42979b6c --- /dev/null +++ b/tests/testthat/_snaps/doeAnalysis/main-effect-nozzle-56-14.svg @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +90 +100 +110 +120 +130 + + + + + + + + + +1 +2 +3 +Nozzle +Cost +main-effect-nozzle-56-14 + + diff --git a/tests/testthat/_snaps/doeAnalysis/main-effect-nozzle-56-20.svg b/tests/testthat/_snaps/doeAnalysis/main-effect-nozzle-56-20.svg new file mode 100644 index 00000000..13b8b9ff --- /dev/null +++ b/tests/testthat/_snaps/doeAnalysis/main-effect-nozzle-56-20.svg @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-20 +0 +20 +40 + + + + + + + + +1 +2 +3 +Nozzle +Syruploss +main-effect-nozzle-56-20 + + diff --git a/tests/testthat/_snaps/doeAnalysis/main-effect-pressure-56-15.svg b/tests/testthat/_snaps/doeAnalysis/main-effect-pressure-56-15.svg new file mode 100644 index 00000000..c5b40a55 --- /dev/null +++ b/tests/testthat/_snaps/doeAnalysis/main-effect-pressure-56-15.svg @@ -0,0 +1,205 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +50 +100 + + + + + +10 +20 +Pressure +Cost +main-effect-pressure-56-15 + + diff --git a/tests/testthat/_snaps/doeAnalysis/main-effect-pressure-56-21.svg b/tests/testthat/_snaps/doeAnalysis/main-effect-pressure-56-21.svg new file mode 100644 index 00000000..4c05d1db --- /dev/null +++ b/tests/testthat/_snaps/doeAnalysis/main-effect-pressure-56-21.svg @@ -0,0 +1,209 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-100 +-50 +0 +50 + + + + + + + +10 +20 +Pressure +Syruploss +main-effect-pressure-56-21 + + diff --git a/tests/testthat/_snaps/doeAnalysis/main-effect-speed-56-16.svg b/tests/testthat/_snaps/doeAnalysis/main-effect-speed-56-16.svg new file mode 100644 index 00000000..7af161bc --- /dev/null +++ b/tests/testthat/_snaps/doeAnalysis/main-effect-speed-56-16.svg @@ -0,0 +1,209 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +100 +125 +150 +175 + + + + + + + +100 +140 +Speed +Cost +main-effect-speed-56-16 + + diff --git a/tests/testthat/_snaps/doeAnalysis/main-effect-speed-56-22.svg b/tests/testthat/_snaps/doeAnalysis/main-effect-speed-56-22.svg new file mode 100644 index 00000000..5f36d4db --- /dev/null +++ b/tests/testthat/_snaps/doeAnalysis/main-effect-speed-56-22.svg @@ -0,0 +1,209 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0 +40 +80 +120 + + + + + + + +100 +140 +Speed +Syruploss +main-effect-speed-56-22 + + diff --git a/tests/testthat/_snaps/doeAnalysis/main-effect-vertical-55-10.svg b/tests/testthat/_snaps/doeAnalysis/main-effect-vertical-55-10.svg new file mode 100644 index 00000000..f6b45858 --- /dev/null +++ b/tests/testthat/_snaps/doeAnalysis/main-effect-vertical-55-10.svg @@ -0,0 +1,213 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +210 +230 +250 +270 +290 +310 + + + + + + + + + +1 +2 +Vertical +Distance +main-effect-vertical-55-10 + + diff --git a/tests/testthat/_snaps/doeAnalysis/reference_plotobject/contour-plot57.rds b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/contour-plot57.rds new file mode 100644 index 00000000..fa6705d7 Binary files /dev/null and b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/contour-plot57.rds differ diff --git a/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-angle-x-ball-55-06.rds b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-angle-x-ball-55-06.rds new file mode 100644 index 00000000..2f6219d9 Binary files /dev/null and b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-angle-x-ball-55-06.rds differ diff --git a/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-angle-x-vertical-55-05.rds b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-angle-x-vertical-55-05.rds new file mode 100644 index 00000000..173ce543 Binary files /dev/null and b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-angle-x-vertical-55-05.rds differ diff --git a/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-injpress-x-injtemp-54-05.rds b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-injpress-x-injtemp-54-05.rds new file mode 100644 index 00000000..019439f3 Binary files /dev/null and b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-injpress-x-injtemp-54-05.rds differ diff --git a/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-injpress-x-injtemp-54-15.rds b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-injpress-x-injtemp-54-15.rds new file mode 100644 index 00000000..c9ceb26a Binary files /dev/null and b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-injpress-x-injtemp-54-15.rds differ diff --git a/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-material-x-injpress-54-06.rds b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-material-x-injpress-54-06.rds new file mode 100644 index 00000000..11353898 Binary files /dev/null and b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-material-x-injpress-54-06.rds differ diff --git a/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-material-x-injpress-54-16.rds b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-material-x-injpress-54-16.rds new file mode 100644 index 00000000..f538ab1e Binary files /dev/null and b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-material-x-injpress-54-16.rds differ diff --git a/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-material-x-injtemp-54-07.rds b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-material-x-injtemp-54-07.rds new file mode 100644 index 00000000..2189b422 Binary files /dev/null and b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-material-x-injtemp-54-07.rds differ diff --git a/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-material-x-injtemp-54-17.rds b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-material-x-injtemp-54-17.rds new file mode 100644 index 00000000..a4eb4358 Binary files /dev/null and b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-material-x-injtemp-54-17.rds differ diff --git a/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-pressure-x-nozzle-56-11.rds b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-pressure-x-nozzle-56-11.rds new file mode 100644 index 00000000..9e840bf0 Binary files /dev/null and b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-pressure-x-nozzle-56-11.rds differ diff --git a/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-pressure-x-nozzle-56-17.rds b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-pressure-x-nozzle-56-17.rds new file mode 100644 index 00000000..ed4ef1a6 Binary files /dev/null and b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-pressure-x-nozzle-56-17.rds differ diff --git a/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-speed-x-nozzle-56-12.rds b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-speed-x-nozzle-56-12.rds new file mode 100644 index 00000000..23465985 Binary files /dev/null and b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-speed-x-nozzle-56-12.rds differ diff --git a/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-speed-x-nozzle-56-18.rds b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-speed-x-nozzle-56-18.rds new file mode 100644 index 00000000..0ae282be Binary files /dev/null and b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-speed-x-nozzle-56-18.rds differ diff --git a/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-speed-x-pressure-56-13.rds b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-speed-x-pressure-56-13.rds new file mode 100644 index 00000000..3cfcb807 Binary files /dev/null and b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-speed-x-pressure-56-13.rds differ diff --git a/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-speed-x-pressure-56-19.rds b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-speed-x-pressure-56-19.rds new file mode 100644 index 00000000..f616889d Binary files /dev/null and b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-speed-x-pressure-56-19.rds differ diff --git a/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-vertical-x-ball-55-07.rds b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-vertical-x-ball-55-07.rds new file mode 100644 index 00000000..3cbc24cb Binary files /dev/null and b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/interaction-vertical-x-ball-55-07.rds differ diff --git a/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-angle-55-08.rds b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-angle-55-08.rds new file mode 100644 index 00000000..f1d00788 Binary files /dev/null and b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-angle-55-08.rds differ diff --git a/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-ball-55-09.rds b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-ball-55-09.rds new file mode 100644 index 00000000..d832fc60 Binary files /dev/null and b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-ball-55-09.rds differ diff --git a/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-injpress-54-08.rds b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-injpress-54-08.rds new file mode 100644 index 00000000..930acfad Binary files /dev/null and b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-injpress-54-08.rds differ diff --git a/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-injpress-54-18.rds b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-injpress-54-18.rds new file mode 100644 index 00000000..aecfc123 Binary files /dev/null and b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-injpress-54-18.rds differ diff --git a/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-injtemp-54-09.rds b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-injtemp-54-09.rds new file mode 100644 index 00000000..87c4449f Binary files /dev/null and b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-injtemp-54-09.rds differ diff --git a/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-injtemp-54-19.rds b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-injtemp-54-19.rds new file mode 100644 index 00000000..22877076 Binary files /dev/null and b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-injtemp-54-19.rds differ diff --git a/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-material-54-10.rds b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-material-54-10.rds new file mode 100644 index 00000000..757cdd78 Binary files /dev/null and b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-material-54-10.rds differ diff --git a/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-material-54-20.rds b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-material-54-20.rds new file mode 100644 index 00000000..9cafedf9 Binary files /dev/null and b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-material-54-20.rds differ diff --git a/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-nozzle-56-14.rds b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-nozzle-56-14.rds new file mode 100644 index 00000000..cec4de68 Binary files /dev/null and b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-nozzle-56-14.rds differ diff --git a/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-nozzle-56-20.rds b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-nozzle-56-20.rds new file mode 100644 index 00000000..6bed206b Binary files /dev/null and b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-nozzle-56-20.rds differ diff --git a/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-pressure-56-15.rds b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-pressure-56-15.rds new file mode 100644 index 00000000..c9c03645 Binary files /dev/null and b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-pressure-56-15.rds differ diff --git a/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-pressure-56-21.rds b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-pressure-56-21.rds new file mode 100644 index 00000000..31d55426 Binary files /dev/null and b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-pressure-56-21.rds differ diff --git a/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-speed-56-16.rds b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-speed-56-16.rds new file mode 100644 index 00000000..1e15cb27 Binary files /dev/null and b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-speed-56-16.rds differ diff --git a/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-speed-56-22.rds b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-speed-56-22.rds new file mode 100644 index 00000000..fd84c9d2 Binary files /dev/null and b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-speed-56-22.rds differ diff --git a/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-vertical-55-10.rds b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-vertical-55-10.rds new file mode 100644 index 00000000..e1bf159a Binary files /dev/null and b/tests/testthat/_snaps/doeAnalysis/reference_plotobject/main-effect-vertical-55-10.rds differ diff --git a/tests/testthat/_snaps/processCapabilityStudies/probability-plot-against-weibull-distribution5-subplot-1.new.svg b/tests/testthat/_snaps/processCapabilityStudies/probability-plot-against-weibull-distribution5-subplot-1.new.svg deleted file mode 100644 index 2a714f74..00000000 --- a/tests/testthat/_snaps/processCapabilityStudies/probability-plot-against-weibull-distribution5-subplot-1.new.svg +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -0.1 -1 -5 -10 -20 -30 -40 -50 -60 -70 -80 -90 -95 -99 -99.9 - - - - - - - - - - - - - - - - - - - - - -3.1 -5.6 -7 -8.4 -10.9 -Measurement -Percent -1 - - - diff --git a/tests/testthat/_snaps/processCapabilityStudies/probability-plot-against-weibull-distribution5-subplot-1.svg b/tests/testthat/_snaps/processCapabilityStudies/probability-plot-against-weibull-distribution5-subplot-1.svg index fbddac62..2a714f74 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/probability-plot-against-weibull-distribution5-subplot-1.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/probability-plot-against-weibull-distribution5-subplot-1.svg @@ -1,5 +1,6 @@ - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.1 +1 +5 +10 +20 +30 +40 +50 +60 +70 +80 +90 +95 +99 +99.9 + + + + + + + + + + + + + + + + + + + + + +3.1 +5.6 +7 +8.4 +10.9 +Measurement +Percent +1 - - -0.1 -1 -5 -10 -20 -30 -40 -50 -60 -70 -80 -90 -95 -99 -99.9 - - - - - - - - - - - - - - - - - - - - - -3.1 -5.6 -7 -8.4 -10.9 -Measurement -Percent -1 diff --git a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report23-subplot-10.new.svg b/tests/testthat/_snaps/processCapabilityStudies/process-capability-report23-subplot-10.new.svg deleted file mode 100644 index b73b7ccd..00000000 --- a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report23-subplot-10.new.svg +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -0.1 -1 -5 -10 -20 -30 -40 -50 -60 -70 -80 -90 -95 -99 -99.9 - - - - - - - - - - - - - - - - - - - - - - -2 -4 -6 -8 -10 -12 -Measurement -Percent -1 - - - diff --git a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report23-subplot-10.svg b/tests/testthat/_snaps/processCapabilityStudies/process-capability-report23-subplot-10.svg index fb4aad22..b73b7ccd 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report23-subplot-10.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/process-capability-report23-subplot-10.svg @@ -1,5 +1,6 @@ - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.1 +1 +5 +10 +20 +30 +40 +50 +60 +70 +80 +90 +95 +99 +99.9 + + + + + + + + + + + + + + + + + + + + + + +2 +4 +6 +8 +10 +12 +Measurement +Percent +1 - - -0.1 -1 -5 -10 -20 -30 -40 -50 -60 -70 -80 -90 -95 -99 -99.9 - - - - - - - - - - - - - - - - - - - - - - -2 -4 -6 -8 -10 -12 -Measurement -Percent -1 diff --git a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report23-subplot-5.new.svg b/tests/testthat/_snaps/processCapabilityStudies/process-capability-report23-subplot-5.new.svg deleted file mode 100644 index 2b86da69..00000000 --- a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report23-subplot-5.new.svg +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -0.1 -1 -5 -10 -20 -30 -40 -50 -60 -70 -80 -90 -95 -99 -99.9 - - - - - - - - - - - - - - - - - - - - - - - -2 -4 -6 -8 -10 -12 -14 -Measurement -Percent -2 - - - diff --git a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report23-subplot-5.svg b/tests/testthat/_snaps/processCapabilityStudies/process-capability-report23-subplot-5.svg index c696acda..2b86da69 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/process-capability-report23-subplot-5.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/process-capability-report23-subplot-5.svg @@ -1,5 +1,6 @@ - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.1 +1 +5 +10 +20 +30 +40 +50 +60 +70 +80 +90 +95 +99 +99.9 + + + + + + + + + + + + + + + + + + + + + + + +2 +4 +6 +8 +10 +12 +14 +Measurement +Percent +2 - - -0.1 -1 -5 -10 -20 -30 -40 -50 -60 -70 -80 -90 -95 -99 -99.9 - - - - - - - - - - - - - - - - - - - - - - - -2 -4 -6 -8 -10 -12 -14 -Measurement -Percent -2 diff --git a/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw18-subplot-10.new.svg b/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw18-subplot-10.new.svg deleted file mode 100644 index 6de1fa48..00000000 --- a/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw18-subplot-10.new.svg +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -0.1 -1 -5 -10 -20 -30 -40 -50 -60 -70 -80 -90 -95 -99 -99.9 - - - - - - - - - - - - - - - - - - - - - - -2 -4 -6 -8 -10 -12 -Measurement -Percent -1 - - - diff --git a/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw18-subplot-10.svg b/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw18-subplot-10.svg index 275a0cef..6de1fa48 100644 --- a/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw18-subplot-10.svg +++ b/tests/testthat/_snaps/processCapabilityStudies/process-capability-reportw18-subplot-10.svg @@ -1,5 +1,6 @@ - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.1 +1 +5 +10 +20 +30 +40 +50 +60 +70 +80 +90 +95 +99 +99.9 + + + + + + + + + + + + + + + + + + + + + + +2 +4 +6 +8 +10 +12 +Measurement +Percent +1 - - -0.1 -1 -5 -10 -20 -30 -40 -50 -60 -70 -80 -90 -95 -99 -99.9 - - - - - - - - - - - - - - - - - - - - - - -2 -4 -6 -8 -10 -12 -Measurement -Percent -1 diff --git a/tests/testthat/test-doeAnalysis.R b/tests/testthat/test-doeAnalysis.R index 476a0814..0d0be424 100644 --- a/tests/testthat/test-doeAnalysis.R +++ b/tests/testthat/test-doeAnalysis.R @@ -4846,7 +4846,6 @@ test_that("48.9 Response Optimizer Response Surface No Squares - Response Optimi options("jaspRoundToPrecision" = NULL) # reset default - ## Response Surface design, basic example, squared terms #### options <- analysisOptions("doeAnalysis") options$designType <- "responseSurfaceDesign" @@ -5190,6 +5189,558 @@ test_that("Stepwise marginality leaves compliant models untouched", { options("jaspRoundToPrecision" = NULL) # reset default +### Factorial plots #### + +#### Data example 1 (factorial plots, two outcomes) #### +options <- analysisOptions("doeAnalysis") +options$designType <- "factorialDesign" +options$dependentFactorial <- c("Density", "Strength") +options$fixedFactorsFactorial <- c("Material") +options$continuousFactorsFactorial <- c("InjPress", "InjTemp") +options$codeFactors <- TRUE +options$codeFactorsMethod <- "automatic" +options$tableEquation <- TRUE +options$tableAlias <- TRUE +options$highestOrder <- FALSE +options$modelTerms <- list( + list(components = "Material"), + list(components = "InjTemp"), + list(components = "InjPress"), + list(components = c("Material", "InjTemp")), + list(components = c("Material", "InjPress")), + list(components = c("InjPress", "InjTemp")) +) +options$mainEffectsPlot <- TRUE +options$mainEffectsPlotCi <- TRUE +options$interactionPlot <- TRUE +options$interactionPlotCi <- TRUE +set.seed(123) +results <- runAnalysis("doeAnalysis", "datasets/doeAnalysis/doe_realDataExample1.csv", options) + +test_that("54.1 Data example 1 (factorial plots, two outcomes) - Density ANOVA table results match", { + table <- results[["results"]][["Density"]][["collection"]][["Density_tableAnova"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0.282635417212939, 1.69581250327763, 6, 29.2340255777468, 2.0653745688331e-05, + "Model", "", 1.64742746594141, 3, "", "", " Linear terms", + 0.669433085778748, 0.669433085778748, 1, 69.2419377062769, 1.61404212637588e-05, + " Material", 0.0216428384881839, 0.0216428384881839, + 1, 2.23859875799617, 0.168820796228592, " InjTemp", + 0.956351541674477, 0.956351541674477, 1, 98.9189738013817, 3.74374736566881e-06, + " InjPress", "", 0.0483850373362251, 3, "", + "", " Interaction terms", 0.0438625219544171, 0.0438625219544171, + 1, 4.53686272359078, 0.0620223667487927, " MaterialInjTemp", + 0.0018167435738568, 0.0018167435738568, 1, 0.187912500952855, + 0.674864178734996, " MaterialInjPress", + 0.0027057718079512, 0.0027057718079512, 1, 0.279867976282664, + 0.609585425025631, " InjTempInjPress", + 0.0096680293468746, 0.0870122641218714, 9, "", "", "Error", + "", 1.78282476739951, 15, "", "", "Total")) +}) + +test_that("54.2 Data example 1 (factorial plots, two outcomes) - Density Coded Coefficients table results match", { + table <- results[["results"]][["Density"]][["collection"]][["Density_tableCoefficients"]][["data"]] + jaspTools::expect_equal_tables(table, + list("(Intercept)", 1.03348149084375, "", 1.21507749788964e-11, 0.0245815344146712, + "(Intercept)", 42.0430016047709, "", "A", -0.20454722648125, + -0.4090944529625, 1.61404212637588e-05, 0.0245815344146712, + "Material", -8.32117405816492, 1, "B", -0.03677876296875, -0.0735575259375, + 0.168820796228592, 0.0245815344146712, "InjTemp", -1.49619475938, + 1, "C", 0.24448306966875, 0.4889661393375, 3.74374736566881e-06, + 0.0245815344146712, "InjPress", 9.94580181792206, 1, "AB", 0.05235845320625, + 0.1047169064125, 0.0620223667487927, 0.0245815344146712, "MaterialInjTemp", + 2.12999124965122, 1, "AC", -0.01065581875625, -0.0213116375125001, + 0.674864178734996, 0.0245815344146712, "MaterialInjPress", + -0.433488755278444, 1, "BC", 0.01300425845625, 0.0260085169125, + 0.609585425025631, 0.0245815344146712, "InjTempInjPress", + 0.52902549681718, 1)) +}) + +test_that("54.3 Data example 1 (factorial plots, two outcomes) - Density Regression equation in Coded Units table results match", { + table <- results[["results"]][["Density"]][["collection"]][["Density_tableEquation"]][["data"]] + jaspTools::expect_equal_tables(table, + list("Density = 1.03 0.2 A 0.037 B + 0.24 C + 0.052 AB 0.011 AC + 0.013 BC" + )) +}) + +test_that("54.4 Data example 1 (factorial plots, two outcomes) - Density Model Summary table results match", { + table <- results[["results"]][["Density"]][["collection"]][["Density_tableSummary"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0.91865692980323, 0.845749437256495, 0.951194157881938, 0.0983261376586846 + )) +}) + +test_that("54.11 Data example 1 (factorial plots, two outcomes) - Strength ANOVA table results match", { + table <- results[["results"]][["Strength"]][["collection"]][["Strength_tableAnova"]][["data"]] + jaspTools::expect_equal_tables(table, + list(61.4412169760555, 368.647301856333, 6, 6.02163462145317, 0.00885308674084683, + "Model", "", 367.52491531986, 3, "", "", " Linear terms", + 181.151435260225, 181.151435260225, 1, 17.7540063165417, 0.00226090333532432, + " Material", 73.7250318293204, 73.7250318293204, + 1, 7.22552752013659, 0.024876494295309, " InjTemp", + 112.648448230315, 112.648448230315, 1, 11.0402727892092, 0.00890208646409138, + " InjPress", "", 1.12238653647272, 3, "", + "", " Interaction terms", 0.778094866011372, 0.778094866011372, + 1, 0.0762583037014878, 0.788670012907783, " MaterialInjTemp", + 0.342200526962543, 0.342200526962543, 1, 0.033537853611204, + 0.858752480786647, " MaterialInjPress", + 0.00209114349880224, 0.00209114349880224, 1, 0.00020494551883179, + 0.988890269483188, " InjTempInjPress", + 10.2034116711698, 91.8307050405283, 9, "", "", "Error", "", + 460.478006896861, 15, "", "", "Total")) +}) + +test_that("54.12 Data example 1 (factorial plots, two outcomes) - Strength Coded Coefficients table results match", { + table <- results[["results"]][["Strength"]][["collection"]][["Strength_tableCoefficients"]][["data"]] + jaspTools::expect_equal_tables(table, + list("(Intercept)", 29.633570586875, "", 3.71582056009637e-11, 0.798569489429763, + "(Intercept)", 37.1083180350849, "", "A", 3.364812729375, 6.72962545875, + 0.00226090333532432, 0.798569489429763, "Material", 4.21355032206116, + 1, "B", 2.146582048125, 4.29316409625, 0.024876494295309, 0.798569489429763, + "InjTemp", 2.68803413671341, 1, "C", 2.653399331875, 5.30679866375, + 0.00890208646409137, 0.798569489429763, "InjPress", 3.32269059486573, + 1, "AB", -0.220524214375001, -0.441048428750001, 0.788670012907782, + 0.798569489429764, "MaterialInjTemp", -0.276149060656538, + 1, "AC", -0.146244770625, -0.29248954125, 0.858752480786647, + 0.798569489429763, "MaterialInjPress", -0.183133431167561, + 1, "BC", 0.0114322556249987, 0.0228645112499974, 0.98889026948318, + 0.798569489429763, "InjTempInjPress", 0.0143159183719405, + 1)) +}) + +test_that("54.13 Data example 1 (factorial plots, two outcomes) - Strength Regression equation in Coded Units table results match", { + table <- results[["results"]][["Strength"]][["collection"]][["Strength_tableEquation"]][["data"]] + jaspTools::expect_equal_tables(table, + list("Strength = 29.63 + 3.36 A + 2.15 B + 2.65 C 0.22 AB 0.15 AC + 0.011 BC" + )) +}) + +test_that("54.14 Data example 1 (factorial plots, two outcomes) - Strength Model Summary table results match", { + table <- results[["results"]][["Strength"]][["collection"]][["Strength_tableSummary"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0.667625439705684, 0.369719352330779, 0.80057526382341, 3.19427795771905 + )) +}) + +test_that("54.5 Data example 1 (factorial plots, two outcomes) - Density Interaction: InjPress x InjTemp plot matches", { + plotName <- results[["results"]][["Density"]][["collection"]][["Density_factorialPlots"]][["collection"]][["Density_factorialPlots_interactionEffect"]][["collection"]][["Density_factorialPlots_interactionEffect_interaction_InjPress_x_InjTemp"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "interaction-injpress-x-injtemp-54-05") +}) + +test_that("54.6 Data example 1 (factorial plots, two outcomes) - Density Interaction: Material x InjPress plot matches", { + plotName <- results[["results"]][["Density"]][["collection"]][["Density_factorialPlots"]][["collection"]][["Density_factorialPlots_interactionEffect"]][["collection"]][["Density_factorialPlots_interactionEffect_interaction_InjPress_x_Material"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "interaction-material-x-injpress-54-06") +}) + +test_that("54.7 Data example 1 (factorial plots, two outcomes) - Density Interaction: Material x InjTemp plot matches", { + plotName <- results[["results"]][["Density"]][["collection"]][["Density_factorialPlots"]][["collection"]][["Density_factorialPlots_interactionEffect"]][["collection"]][["Density_factorialPlots_interactionEffect_interaction_InjTemp_x_Material"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "interaction-material-x-injtemp-54-07") +}) + +test_that("54.8 Data example 1 (factorial plots, two outcomes) - Density Main Effect: InjPress plot matches", { + plotName <- results[["results"]][["Density"]][["collection"]][["Density_factorialPlots"]][["collection"]][["Density_factorialPlots_mainEffect"]][["collection"]][["Density_factorialPlots_mainEffect_mainEffect_InjPress"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "main-effect-injpress-54-08") +}) + +test_that("54.9 Data example 1 (factorial plots, two outcomes) - Density Main Effect: InjTemp plot matches", { + plotName <- results[["results"]][["Density"]][["collection"]][["Density_factorialPlots"]][["collection"]][["Density_factorialPlots_mainEffect"]][["collection"]][["Density_factorialPlots_mainEffect_mainEffect_InjTemp"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "main-effect-injtemp-54-09") +}) + +test_that("54.10 Data example 1 (factorial plots, two outcomes) - Density Main Effect: Material plot matches", { + plotName <- results[["results"]][["Density"]][["collection"]][["Density_factorialPlots"]][["collection"]][["Density_factorialPlots_mainEffect"]][["collection"]][["Density_factorialPlots_mainEffect_mainEffect_Material"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "main-effect-material-54-10") +}) + +test_that("54.15 Data example 1 (factorial plots, two outcomes) - Strength Interaction: InjPress x InjTemp plot matches", { + plotName <- results[["results"]][["Strength"]][["collection"]][["Strength_factorialPlots"]][["collection"]][["Strength_factorialPlots_interactionEffect"]][["collection"]][["Strength_factorialPlots_interactionEffect_interaction_InjPress_x_InjTemp"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "interaction-injpress-x-injtemp-54-15") +}) + +test_that("54.16 Data example 1 (factorial plots, two outcomes) - Strength Interaction: Material x InjPress plot matches", { + plotName <- results[["results"]][["Strength"]][["collection"]][["Strength_factorialPlots"]][["collection"]][["Strength_factorialPlots_interactionEffect"]][["collection"]][["Strength_factorialPlots_interactionEffect_interaction_InjPress_x_Material"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "interaction-material-x-injpress-54-16") +}) + +test_that("54.17 Data example 1 (factorial plots, two outcomes) - Strength Interaction: Material x InjTemp plot matches", { + plotName <- results[["results"]][["Strength"]][["collection"]][["Strength_factorialPlots"]][["collection"]][["Strength_factorialPlots_interactionEffect"]][["collection"]][["Strength_factorialPlots_interactionEffect_interaction_InjTemp_x_Material"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "interaction-material-x-injtemp-54-17") +}) + +test_that("54.18 Data example 1 (factorial plots, two outcomes) - Strength Main Effect: InjPress plot matches", { + plotName <- results[["results"]][["Strength"]][["collection"]][["Strength_factorialPlots"]][["collection"]][["Strength_factorialPlots_mainEffect"]][["collection"]][["Strength_factorialPlots_mainEffect_mainEffect_InjPress"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "main-effect-injpress-54-18") +}) + +test_that("54.19 Data example 1 (factorial plots, two outcomes) - Strength Main Effect: InjTemp plot matches", { + plotName <- results[["results"]][["Strength"]][["collection"]][["Strength_factorialPlots"]][["collection"]][["Strength_factorialPlots_mainEffect"]][["collection"]][["Strength_factorialPlots_mainEffect_mainEffect_InjTemp"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "main-effect-injtemp-54-19") +}) + +test_that("54.20 Data example 1 (factorial plots, two outcomes) - Strength Main Effect: Material plot matches", { + plotName <- results[["results"]][["Strength"]][["collection"]][["Strength_factorialPlots"]][["collection"]][["Strength_factorialPlots_mainEffect"]][["collection"]][["Strength_factorialPlots_mainEffect_mainEffect_Material"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "main-effect-material-54-20") +}) + +#### Data example 2 (factorial plots, one outcome) #### +options <- analysisOptions("doeAnalysis") +options$designType <- "factorialDesign" +options$dependentFactorial <- c("Distance") +options$fixedFactorsFactorial <- c("Ball") +options$continuousFactorsFactorial <- c("Angle", "Vertical") +options$codeFactors <- TRUE +options$codeFactorsMethod <- "automatic" +options$tableEquation <- TRUE +options$tableAlias <- TRUE +options$highestOrder <- FALSE +options$modelTerms <- list( + list(components = "Ball"), + list(components = "Angle"), + list(components = "Vertical"), + list(components = c("Ball", "Angle")), + list(components = c("Angle", "Vertical")), + list(components = c("Ball", "Vertical")) +) +options$mainEffectsPlot <- TRUE +options$mainEffectsPlotCi <- TRUE +options$interactionPlot <- TRUE +options$interactionPlotCi <- TRUE +set.seed(123) +results <- runAnalysis("doeAnalysis", "datasets/doeAnalysis/doe_realDataExample2.csv", options) + +test_that("55.1 Data example 2 (factorial plots, one outcome) - ANOVA table results match", { + table <- results[["results"]][["Distance"]][["collection"]][["Distance_tableAnova"]][["data"]] + jaspTools::expect_equal_tables(table, + list(3442.47916666667, 20654.875, 6, 28.3445022585625, 2.35137006826626e-05, + "Model", "", 20274.6875, 3, "", "", " Linear terms", + 826.5625, 826.5625, 1, 6.80570644405055, 0.0283276128893302, + " Ball", 4257.5625, 4257.5625, 1, 35.055692149351, + 0.000223251267369552, " Angle", 15190.5625, + 15190.5625, 1, 125.075247298302, 1.39986713911565e-06, " Vertical", + "", 380.1875, 3, "", "", " Interaction terms", 85.5624999999998, + 85.5624999999998, 1, 0.704499971410599, 0.423009692024339, " BallAngle", + 280.5625, 280.5625, 1, 2.31008062210533, 0.162858010109754, + " AngleVertical", + 14.0625, 14.0625, 1, 0.115787066155869, 0.741456839635441, " BallVertical", + 121.451388888889, 1093.0625, 9, "", "", "Error", "", 21747.9375, + 15, "", "", "Total")) +}) + +test_that("55.2 Data example 2 (factorial plots, one outcome) - Coded Coefficients table results match", { + table <- results[["results"]][["Distance"]][["collection"]][["Distance_tableCoefficients"]][["data"]] + jaspTools::expect_equal_tables(table, + list("(Intercept)", 260.4375, "", 8.41437497943459e-15, 2.75512464428663, + "(Intercept)", 94.5283911347079, "", "A", -7.1875, -14.375, + 0.0283276128893302, 2.75512464428663, "Ball", -2.60877489332647, + 1, "B", 16.3125, 32.625, 0.000223251267369552, 2.75512464428663, + "Angle", 5.92078475789747, 1, "C", 30.8125, 61.625, 1.39986713911565e-06, + 2.75512464428663, "Vertical", 11.1837045426952, 1, "AB", -2.3125, + -4.62499999999999, 0.42300969202434, 2.75512464428663, "BallAngle", + -0.839344965678951, 1, "BC", 4.1875, 8.37500000000001, 0.162858010109754, + 2.75512464428664, "AngleVertical", 1.51989493785108, + 1, "AC", 0.937500000000003, 1.87500000000001, 0.74145683963544, + 2.75512464428663, "BallVertical", 0.340274986086063, + 1)) +}) + +test_that("55.3 Data example 2 (factorial plots, one outcome) - Regression equation in Coded Units table results match", { + table <- results[["results"]][["Distance"]][["collection"]][["Distance_tableEquation"]][["data"]] + jaspTools::expect_equal_tables(table, + list("Distance = 260.44 7.19 A + 16.31 B + 30.81 C 2.31 AB + 4.19 BC + 0.94 AC" + )) +}) + +test_that("55.4 Data example 2 (factorial plots, one outcome) - Model Summary table results match", { + table <- results[["results"]][["Distance"]][["collection"]][["Distance_tableSummary"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0.916232477984023, 0.841151958251185, 0.949739486790414, 11.0204985771465 + )) +}) + +test_that("55.5 Data example 2 (factorial plots, one outcome) - Interaction: Angle x Vertical plot matches", { + plotName <- results[["results"]][["Distance"]][["collection"]][["Distance_factorialPlots"]][["collection"]][["Distance_factorialPlots_interactionEffect"]][["collection"]][["Distance_factorialPlots_interactionEffect_interaction_Angle_x_Vertical"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "interaction-angle-x-vertical-55-05") +}) + +test_that("55.6 Data example 2 (factorial plots, one outcome) - Interaction: Ball x Angle plot matches", { + plotName <- results[["results"]][["Distance"]][["collection"]][["Distance_factorialPlots"]][["collection"]][["Distance_factorialPlots_interactionEffect"]][["collection"]][["Distance_factorialPlots_interactionEffect_interaction_Angle_x_Ball"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "interaction-angle-x-ball-55-06") +}) + +test_that("55.7 Data example 2 (factorial plots, one outcome) - Interaction: Ball x Vertical plot matches", { + plotName <- results[["results"]][["Distance"]][["collection"]][["Distance_factorialPlots"]][["collection"]][["Distance_factorialPlots_interactionEffect"]][["collection"]][["Distance_factorialPlots_interactionEffect_interaction_Vertical_x_Ball"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "interaction-vertical-x-ball-55-07") +}) + +test_that("55.8 Data example 2 (factorial plots, one outcome) - Main Effect: Angle plot matches", { + plotName <- results[["results"]][["Distance"]][["collection"]][["Distance_factorialPlots"]][["collection"]][["Distance_factorialPlots_mainEffect"]][["collection"]][["Distance_factorialPlots_mainEffect_mainEffect_Angle"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "main-effect-angle-55-08") +}) + +test_that("55.9 Data example 2 (factorial plots, one outcome) - Main Effect: Ball plot matches", { + plotName <- results[["results"]][["Distance"]][["collection"]][["Distance_factorialPlots"]][["collection"]][["Distance_factorialPlots_mainEffect"]][["collection"]][["Distance_factorialPlots_mainEffect_mainEffect_Ball"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "main-effect-ball-55-09") +}) + +test_that("55.10 Data example 2 (factorial plots, one outcome) - Main Effect: Vertical plot matches", { + plotName <- results[["results"]][["Distance"]][["collection"]][["Distance_factorialPlots"]][["collection"]][["Distance_factorialPlots_mainEffect"]][["collection"]][["Distance_factorialPlots_mainEffect_mainEffect_Vertical"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "main-effect-vertical-55-10") +}) + +#### Data example 3 (response surface, two outcomes, factorial plots) #### +options <- analysisOptions("doeAnalysis") +options$designType <- "responseSurfaceDesign" +options$dependentResponseSurface <- c("Syruploss", "Cost") +options$fixedFactorsResponseSurface <- c("Nozzle") +options$continuousFactorsResponseSurface <- c("Speed", "Pressure") +options$codeFactors <- FALSE +options$squaredTermsCoded <- TRUE +options$codeFactorsMethod <- "automatic" +options$tableEquation <- TRUE +options$tableAlias <- TRUE +options$rsmPredefinedModel <- TRUE +options$rsmPredefinedTerms <- "fullQuadratic" +options$mainEffectsPlot <- TRUE +options$mainEffectsPlotCi <- TRUE +options$interactionPlot <- TRUE +options$interactionPlotCi <- TRUE +set.seed(123) +results <- runAnalysis("doeAnalysis", "datasets/doeAnalysis/doe_realDataExample3.csv", options) + +test_that("56.1 Data example 3 (response surface, two outcomes) - Cost ANOVA table results match", { + table <- results[["results"]][["Cost"]][["collection"]][["Cost_tableAnova"]][["data"]] + jaspTools::expect_equal_tables(table, + list(4213.26273148148, 33706.1018518519, 8, 8.55776924337149, 5.37520340999456e-07, + "Model", "", 9118.77777777778, 3, "", "", " Linear terms", + 6833.77777777778, 6833.77777777778, 1, 13.8804287816484, 0.000541387947404092, + " Speed", 2116, 2116, 1, 4.29791372459861, + 0.0439141309793144, " Pressure", 169, 169, + 1, 0.343264375924936, 0.560878208408529, " Nozzle", + "", 24043.7407407407, 2, "", "", " Squared terms", + 4306.7037037037, 4306.7037037037, 1, 8.74756188843468, 0.00492545805087858, + " Speed^2", 19737.037037037, 19737.037037037, + 1, 40.0888858054785, 1.00380594014704e-07, " Pressure^2", + "", 543.583333333336, 3, "", "", " Interaction terms", + 0.166666666667879, 0.166666666667879, 1, 0.000338525025569461, + 0.98540184886942, " SpeedPressure", + 198.375, 198.375, 1, 0.402929411681119, 0.528794574263472, " SpeedNozzle", + 345.041666666668, 345.041666666668, 1, 0.70083143418008, 0.406928561138628, + " PressureNozzle", + 492.331893004115, 22154.9351851852, 45, "", "", "Error", "", + 55861.0370370371, 53, "", "", "Total")) +}) + +test_that("56.2 Data example 3 (response surface, two outcomes) - Cost Uncoded Coefficients table results match", { + table <- results[["results"]][["Cost"]][["collection"]][["Cost_tableCoefficients"]][["data"]] + jaspTools::expect_equal_tables(table, + list("", 325.648148148162, "", 0.204046185282406, 252.405013309973, + "(Intercept)", 1.29018098284855, "", "A", -10.690277777778, + -427.611111111118, 0.0103445869391715, 3.98181749804874, "Speed", + -2.68477341892657, 446.500000000037, "B", 50.0999999999997, + 500.999999999997, 5.43884056833538e-06, 9.62330859388601, "Pressure", + 5.20610967747931, 163.000000000001, "C1", -45.0462962962947, + -135.138888888884, 0.217976561749922, 36.0176413208199, "Nozzle1", + -1.25067313250898, 4692.25000000024, "C2", 28.5092592592587, + 85.527777777776, 0.433078949880629, 36.0176413208199, "Nozzle2", + 0.791535986638275, 4692.25000000024, "A^2", 0.0473611111111117, + 1.89444444444447, 0.00587968269999673, 0.016319289653662, "Speed^2", + 2.90215518666795, "", "B^2", -1.62222222222222, -16.2222222222222, + 1.96212230408646e-07, 0.26110863445859, "Pressure^2", -6.2128248864152, + "", "AB", 0.000833333333334677, 0.108333333333508, 0.985681300491276, + 0.0461579215130072, "SpeedPressure", 0.0180539614007499, + 446.500000000037, "AC1", 0.19027777777777, 26.4486111111101, + 0.479172295252194, 0.266492884107683, "SpeedNozzle1", + 0.714006974013173, 446.500000000037, "AC2", -0.0930555555555526, + -12.9347222222218, 0.728694435426281, 0.266492884107683, "SpeedNozzle2", + -0.349185892400606, 446.500000000037, "BC1", 1.24999999999997, + 23.7499999999994, 0.247548766895022, 1.06597153643073, "PressureNozzle1", + 1.17263919089756, 163.000000000001, "BC2", -0.983333333333321, + -18.6833333333331, 0.361549407955619, 1.06597153643073, "PressureNozzle2", + -0.922476163506097, 163.000000000001)) +}) + +test_that("56.3 Data example 3 (response surface, two outcomes) - Cost Discrete Predictor Levels table results match", { + table <- results[["results"]][["Cost"]][["collection"]][["Cost_tableCoefficientsLegend"]][["data"]] + jaspTools::expect_equal_tables(table, + list(1, "C1", 2, "C2")) +}) + +test_that("56.4 Data example 3 (response surface, two outcomes) - Cost Regression equation in Uncoded Units table results match", { + table <- results[["results"]][["Cost"]][["collection"]][["Cost_tableEquation"]][["data"]] + jaspTools::expect_equal_tables(table, + list("Cost = 325.65 10.69 A + 50.1 B 45.05 C1 + 28.51 C2 + 0.047 A^2 1.62 B^2 + 0.00083 AB + 0.19 AC1 0.093 AC2 + 1.25 BC1 0.98 BC2" + )) +}) + +test_that("56.5 Data example 3 (response surface, two outcomes) - Cost Model Summary table results match", { + table <- results[["results"]][["Cost"]][["collection"]][["Cost_tableSummary"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0.514856065416552, 0.376163467067314, 0.615546315990475, 22.6126710588604 + )) +}) + +test_that("56.6 Data example 3 (response surface, two outcomes) - Syruploss ANOVA table results match", { + table <- results[["results"]][["Syruploss"]][["collection"]][["Syruploss_tableAnova"]][["data"]] + jaspTools::expect_equal_tables(table, + list(16677.5451388889, 133420.361111111, 8, 18.4474907805641, 7.11868287266709e-12, + "Model", "", 2154.69444444445, 3, "", "", " Linear terms", + 1406.25, 1406.25, 1, 1.55549175218102, 0.218778715472802, " Speed", + 400, 400, 1, 0.442450987287045, 0.509336803585456, " Pressure", + 348.444444444445, 348.444444444445, 1, 0.385423971147827, 0.53784658349265, + " Nozzle", "", 128489.416666667, 2, "", "", + " Squared terms", 59784.0833333334, 59784.0833333334, + 1, 66.1288167372108, 2.21684744052923e-10, " Speed^2", + 68705.3333333334, 68705.3333333334, 1, 75.9968564130471, 3.18756375741766e-11, + " Pressure^2", "", 2776.25, 3, "", "", " Interaction terms", + 425.041666666664, 425.041666666664, 1, 0.470150262636992, 0.496435508498772, + " SpeedPressure", + 1700.16666666667, 1700.16666666667, 1, 1.88060105054798, 0.177065829112353, + " SpeedNozzle", + 651.041666666664, 651.041666666664, 1, 0.720135070454172, 0.400591317242241, + " PressureNozzle", + 904.054938271605, 40682.4722222222, 45, "", "", "Error", "", + 174102.833333333, 53, "", "", "Total")) +}) + +test_that("56.7 Data example 3 (response surface, two outcomes) - Syruploss Uncoded Coefficients table results match", { + table <- results[["results"]][["Syruploss"]][["collection"]][["Syruploss_tableCoefficients"]][["data"]] + jaspTools::expect_equal_tables(table, + list("", 1894.69444444448, "", 3.67539211300177e-07, 314.554222132801, + "(Intercept)", 6.02342715859196, "", "A", -42.6687500000005, + -1706.75000000002, 8.30873548420183e-11, 4.96225288613952, "Speed", + -8.59866495703636, 446.50000000001, "B", 86.4166666666658, 864.166666666658, + 7.39436893500888e-09, 11.9928376595922, "Pressure", 7.205689689091, + 163.000000000007, "C1", -16.9444444444391, -50.8333333333173, + 0.707704590783008, 44.8861969901336, "Nozzle1", -0.377497885333517, + 4692.25000000005, "C2", 109.861111111109, 329.583333333327, + 0.0186453946980925, 44.8861969901337, "Nozzle2", 2.44754776474508, + 4692.25000000005, "A^2", 0.176458333333335, 7.05833333333339, + 6.50260075782852e-11, 0.0203375574654827, "Speed^2", 8.67647620088218, + "", "B^2", -3.02666666666666, -30.2666666666666, 9.31517935208782e-12, + 0.325400919447723, "Pressure^2", -9.30134638772251, "", "AB", + 0.0420833333333381, 5.47083333333395, 0.468482798511116, 0.0575232991864556, + "SpeedPressure", 0.731587616296651, 446.50000000001, + "AC1", -0.137500000000027, -19.1125000000038, 0.680967457018566, + 0.332110922699755, "SpeedNozzle1", -0.414018301121443, + 446.50000000001, "AC2", -0.566666666666656, -78.7666666666651, + 0.0953454884663746, 0.332110922699755, "SpeedNozzle2", + -1.70625724098497, 446.50000000001, "BC1", 2.59999999999989, + 49.3999999999979, 0.0569946813000773, 1.32844369079902, "PressureNozzle1", + 1.95717742348271, 163.000000000007, "BC2", -3.11666666666663, + -59.2166666666659, 0.0237654640924297, 1.32844369079902, "PressureNozzle2", + -2.34610370635434, 163.000000000007)) +}) + +test_that("56.8 Data example 3 (response surface, two outcomes) - Syruploss Discrete Predictor Levels table results match", { + table <- results[["results"]][["Syruploss"]][["collection"]][["Syruploss_tableCoefficientsLegend"]][["data"]] + jaspTools::expect_equal_tables(table, + list(1, "C1", 2, "C2")) +}) + +test_that("56.9 Data example 3 (response surface, two outcomes) - Syruploss Regression equation in Uncoded Units table results match", { + table <- results[["results"]][["Syruploss"]][["collection"]][["Syruploss_tableEquation"]][["data"]] + jaspTools::expect_equal_tables(table, + list("Syruploss = 1894.69 42.67 A + 86.42 B 16.94 C1 + 109.86 C2 + 0.18 A^2 3.03 B^2 + 0.042 AB 0.14 AC1 0.57 AC2 + 2.6 BC1 3.12 BC2" + )) +}) + +test_that("56.10 Data example 3 (response surface, two outcomes) - Syruploss Model Summary table results match", { + table <- results[["results"]][["Syruploss"]][["collection"]][["Syruploss_tableSummary"]][["data"]] + jaspTools::expect_equal_tables(table, + list(0.75824868470439, 0.698777409935859, 0.808423485992158, 28.1805462656542 + )) +}) + +test_that("56.11 Data example 3 (response surface, two outcomes) - Cost Interaction: Pressure x Nozzle plot matches", { + plotName <- results[["results"]][["Cost"]][["collection"]][["Cost_factorialPlots"]][["collection"]][["Cost_factorialPlots_interactionEffect"]][["collection"]][["Cost_factorialPlots_interactionEffect_interaction_Pressure_x_Nozzle"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "interaction-pressure-x-nozzle-56-11") +}) + +test_that("56.12 Data example 3 (response surface, two outcomes) - Cost Interaction: Speed x Nozzle plot matches", { + plotName <- results[["results"]][["Cost"]][["collection"]][["Cost_factorialPlots"]][["collection"]][["Cost_factorialPlots_interactionEffect"]][["collection"]][["Cost_factorialPlots_interactionEffect_interaction_Speed_x_Nozzle"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "interaction-speed-x-nozzle-56-12") +}) + +test_that("56.13 Data example 3 (response surface, two outcomes) - Cost Interaction: Speed x Pressure plot matches", { + plotName <- results[["results"]][["Cost"]][["collection"]][["Cost_factorialPlots"]][["collection"]][["Cost_factorialPlots_interactionEffect"]][["collection"]][["Cost_factorialPlots_interactionEffect_interaction_Speed_x_Pressure"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "interaction-speed-x-pressure-56-13") +}) + +test_that("56.14 Data example 3 (response surface, two outcomes) - Cost Main Effect: Nozzle plot matches", { + plotName <- results[["results"]][["Cost"]][["collection"]][["Cost_factorialPlots"]][["collection"]][["Cost_factorialPlots_mainEffect"]][["collection"]][["Cost_factorialPlots_mainEffect_mainEffect_Nozzle"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "main-effect-nozzle-56-14") +}) + +test_that("56.15 Data example 3 (response surface, two outcomes) - Cost Main Effect: Pressure plot matches", { + plotName <- results[["results"]][["Cost"]][["collection"]][["Cost_factorialPlots"]][["collection"]][["Cost_factorialPlots_mainEffect"]][["collection"]][["Cost_factorialPlots_mainEffect_mainEffect_Pressure"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "main-effect-pressure-56-15") +}) + +test_that("56.16 Data example 3 (response surface, two outcomes) - Cost Main Effect: Speed plot matches", { + plotName <- results[["results"]][["Cost"]][["collection"]][["Cost_factorialPlots"]][["collection"]][["Cost_factorialPlots_mainEffect"]][["collection"]][["Cost_factorialPlots_mainEffect_mainEffect_Speed"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "main-effect-speed-56-16") +}) + +test_that("56.17 Data example 3 (response surface, two outcomes) - Syruploss Interaction: Pressure x Nozzle plot matches", { + plotName <- results[["results"]][["Syruploss"]][["collection"]][["Syruploss_factorialPlots"]][["collection"]][["Syruploss_factorialPlots_interactionEffect"]][["collection"]][["Syruploss_factorialPlots_interactionEffect_interaction_Pressure_x_Nozzle"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "interaction-pressure-x-nozzle-56-17") +}) + +test_that("56.18 Data example 3 (response surface, two outcomes) - Syruploss Interaction: Speed x Nozzle plot matches", { + plotName <- results[["results"]][["Syruploss"]][["collection"]][["Syruploss_factorialPlots"]][["collection"]][["Syruploss_factorialPlots_interactionEffect"]][["collection"]][["Syruploss_factorialPlots_interactionEffect_interaction_Speed_x_Nozzle"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "interaction-speed-x-nozzle-56-18") +}) + +test_that("56.19 Data example 3 (response surface, two outcomes) - Syruploss Interaction: Speed x Pressure plot matches", { + plotName <- results[["results"]][["Syruploss"]][["collection"]][["Syruploss_factorialPlots"]][["collection"]][["Syruploss_factorialPlots_interactionEffect"]][["collection"]][["Syruploss_factorialPlots_interactionEffect_interaction_Speed_x_Pressure"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "interaction-speed-x-pressure-56-19") +}) + +test_that("56.20 Data example 3 (response surface, two outcomes) - Syruploss Main Effect: Nozzle plot matches", { + plotName <- results[["results"]][["Syruploss"]][["collection"]][["Syruploss_factorialPlots"]][["collection"]][["Syruploss_factorialPlots_mainEffect"]][["collection"]][["Syruploss_factorialPlots_mainEffect_mainEffect_Nozzle"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "main-effect-nozzle-56-20") +}) + +test_that("56.21 Data example 3 (response surface, two outcomes) - Syruploss Main Effect: Pressure plot matches", { + plotName <- results[["results"]][["Syruploss"]][["collection"]][["Syruploss_factorialPlots"]][["collection"]][["Syruploss_factorialPlots_mainEffect"]][["collection"]][["Syruploss_factorialPlots_mainEffect_mainEffect_Pressure"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "main-effect-pressure-56-21") +}) + +test_that("56.22 Data example 3 (response surface, two outcomes) - Syruploss Main Effect: Speed plot matches", { + plotName <- results[["results"]][["Syruploss"]][["collection"]][["Syruploss_factorialPlots"]][["collection"]][["Syruploss_factorialPlots_mainEffect"]][["collection"]][["Syruploss_factorialPlots_mainEffect_mainEffect_Speed"]][["data"]] + testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] + jaspTools::expect_equal_plots(testPlot, "main-effect-speed-56-22") +}) + + ## Contour plot #### options <- analysisOptions("doeAnalysis") @@ -5214,8 +5765,8 @@ options$contourSurfacePlotResponseDivision <- 5 set.seed(123) results <- runAnalysis("doeAnalysis", "datasets/doeAnalysis/RSM3contCCD.csv", options) -test_that("54.1 Contour plot matches", { +test_that("57.1 Contour plot matches", { plotName <- results[["results"]][["Result"]][["collection"]][["Result_contourSurfacePlot"]][["collection"]][["Result_contourSurfacePlot_Contour plot of Result vs A and B"]][["data"]] testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]] - jaspTools::expect_equal_plots(testPlot, "contour-plot54") + jaspTools::expect_equal_plots(testPlot, "contour-plot57") })