Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
mattansb authored Oct 24, 2023
2 parents 397c4cc + bf6cb28 commit 6a12bde
Show file tree
Hide file tree
Showing 20 changed files with 172 additions and 734 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/html-5-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ on:
pull_request:
branches: [main, master]

name: HTML5 check
name: html-5-check

jobs:
HTML5-check:
html-5-check:
uses: easystats/workflows/.github/workflows/html-5-check.yaml@main
10 changes: 10 additions & 0 deletions .github/workflows/update-to-latest-easystats.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
on:
schedule:
# Check for dependency updates once a month
- cron: "0 0 1 * *"

name: update-to-latest-easystats

jobs:
update-to-latest-easystats:
uses: easystats/workflows/.github/workflows/update-to-latest-easystats.yaml@main
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: effectsize
Title: Indices of Effect Size
Version: 0.8.6
Version: 0.8.6.1
Authors@R:
c(person(given = "Mattan S.",
family = "Ben-Shachar",
Expand Down Expand Up @@ -65,7 +65,7 @@ Description: Provide utilities to work with indices of effect size for a wide
the function 'insight::supported_models()'), allowing computation of and
conversion between indices such as Cohen's d, r, odds, etc.
References: Ben-Shachar et al. (2020) <doi:10.21105/joss.02815>.
License: GPL-3
License: MIT + file LICENSE
URL: https://easystats.github.io/effectsize/
BugReports: https://github.com/easystats/effectsize/issues/
Depends:
Expand Down
695 changes: 21 additions & 674 deletions LICENSE

Large diffs are not rendered by default.

7 changes: 1 addition & 6 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ export(interpret_direction)
export(interpret_epsilon_squared)
export(interpret_ess)
export(interpret_eta_squared)
export(interpret_fei)
export(interpret_g)
export(interpret_gfi)
export(interpret_glass_delta)
Expand Down Expand Up @@ -247,14 +248,8 @@ importFrom(bayestestR,equivalence_test)
importFrom(datawizard,standardise)
importFrom(datawizard,standardize)
importFrom(insight,display)
importFrom(insight,find_predictors)
importFrom(insight,print_html)
importFrom(insight,print_md)
importFrom(parameters,model_parameters)
importFrom(parameters,standardize_info)
importFrom(parameters,standardize_parameters)
importFrom(parameters,standardize_posteriors)
importFrom(stats,anova)
importFrom(stats,aov)
importFrom(stats,na.omit)
importFrom(utils,packageVersion)
10 changes: 10 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# effectsize 0.8.7.xxx

- This release changes the licensing model of `{effectsize}` to an MIT license.

# effectsize 0.8.7

## New features

- New function: `interpret_fei()`

# effectsize 0.8.6

This is a minor update to bring `effectsize` in-line with the formula methods
Expand Down
2 changes: 1 addition & 1 deletion R/cohens_d.R
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ glass_delta <- function(x, y = NULL, data = NULL,
}

out <- data.frame(d = (d - mu) / s)
types <- c("d" = "Cohens_d", "g" = "Hedges_g", "delta" = "Glass_delta")
types <- c(d = "Cohens_d", g = "Hedges_g", delta = "Glass_delta")
colnames(out) <- types[type]

if (.test_ci(ci)) {
Expand Down
3 changes: 2 additions & 1 deletion R/convert_stat_chisq.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
#'
#' \deqn{\textrm{Pearson's } C = \sqrt{\chi^2 / (\chi^2 + n)}}{Pearson's C = sqrt(\chi^2 / (\chi^2 + n))}
#'
#' For versions adjusted for small-sample bias of \eqn{\phi}, \eqn{V}, and \eqn{T}, see [Bergsma, 2013](https://en.wikipedia.org/wiki/Cram%C3%A9r%27s_V#Bias_correction).
#' For versions adjusted for small-sample bias of \eqn{\phi}, \eqn{V}, and \eqn{T},
#' see [Bergsma, 2013](https://en.wikipedia.org/wiki/Cram%C3%A9r%27s_V#Bias_correction).
#'
#' @inheritSection effectsize_CIs Confidence (Compatibility) Intervals (CIs)
#' @inheritSection effectsize_CIs CIs and Significance Tests
Expand Down
5 changes: 3 additions & 2 deletions R/effectsize-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
#' and hypothesis tests, such as [cohens_d()], [phi()], [eta_squared()], and
#' many more.
#'
#' See [`vignette("effectsize", package = "effectsize")`](https://easystats.github.io/effectsize/articles/effectsize.html) for more details,
#' or [`vignette(package = "effectsize")`](https://easystats.github.io/effectsize/articles/) for a full list of vignettes.
#' See [`vignette("effectsize", package = "effectsize")`](https://easystats.github.io/effectsize/articles/effectsize.html)
#' for more details, or [`vignette(package = "effectsize")`](https://easystats.github.io/effectsize/articles/)
#' for a full list of vignettes.
#'
#' References: Ben-Shachar et al. (2020) \doi{10.21105/joss.02815}.
#'
Expand Down
5 changes: 0 additions & 5 deletions R/eta_squared-main.R
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,6 @@ cohens_f_squared <- function(model,


#' @keywords internal
#' @importFrom stats anova
.anova_es.default <- function(model, ...) {
.anova_es.anova(stats::anova(model), ...)
}
Expand Down Expand Up @@ -842,8 +841,6 @@ cohens_f_squared <- function(model,
}

#' @keywords internal
#' @importFrom parameters model_parameters
#' @importFrom stats anova
.anova_es.aov <- function(model,
type = c("eta", "omega", "epsilon"),
partial = TRUE,
Expand Down Expand Up @@ -885,8 +882,6 @@ cohens_f_squared <- function(model,
.anova_es.glm <- .anova_es.lm

#' @keywords internal
#' @importFrom parameters model_parameters
#' @importFrom insight find_predictors
.anova_es.aovlist <- function(model,
type = c("eta", "omega", "epsilon"),
partial = TRUE,
Expand Down
5 changes: 1 addition & 4 deletions R/eta_squared-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
within <- names(model$idata)
within <- lapply(within, function(x) c(NA, x))
within <- do.call(expand.grid, within)
within <- apply(within, 1, na.omit)
within <- apply(within, 1, stats::na.omit)
ns <- sapply(within, length)
within <- sapply(within, paste, collapse = ":")
within <- within[order(ns)]
Expand Down Expand Up @@ -179,7 +179,6 @@
#' @keywords internal
.anova_es.anova.lme <- .anova_es.anova

#' @importFrom stats na.omit
#' @keywords internal
.anova_es.parameters_model <- function(model,
type = c("eta", "omega", "epsilon"),
Expand Down Expand Up @@ -249,8 +248,6 @@
# Specific models ---------------------------------------------------------

#' @keywords internal
#' @importFrom stats aov
#' @importFrom utils packageVersion
.anova_es.maov <- function(model,
type = c("eta", "omega", "epsilon"),
partial = TRUE,
Expand Down
4 changes: 2 additions & 2 deletions R/interpret.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ rules <- function(values, labels = NULL, name = NULL, right = TRUE) {
}
}

# Sanity checks
# validation checks
if (length(labels) < length(values)) {
insight::format_error("There cannot be less labels than reference values!")
} else if (length(labels) > length(values) + 1) {
Expand Down Expand Up @@ -178,7 +178,7 @@ interpret.effectsize_table <- function(x, rules, ...) {
Cohens_w = ,
Tschuprows_t = ,
Tschuprows_t_adjusted = ,
fei = interpret_cramers_v(value, rules = rules),
Fei = interpret_fei(value, rules = rules),

## xtab 2x2
Cohens_h = interpret_cohens_d(value, rules = rules),
Expand Down
4 changes: 4 additions & 0 deletions R/interpret_r.R
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,7 @@ interpret_cramers_v <- interpret_r
#' @export
#' @rdname interpret_r
interpret_rank_biserial <- interpret_r

#' @export
#' @rdname interpret_r
interpret_fei <- interpret_r
2 changes: 1 addition & 1 deletion R/xtab_diff.R
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ arr <- function(x, y = NULL, ci = 0.95, alternative = "two.sided", ...) {
nnt <- function(x, y = NULL, ci = 0.95, alternative = "two.sided", ...) {
alternative <- .match.alt(alternative)

flip_alt <- c("less" = "greater", "greater" = "less", "two.sided" = "two.sided")
flip_alt <- c(less = "greater", greater = "less", two.sided = "two.sided")
alternative2 <- unname(flip_alt[alternative])

if (.is_htest_of_type(x, "Pearson's Chi-squared", "Chi-squared-test")) {
Expand Down
3 changes: 2 additions & 1 deletion man/convert_chisq.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions man/effectsize-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/effectsize.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/interpret_r.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 48 additions & 6 deletions tests/testthat/test-effectsize.R
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,56 @@ test_that("htest | rank", {
})

test_that("htest | Get args from htest", {
tt <- t.test(mtcars$hp, mtcars$mpg, alternative = "l", mu = -3, conf.level = 0.8, var.equal = TRUE)
expect_equal(cohens_d(tt), cohens_d(mtcars$hp, mtcars$mpg, alternative = "l", mu = -3, ci = 0.8), ignore_attr = TRUE)
tt <- t.test(
mtcars$hp,
mtcars$mpg,
alternative = "l",
mu = -3,
conf.level = 0.8,
var.equal = TRUE
)
expect_equal(
cohens_d(tt),
cohens_d(
mtcars$hp,
mtcars$mpg,
alternative = "l",
mu = -3,
ci = 0.8
),
ignore_attr = TRUE
)

suppressWarnings(ww1 <- wilcox.test(mtcars$hp, mtcars$mpg, alternative = "l", mu = -3))
expect_equal(rank_biserial(ww1), rank_biserial(mtcars$hp, mtcars$mpg, alternative = "l", mu = -3), ignore_attr = TRUE)
suppressWarnings({
ww1 <- wilcox.test(mtcars$hp, mtcars$mpg, alternative = "l", mu = -3)
})
expect_equal(
rank_biserial(ww1),
rank_biserial(mtcars$hp, mtcars$mpg, alternative = "l", mu = -3),
ignore_attr = TRUE
)

suppressWarnings(ww2 <- wilcox.test(mtcars$hp, mtcars$mpg, alternative = "l", mu = -3, conf.int = TRUE, conf.level = 0.8))
expect_equal(rank_biserial(ww2), rank_biserial(mtcars$hp, mtcars$mpg, alternative = "l", mu = -3, ci = 0.8), ignore_attr = TRUE)
suppressWarnings({
ww2 <- wilcox.test(
mtcars$hp,
mtcars$mpg,
alternative = "l",
mu = -3,
conf.int = TRUE,
conf.level = 0.8
)
})
expect_equal(
rank_biserial(ww2),
rank_biserial(
mtcars$hp,
mtcars$mpg,
alternative = "l",
mu = -3,
ci = 0.8
),
ignore_attr = TRUE
)
})


Expand Down
Loading

0 comments on commit 6a12bde

Please sign in to comment.