From 2b8903803571732062cac45c6371ec5865d655a6 Mon Sep 17 00:00:00 2001 From: Konrad1991 Date: Tue, 19 Nov 2024 08:30:12 +0100 Subject: [PATCH] update statistical tests --- bs/R/statisticalTests.R | 13 ++++--------- bs/inst/tinytest/StatisticalTests.R | 2 +- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/bs/R/statisticalTests.R b/bs/R/statisticalTests.R index 2120ebe..3553bc6 100644 --- a/bs/R/statisticalTests.R +++ b/bs/R/statisticalTests.R @@ -37,15 +37,11 @@ testsSidebarUI <- function(id) { ), conditionalPanel( condition = "input.TestsConditionedPanels == 'More than two groups'", - actionButton(NS(id, "aovTest"), "ANOVA", - title = - "Use ANOVA (Analysis of Variance) when comparing the means of more than two groups, - assuming the data is normally distributed and variances are equal across groups. For more information see the Assumption tab" + actionButton(NS(id, "aovTest"), "ANOVA", + title = "Use ANOVA (Analysis of Variance) when comparing the means of more than two groups, assuming the data is normally distributed and variances are equal across groups. For more information see the Assumption tab" ), actionButton(NS(id, "kruskalTest"), "Kruskal-Wallis Test", - title = - "Use the Kruskal-Wallis test when comparing more than two groups but - the assumptions of normality or equal variances are not met. It is a non-parametric test. For more information see the Assumption tab" + title = "Use the Kruskal-Wallis test when comparing more than two groups but the assumptions of normality or equal variances are not met. It is a non-parametric test. For more information see the Assumption tab" ), ), conditionalPanel( @@ -108,6 +104,7 @@ testsUI <- function(id) { testsServer <- function(id, data, listResults) { moduleServer(id, function(input, output, session) { + # Render p adjustment methods output[["padj"]] <- renderUI({ if (input$PostHocTests == "kruskalTest" || input$PostHocTests == "LSD") { @@ -126,8 +123,6 @@ testsServer <- function(id, data, listResults) { ) ) } - # condition = "input.PostHocTests == 'kruskalTest' || input.PostHocTests == 'Least significant difference test'", - }) # Render split by group diff --git a/bs/inst/tinytest/StatisticalTests.R b/bs/inst/tinytest/StatisticalTests.R index 7d7ba9c..bcf9e75 100644 --- a/bs/inst/tinytest/StatisticalTests.R +++ b/bs/inst/tinytest/StatisticalTests.R @@ -77,7 +77,7 @@ app$click("TESTS-PostHocTest") res <- app$get_values()$export df <- CO2 dep <- "uptake" -fit <- with(df, agricolae::kruskal(df[, dep],df[, "conc"]), +fit <- with(df, agricolae::kruskal(df[, dep], df[, "conc"]), alpha = 0.05, p.adj = 0.05, group = TRUE )$groups expected <- cbind(fit, row.names(fit))