Skip to content

Commit

Permalink
default to adjust = TRUE in delta
Browse files Browse the repository at this point in the history
  • Loading branch information
mattansb committed Jan 19, 2024
1 parent 20426e5 commit c3be95d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion R/cohens_d.R
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ hedges_g <- function(x, y = NULL, data = NULL,
#' @rdname cohens_d
#' @export
glass_delta <- function(x, y = NULL, data = NULL,
mu = 0, adjust = FALSE,
mu = 0, adjust = TRUE,
ci = 0.95, alternative = "two.sided",
verbose = TRUE, ...) {
.effect_size_difference(
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-cohens_d.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ test_that("glass_delta", {
expect_error(glass_delta(1:10), "two")
expect_error(glass_delta("wt", data = mtcars), "two")

x <- glass_delta(wt ~ am, data = mtcars)
x <- glass_delta(wt ~ am, data = mtcars, adjust = FALSE)
expect_equal(colnames(x)[1], "Glass_delta")
expect_equal(x[[1]], 2.200, tolerance = 0.001)
expect_equal(x$CI_low, 1.008664, tolerance = 0.001)
expect_equal(x$CI_high, 3.352597, tolerance = 0.001)

x2 <- glass_delta(wt ~ am, data = mtcars, adjust = TRUE)
x2 <- glass_delta(wt ~ am, data = mtcars)
expect_equal(colnames(x2)[1], "Glass_delta_adjusted")
expect_lt(x2[[1]], x[[1]])
expect_lt(x2$CI_low, x$CI_low)
Expand Down

0 comments on commit c3be95d

Please sign in to comment.