Skip to content

Commit

Permalink
add df to posthoc tables
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnnyDoorn committed Sep 12, 2024
1 parent 6a3cdec commit ffe8925
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion R/anovarepeatedmeasures.R
Original file line number Diff line number Diff line change
Expand Up @@ -932,8 +932,9 @@ AnovaRepeatedMeasuresInternal <- function(jaspResults, dataset = NULL, options)
thisVarName <- paste(postHocVariables[[postHocVarIndex]], collapse = ":")
byVariable <- if (options[["postHocConditionalTable"]] && length(postHocVariables[[postHocVarIndex]]) > 1) postHocVariables[[postHocVarIndex]] else NULL
termsToLoop <- if (options[["postHocConditionalTable"]]) postHocVariables[[postHocVarIndex]] else 1
dfType <- if (options[["poolErrorTermFollowup"]] && (length(postHocVariables[[postHocVarIndex]]) > 1)) "number" else "integer"
for (termIndex in seq_along(termsToLoop))
postHocContainer[[ paste0(thisVarName, termIndex)]] <- .createPostHocStandardTable(thisTitle, byVariable[termIndex], options)
postHocContainer[[ paste0(thisVarName, termIndex)]] <- .createPostHocStandardTable(thisTitle, byVariable[termIndex], options, dfType = dfType)

if (options[["postHocLetterTable"]]) {
letterTable <- createJaspTable(title = paste0("Letter-Based Grouping - ", thisVarName))
Expand Down
3 changes: 2 additions & 1 deletion R/commonAnovaFreq.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
return(coefTable)
}

.createPostHocStandardTable <- function(myTitle, byVariable = NULL, options, makeBootstrapTable = FALSE) {
.createPostHocStandardTable <- function(myTitle, byVariable = NULL, options, makeBootstrapTable = FALSE, dfType = "integer") {

preTitle <- if (!makeBootstrapTable) gettext("Post Hoc Comparisons - ") else gettext("Bootstrapped Post Hoc Comparisons - ")
postHocTable <- createJaspTable(title = paste0(preTitle, myTitle)) #this paste is ok
Expand All @@ -92,6 +92,7 @@
}

postHocTable$addColumnInfo(name="SE", title=gettext("SE"), type="number")
postHocTable$addColumnInfo(name="df", title=gettext("df"), type = dfType)

if (makeBootstrapTable)
postHocTable$addColumnInfo(name="bias", title=gettext("bias"), type="number")
Expand Down

0 comments on commit ffe8925

Please sign in to comment.