Skip to content

Fix post hoc issue #384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions R/ancova.R
Original file line number Diff line number Diff line change
Expand Up @@ -885,18 +885,18 @@ AncovaInternal <- function(jaspResults, dataset = NULL, options) {
}

if (options$postHocTypeStandard)
.anovaPostHocTable(postHocContainer, dataset, options, anovaContainer[["model"]]$object, anovaContainer[["afexModel"]]$object)
.anovaStandardPostHocTable(postHocContainer, dataset, options, anovaContainer[["model"]]$object, anovaContainer[["afexModel"]]$object)

if (options$postHocTypeGames)
.anovaGamesTable(postHocContainer, dataset, options, anovaContainer[["model"]]$object)
.anovaGamesPostHocTable(postHocContainer, dataset, options, anovaContainer[["model"]]$object)

if (options$postHocTypeDunnet)
.anovaDunnettTable(postHocContainer, dataset, options, anovaContainer[["model"]]$object)
.anovaDunnettPostHocTable(postHocContainer, dataset, options, anovaContainer[["model"]]$object)

return()
}

.anovaPostHocTable <- function(postHocContainer, dataset, options, model, afexModel = NULL) {
.anovaStandardPostHocTable <- function(postHocContainer, dataset, options, model, afexModel = NULL) {
if (!is.null(postHocContainer[["postHocStandardContainer"]]))
return()

Expand Down Expand Up @@ -958,8 +958,8 @@ AncovaInternal <- function(jaspResults, dataset = NULL, options) {
isBetween = TRUE))
avFootnote <- attr(resultPostHoc[[1]], "mesg")[grep(attr(resultPostHoc[[1]], "mesg"), pattern = "Results are averaged")]
if (length(avFootnote) != 0) {
avTerms <- .unv(strsplit(gsub(avFootnote, pattern = "Results are averaged over the levels of: ", replacement = ""),
", ")[[1]])
avTerms <- strsplit(gsub(avFootnote, pattern = "Results are averaged over the levels of: ", replacement = ""),
", ")[[1]]
postHocStandardContainer[[thisVarNameRef]]$addFootnote(gettextf("Results are averaged over the levels of: %s", paste(avTerms, collapse = ", ")))
}
allPvalues <- do.call(cbind, lapply(resultPostHoc, function(x) x$p.value))
Expand Down Expand Up @@ -1098,7 +1098,7 @@ AncovaInternal <- function(jaspResults, dataset = NULL, options) {
}


.anovaGamesTable <- function(postHocContainer, dataset, options, model) {
.anovaGamesPostHocTable <- function(postHocContainer, dataset, options, model) {
if (!is.null(postHocContainer[["postHocGamesContainer"]]))
return()

Expand Down Expand Up @@ -1197,7 +1197,7 @@ AncovaInternal <- function(jaspResults, dataset = NULL, options) {
return()
}

.anovaDunnettTable <- function(postHocContainer, dataset, options, model) {
.anovaDunnettPostHocTable <- function(postHocContainer, dataset, options, model) {
if (!is.null(postHocContainer[["postHocDunnettContainer"]]))
return()

Expand Down
6 changes: 3 additions & 3 deletions R/anovarepeatedmeasures.R
Original file line number Diff line number Diff line change
Expand Up @@ -1000,8 +1000,8 @@ AnovaRepeatedMeasuresInternal <- function(jaspResults, dataset = NULL, options)

if (any(postHocVariables[[postHocVarIndex]] %in% allNames)) { ## If the variable is a repeated measures factor

resultPostHoc[["scheffe"]] <- ""
resultPostHoc[["tukey"]] <- ""
resultPostHoc[["scheffe"]] <- "."
resultPostHoc[["tukey"]] <- "."
if (options$postHocCorrectionScheffe || options$postHocCorrectionTukey) {
cors <- paste(c("Tukey", "Scheffe")[c(options$postHocCorrectionTukey, options$postHocCorrectionScheffe)], collapse = " and ")

Expand All @@ -1024,7 +1024,7 @@ AnovaRepeatedMeasuresInternal <- function(jaspResults, dataset = NULL, options)
postHocContainer[[thisVarNameRef]]$addFootnote(gettextf("Results are averaged over the levels of: %s", paste(avTerms, collapse = ", ")))
}

if (options[["postHocConditionalTable"]]) {
if (options[["postHocConditionalTable"]] & isFALSE(is.null(byVariable))) {
resultPostHoc[[".isNewGroup"]] <- !duplicated(resultPostHoc[[byVariable[termIndex]]])
} else {
resultPostHoc[[".isNewGroup"]] <- !duplicated(resultPostHoc[["contrast_A"]])
Expand Down
2 changes: 1 addition & 1 deletion R/commonAnovaFreq.R
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
confAdjust <- strsplit(confAdjust, " ")[[1]][1]

if (!includeCI) {
correctionFootnote <- gettextf("P-value adjusted for comparing a family of %s", as.character(nEstimates))
correctionFootnote <- gettextf("P-value adjusted for comparing a family of %s estimates.", as.character(nEstimates))
} else if (isFALSE(includeEffectSize) || isFALSE(isBetween)) {
correctionFootnote <- gettextf("P-value and confidence intervals adjusted for comparing a family of %1$s estimates (confidence intervals corrected using the %2$s method).", nEstimates, confAdjust)
} else {
Expand Down
Loading