diff --git a/R/commonAnovaBayesian.R b/R/commonAnovaBayesian.R index 7feb4be7..289ed7f8 100644 --- a/R/commonAnovaBayesian.R +++ b/R/commonAnovaBayesian.R @@ -1619,16 +1619,16 @@ BANOVAcomputMatchedInclusion <- function(effectNames, effects.matrix, interactio plotErrorBars <- options$descriptivePlotCi errorBarType <- "ci" conf.interval <- options$descriptivePlotCiLevel - moreyCorrection <- TRUE + normalizeErrorBars <- TRUE descriptivesPlotContainer$dependOn(c("dependent", "descriptivePlotCi", "descriptivePlotCiLevel")) } else { plotErrorBars <- options$descriptivePlotErrorBar errorBarType <- options$descriptivePlotErrorBarType conf.interval <- options$descriptivePlotCiLevel - moreyCorrection <- if (is.null(options[["applyMoreyCorrectionErrorBars"]])) FALSE else options[["applyMoreyCorrectionErrorBars"]] + normalizeErrorBars <- if (is.null(options[["normalizeErrorBarsDescriptives"]])) FALSE else options[["normalizeErrorBarsDescriptives"]] descriptivesPlotContainer$dependOn(c("dependent", "descriptivePlotErrorBar", "descriptivePlotErrorBarType", "descriptivePlotCiLevel", - "descriptivePlotErrorBarPooled", "applyMoreyCorrectionErrorBars")) + "descriptivePlotErrorBarPooled", "normalizeErrorBarsDescriptives")) } usePooledSE <- if (is.null(options[["descriptivePlotErrorBarPooled"]])) FALSE else options[["descriptivePlotErrorBarPooled"]] @@ -1653,7 +1653,7 @@ BANOVAcomputMatchedInclusion <- function(effectNames, effects.matrix, interactio betweenSubjectFactors <- groupVars[groupVars %in% options$betweenSubjectFactors] repeatedMeasuresFactors <- groupVars[groupVars %in% sapply(options$repeatedMeasuresFactors, `[[`, "name")] - if (length(repeatedMeasuresFactors) == 0) { + if (length(repeatedMeasuresFactors) == 0 || isFALSE(normalizeErrorBars)) { summaryStat <- jaspTTests::.summarySE(as.data.frame(dataset), measurevar = dependent, groupvars = groupVars, conf.interval = conf.interval, na.rm = TRUE, .drop = FALSE, errorBarType = errorBarType, dependentName = .BANOVAdependentName, @@ -1666,7 +1666,6 @@ BANOVAcomputMatchedInclusion <- function(effectNames, effects.matrix, interactio conf.interval = conf.interval, na.rm=TRUE, .drop = FALSE, errorBarType = errorBarType, usePooledSE = usePooledSE, - useMoreyCorrection = moreyCorrection, dependentName = .BANOVAdependentName, subjectName = .BANOVAsubjectName) } @@ -1861,7 +1860,7 @@ BANOVAcomputMatchedInclusion <- function(effectNames, effects.matrix, interactio "barPlotHorizontalZeroFix", "barPlotCiInterval", "usePooledStandErrorCITwo")) usePooledSE <- if (is.null(options[["usePooledStandErrorCITwo"]])) FALSE else options[["usePooledStandErrorCITwo"]] - useMoreyCorrection <- if (is.null(options[["applyMoreyCorrectionErrorBarsBarplot"]])) TRUE else options[["applyMoreyCorrectionErrorBarsBarplot"]] + normalizeErrorBars <- if (is.null(options[["normalizeErrorBarsBarplot"]])) TRUE else options[["normalizeErrorBarsBarplot"]] barPlotHorizontalZeroFix <- options[["barPlotHorizontalZeroFix"]] barPlotContainer$dependOn(c("barPlotHorizontalAxis", "barPlotSeparatePlots", "labelYAxisTwo")) @@ -1884,7 +1883,7 @@ BANOVAcomputMatchedInclusion <- function(effectNames, effects.matrix, interactio betweenSubjectFactors <- groupVars[groupVars %in% options[["betweenSubjectFactors"]]] repeatedMeasuresFactors <- groupVars[groupVars %in% sapply(options[["repeatedMeasuresFactors"]], `[[`, "name")] - if (length(repeatedMeasuresFactors) == 0) { + if (length(repeatedMeasuresFactors) == 0 || isFALSE(normalizeErrorBars)) { summaryStat <- jaspTTests::.summarySE(as.data.frame(dataset), measurevar = dependent, groupvars = groupVars, conf.interval = confInterval, na.rm = TRUE, .drop = FALSE, errorBarType = errorBarType, dependentName = .BANOVAdependentName, @@ -1897,7 +1896,6 @@ BANOVAcomputMatchedInclusion <- function(effectNames, effects.matrix, interactio conf.interval = confInterval, na.rm=TRUE, .drop = FALSE, errorBarType = errorBarType, usePooledSE = usePooledSE, - useMoreyCorrection = useMoreyCorrection, dependentName = .BANOVAdependentName, subjectName = .BANOVAsubjectName) } diff --git a/inst/help/AnovaRepeatedMeasures.md b/inst/help/AnovaRepeatedMeasures.md index fa999183..69a27800 100755 --- a/inst/help/AnovaRepeatedMeasures.md +++ b/inst/help/AnovaRepeatedMeasures.md @@ -92,7 +92,7 @@ To create a descriptive plot, select the repeated measures factor to be placed o - Confidence interval: This option is selected by default. With this option, the error bars will represent confidence intervals of the mean of each level combination of the repeated measures factors. By default the confidence interval is set to 95%, but this can be changed into the desired percentage. - Standard error: By selecting this option, the error bars will represent standard errors of the mean of each level combination of the repeated measures factor. - Average across unused RM factors: When there are multiple RM factors in the model, but only plotting a subset of these factors, the mean is taken across the unused RM factors. For instance, when there are two RM factors with two levels in the model, A (1&2) and B (1&2), and only A is selected to be plotted, the average is taken of B across its levels. This means that when the mean of A1 is plotted, it is actually the average of A1B1 and A1B2). This procedure is discussed by Loftus & Masson (1994). When the box is not ticked, the averages are not taken, and the columns A1B1 and A1B2 are simply concatenated. - - Normalize error bars: In order to get accurate confidence intervals and standard errors, the data are normalized by subtracting the appropriate participantʹs mean performance from each observation, and then adding the grand mean score to every observation. The variances of the resulting normalized values in each condition, and thus the size of the bars, no longer depend on the participant effects and are therefore a more accurate representation of the experimental manipulation. See Morey (2008) for a thorough discussion of this procedure. + - Normalize error bars: In order to get accurate confidence intervals and standard errors for within subjects effects, the data are normalized by subtracting the appropriate participantʹs mean performance from each observation, and then adding the grand mean score to every observation. The variances of the resulting normalized values in each condition, and thus the size of the bars, no longer depend on the participant effects and are therefore a more accurate representation of the experimental manipulation. See Morey (2008) for a thorough discussion of this procedure. Recommended when visualizing within subjects effects, but not for between subjects effects. ### Bar Plots - To create a bar plot, select the repeated measures factor to be placed on the horizontal axis. If there are more than one repeated measures factor, the variables can be displayed in separate plots by selecting the other variable in the box Separate plots. diff --git a/inst/qml/AnovaRepeatedMeasures.qml b/inst/qml/AnovaRepeatedMeasures.qml index ee8846d0..03999ae0 100644 --- a/inst/qml/AnovaRepeatedMeasures.qml +++ b/inst/qml/AnovaRepeatedMeasures.qml @@ -162,7 +162,7 @@ Form framework: form.framework TextField { name: "labelYAxisTwo"; label: qsTr("Label y-axis"); fieldWidth: 200 } CheckBox { name: "usePooledStandErrorCITwo"; label: qsTr("Average across unused RM factors") } - CheckBox { name: "applyMoreyCorrectionErrorBarsBarplot"; label: qsTr("Normalize error bars"); checked: true} + CheckBox { name: "normalizeErrorBarsBarplot"; label: qsTr("Normalize error bars"); checked: true} } Common.RainCloudPlots diff --git a/inst/qml/common/classical/DescriptivePlots.qml b/inst/qml/common/classical/DescriptivePlots.qml index 89a8d253..5ea8406c 100644 --- a/inst/qml/common/classical/DescriptivePlots.qml +++ b/inst/qml/common/classical/DescriptivePlots.qml @@ -61,7 +61,7 @@ Section CheckBox { - name: "applyMoreyCorrectionErrorBars" + name: "normalizeErrorBarsDescriptives" label: qsTr("Normalize error bars") checked: true visible: analysis === Common.Type.Analysis.RMANOVA