Skip to content

Commit

Permalink
Fix describe error
Browse files Browse the repository at this point in the history
describe will no pull the correct p-value for minimal effects tests from TOSTt objects (originally was pulling max rather than min)
  • Loading branch information
arcaldwell49 committed Apr 16, 2024
1 parent 67ab29f commit b7b9539
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ build/js
NUL
^CRAN-RELEASE$
^cran-comments\.md$
^CODE_OF_CONDUCT\.md$
^CRAN-SUBMISSION$
.covrignore
^papers
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: TOSTER
Version: 0.8.1
Version: 0.8.2
Title: Two One-Sided Tests (TOST) Equivalence Testing
Description: Two one-sided tests (TOST) procedure to test equivalence for t-tests, correlations, differences between proportions, and meta-analyses, including power analysis for t-tests and correlations. Allows you to specify equivalence bounds in raw scale units or in terms of effect sizes. See: Lakens (2017) <doi:10.1177/1948550617697177>.
Authors@R: c(
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ NEWS

**TOSTER R package and jamovi module**

# TOSTER v0.8.2

- Fixed error with `describe` method for minimal effects test for `TOSTt` objects.

# TOSTER v0.8.1

- Small correction to the displayed equation for Cohen's ds standard error. Thank you to Matthew B Jané for finding this error.
Expand Down
15 changes: 9 additions & 6 deletions R/htest.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,17 @@ as_htest = function(TOST) {
stop("Class cannot be converted to htest with this function.")
}


alt_text = ifelse(grepl("equ", TOST$hypothesis,
ignore.case = TRUE),
"equivalence",
"minimal.effect")
# get row

TOSTp = TOST$TOST[2:3, ]
TOSTp = TOSTp[which.max(TOSTp$p.value), ]
TOSTp = switch(alt_text,
"equivalence" = TOSTp[which.max(TOSTp$p.value), ],
"minimal.effect" = TOSTp[which.min(TOSTp$p.value), ]
)

# assign
statistic <- switch(class(TOST),
Expand Down Expand Up @@ -91,10 +97,7 @@ as_htest = function(TOST) {
alt_bound <-
ifelse(grepl("Lower", which_row), "lower", "upper")

alt_text = ifelse(grepl("equ", TOST$hypothesis,
ignore.case = TRUE),
"equivalence",
"minimal.effect")



conf.int <- c(TOST$effsize$lower.ci[1],
Expand Down
2 changes: 1 addition & 1 deletion vignettes/robustTOST.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ ses_calc(formula = extra ~ group,
boot_ses_calc(formula = extra ~ group,
data = sleep,
paired = TRUE,
R = 1990,
R = 199,
boot_ci = "perc", # recommend percentile bootstrap for paired SES
ses = "r")
```
Expand Down

0 comments on commit b7b9539

Please sign in to comment.