Skip to content

Commit

Permalink
fixed confidence interval switch, randomPermutation interaction
Browse files Browse the repository at this point in the history
  • Loading branch information
karchjd committed Mar 10, 2023
1 parent b6a8ea5 commit 209937a
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 79 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@ man/
npm-debug.log
inst/doc
tests/testthat/Rplots.pdf
jamovi/js/bmtest.events.js.bak
146 changes: 73 additions & 73 deletions R/bmtest.h.R
Original file line number Diff line number Diff line change
Expand Up @@ -150,117 +150,117 @@ bmtestResults <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Class(
"n_perm"),
columns=list(
list(
`name`="var",
`title`="",
`content`="($key)",
`type`="text",
`name`="var",
`title`="",
`content`="($key)",
`type`="text",
`combineBelow`=TRUE),
list(
`name`="test[asym]",
`title`="",
`type`="text",
`content`="t-Approximation",
`name`="test[asym]",
`title`="",
`type`="text",
`content`="t-Approximation",
`visible`="(asym)"),
list(
`name`="stat[asym]",
`title`="Statistic",
`type`="number",
`name`="stat[asym]",
`title`="Statistic",
`type`="number",
`visible`="(asym)"),
list(
`name`="df[asym]",
`title`="df",
`type`="number",
`name`="df[asym]",
`title`="df",
`type`="number",
`visible`="(asym)"),
list(
`name`="p[asym]",
`title`="p",
`type`="number",
`format`="zto,pvalue",
`name`="p[asym]",
`title`="p",
`type`="number",
`format`="zto,pvalue",
`visible`="(asym)"),
list(
`name`="relEff[asym]",
`title`="Relative Effect",
`type`="number",
`name`="relEff[asym]",
`title`="Relative Effect",
`type`="number",
`visible`="(relEff && asym)"),
list(
`name`="cil[asym]",
`title`="Lower",
`type`="number",
`name`="cil[asym]",
`title`="Lower",
`type`="number",
`visible`="(relEff && ci && asym)"),
list(
`name`="ciu[asym]",
`title`="Upper",
`type`="number",
`name`="ciu[asym]",
`title`="Upper",
`type`="number",
`visible`="(relEff && ci && asym)"),
list(
`name`="var",
`title`="",
`content`="($key)",
`type`="text",
`name`="var",
`title`="",
`content`="($key)",
`type`="text",
`combineBelow`=TRUE),
list(
`name`="test[randomPerm]",
`title`="",
`type`="text",
`content`="Random Permutations",
`name`="test[randomPerm]",
`title`="",
`type`="text",
`content`="Random Permutations",
`visible`="(randomPerm)"),
list(
`name`="stat[randomPerm]",
`title`="Statistic",
`type`="number",
`name`="stat[randomPerm]",
`title`="Statistic",
`type`="number",
`visible`="(randomPerm)"),
list(
`name`="df[randomPerm]",
`title`="df",
`type`="number",
`name`="df[randomPerm]",
`title`="df",
`type`="number",
`visible`="(randomPerm)"),
list(
`name`="p[randomPerm]",
`title`="p",
`type`="number",
`format`="zto,pvalue",
`name`="p[randomPerm]",
`title`="p",
`type`="number",
`format`="zto,pvalue",
`visible`="(randomPerm)"),
list(
`name`="relEff[randomPerm]",
`title`="Relative Effect",
`type`="number",
`name`="relEff[randomPerm]",
`title`="Relative Effect",
`type`="number",
`visible`="(relEff && randomPerm)"),
list(
`name`="cil[randomPerm]",
`title`="Lower",
`type`="number",
`name`="cil[randomPerm]",
`title`="Lower",
`type`="number",
`visible`="(relEff && ci && randomPerm)"),
list(
`name`="ciu[randomPerm]",
`title`="Upper",
`type`="number",
`name`="ciu[randomPerm]",
`title`="Upper",
`type`="number",
`visible`="(relEff && ci && randomPerm)"),
list(
`name`="test[fullPerm]",
`title`="",
`type`="text",
`content`="All Permutations",
`name`="test[fullPerm]",
`title`="",
`type`="text",
`content`="All Permutations",
`visible`="(fullPerm)"),
list(
`name`="stat[fullPerm]",
`title`="Statistic",
`type`="number",
`name`="stat[fullPerm]",
`title`="Statistic",
`type`="number",
`visible`="(fullPerm)"),
list(
`name`="df[fullPerm]",
`title`="df",
`type`="number",
`name`="df[fullPerm]",
`title`="df",
`type`="number",
`visible`="(fullPerm)"),
list(
`name`="p[fullPerm]",
`title`="p",
`type`="number",
`format`="zto,pvalue",
`name`="p[fullPerm]",
`title`="p",
`type`="number",
`format`="zto,pvalue",
`visible`="(fullPerm)"),
list(
`name`="relEff[fullPerm]",
`title`="Relative Effect",
`type`="number",
`name`="relEff[fullPerm]",
`title`="Relative Effect",
`type`="number",
`visible`="(relEff && fullPerm)"))))}))

bmtestBase <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Class(
Expand All @@ -285,9 +285,9 @@ bmtestBase <- if (requireNamespace("jmvcore", quietly=TRUE)) R6::R6Class(

#' Independent Samples Brunner Munzel Test
#'
#' The Brunner–Munzel test for stochastic equality of two samples, which is
#' The Brunner–Munzel test for stochastic equality of two samples, which is
#' also known as the Generalized Wilcoxon test.
#'
#'
#'
#' @examples
#' library(jmv) # to get ToothGrowth data set
Expand Down
4 changes: 2 additions & 2 deletions jamovi/bmtest.u.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ children:
label: Group 1 > Group 2
- type: RadioButton
name: hypothesis_twoGreater
optionName: hypothesis
optionName: hypothesis
optionPart: twoGreater
label: Group 1 < Group 2
- type: Label
Expand Down Expand Up @@ -104,7 +104,7 @@ children:
- type: CheckBox
name: ci
label: Confidence interval
enable: (relEff)
enable: (relEff && (asym || randomPerm))
style: inline
verticalAlignment: center
children:
Expand Down
2 changes: 0 additions & 2 deletions jamovi/js/bmtest.events.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ const updateUI = function(ui, context) {
let randomPermNames = ui.randomPerm.value();

if ( ! asymNames && ! randomPermNames ) {
ui.relEff.setValue(false)
//ui.relEff.setPropertyValue('enable', false);
ui.ci.setValue(false)
}
else {
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test-bmtest.R
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,6 @@ testthat::test_that('Formula Interface', {
`df[fullPerm]` = NA,
`p[fullPerm]` = 1.000000000,
`relEff[fullPerm]` = 0.500,
`cil[fullPerm]` = NA,
`ciu[fullPerm]` = NA,
check.names = FALSE
)
testthat::expect_equal(res_table, expected_table, tolerance = 0.0001, ignore_attr = TRUE)
Expand Down

0 comments on commit 209937a

Please sign in to comment.