Skip to content

Commit

Permalink
syler
Browse files Browse the repository at this point in the history
  • Loading branch information
mattansb committed Dec 7, 2024
1 parent 1b56781 commit 804c3db
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion R/interpret_oddsratio.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ interpret_oddsratio <- function(OR, rules = "cohen1988", p0, log = FALSE, ...) {
OR <- exp(OR)
}

interpret(OR, rules, transform = function(.x) ifelse(.x < 1, 1/.x, .x))
interpret(OR, rules, transform = function(.x) ifelse(.x < 1, 1 / .x, .x))
}
7 changes: 5 additions & 2 deletions R/rank_ANOVA.R
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,12 @@ kendalls_w <- function(x, groups, blocks, data = NULL,

boot_fun <- function(.data, .i) {
split(.data$x, .data$groups) <-
lapply(split(.data$x, .data$groups),
lapply(
split(.data$x, .data$groups),
function(v) {
if (length(v) < 2L) return(v)
if (length(v) < 2L) {
return(v)
}
sample(v, size = length(v), replace = TRUE)
}
)
Expand Down
8 changes: 5 additions & 3 deletions tests/testthat/test-interpret.R
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,15 @@ test_that("interpret_rope", {

test_that("interpret_oddsratio", {
# Chen 2010, table 1 row 6
OR <- c(1.4, 2.5, 4.4, 7.5)
OR <- c(1.4, 2.5, 4.4, 7.5)
p0 <- 0.06
expect_equal(interpret_oddsratio(OR, p0 = p0), c("very small", "small", "medium", "large"), ignore_attr = TRUE)
expect_equal(interpret_oddsratio(OR), c("very small", "medium", "large", "large"), ignore_attr = TRUE)

expect_equal(interpret_oddsratio(c(0.1, 0.5, 2, 10),
rules(3, c("A", "B"))), c("B", "A", "A", "B"), ignore_attr = TRUE)
expect_equal(interpret_oddsratio(
c(0.1, 0.5, 2, 10),
rules(3, c("A", "B"))
), c("B", "A", "A", "B"), ignore_attr = TRUE)
})


Expand Down

0 comments on commit 804c3db

Please sign in to comment.