Skip to content

Commit 7d932a9

Browse files
Revert "ROPE_Percentage -> ROPE_percentage"
This reverts commit 0eadf53.
1 parent 0eadf53 commit 7d932a9

8 files changed

Lines changed: 21 additions & 22 deletions

File tree

NEWS.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
## Breaking changes
44

5-
- `ROPE_Percentage` now becale `ROPE_percentage`
65
- plotting functions now require the installation of the `see` package
76
- `estimate` argument name in `describe_posterior` and `point_estimate` changed to `centrality`
87
- `hdi()`, `ci()`, `rope()` and `equivalence_test()` default `ci` to `0.89`

R/equivalence_test.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
#' \item \code{Parameter} The model parameter(s), if \code{x} is a model-object. If \code{x} is a vector, this column is missing.
6060
#' \item \code{CI} The probability of the HDI.
6161
#' \item \code{ROPE_low}, \code{ROPE_high} The limits of the ROPE. These values are identical for all parameters.
62-
#' \item \code{ROPE_percentage} The proportion of the HDI that lies inside the ROPE.
62+
#' \item \code{ROPE_Percentage} The proportion of the HDI that lies inside the ROPE.
6363
#' \item \code{ROPE_Equivalence} The "test result", as character. Either "rejected", "accepted" or "undecided".
6464
#' \item \code{HDI_low} , \code{HDI_high} The lower and upper HDI limits for the parameters.
6565
#' }
@@ -124,13 +124,13 @@ equivalence_test.numeric <- function(x, range = "default", ci = .89, verbose = T
124124
out <- as.data.frame(rope_data)
125125

126126
if (all(ci < 1)) {
127-
out$ROPE_Equivalence <- ifelse(out$ROPE_percentage == 0, "rejected",
128-
ifelse(out$ROPE_percentage == 100, "accepted", "undecided")
127+
out$ROPE_Equivalence <- ifelse(out$ROPE_Percentage == 0, "rejected",
128+
ifelse(out$ROPE_Percentage == 100, "accepted", "undecided")
129129
)
130130
} else {
131131
# Related to guidelines for full rope (https://easystats.github.io/bayestestR/articles/4_Guidelines.html)
132-
out$ROPE_Equivalence <- ifelse(out$ROPE_percentage < 2.5, "rejected",
133-
ifelse(out$ROPE_percentage > 97.5, "accepted", "undecided")
132+
out$ROPE_Equivalence <- ifelse(out$ROPE_Percentage < 2.5, "rejected",
133+
ifelse(out$ROPE_Percentage > 97.5, "accepted", "undecided")
134134
)
135135
}
136136

R/p_rope.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ p_rope.numeric <- function(x, range = "default", precision = .1, ...) {
6363
rope_df <- rope(x, range, ci = seq(0, 1, by = precision / 100), verbose = FALSE)
6464
rope_df <- stats::na.omit(rope_df)
6565

66-
rope_values <- rope_df$ROPE_percentage
66+
rope_values <- rope_df$ROPE_Percentage
6767

6868
if (all(rope_values == min(rope_values))) {
6969
if (rope_values[1] == 0) {

R/print.equivalence_test.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ print.equivalence_test <- function(x, digits = 2, ...) {
1111
maxlen_low <- max(nchar(x$HDI_low))
1212
maxlen_high <- max(nchar(x$HDI_high))
1313

14-
x$ROPE_percentage <- sprintf("%.*f %%", digits, x$ROPE_percentage)
14+
x$ROPE_Percentage <- sprintf("%.*f %%", digits, x$ROPE_Percentage)
1515
x$HDI <- sprintf("[%*s %*s]", maxlen_low, x$HDI_low, maxlen_high, x$HDI_high)
1616

1717
ci <- unique(x$CI)
18-
keep.columns <- c("CI", "Parameter", "ROPE_Equivalence", "ROPE_percentage", "HDI")
18+
keep.columns <- c("CI", "Parameter", "ROPE_Equivalence", "ROPE_Percentage", "HDI")
1919

2020
x <- x[, intersect(keep.columns, colnames(x))]
2121

2222
colnames(x)[which(colnames(x) == "ROPE_Equivalence")] <- "H0"
23-
colnames(x)[which(colnames(x) == "ROPE_percentage")] <- "inside ROPE"
23+
colnames(x)[which(colnames(x) == "ROPE_Percentage")] <- "inside ROPE"
2424

2525
# clean parameter names
2626
if ("Parameter" %in% colnames(x)) {

R/print.rope.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ print.rope <- function(x, digits = 2, ...) {
1515
# why we did this, so I'll comment a bit...
1616

1717
# These are the base columns we want to print
18-
cols <- c("Parameter", "ROPE_percentage", "Component", "Group")
18+
cols <- c("Parameter", "ROPE_Percentage", "Component", "Group")
1919

2020
# In case we have ropes for different CIs, we also want this information
2121
# So we first check if values in the CI column differ, and if so, we also
@@ -34,8 +34,8 @@ print.rope <- function(x, digits = 2, ...) {
3434
x <- subset(x, select = intersect(cols, colnames(x)))
3535

3636
# This is just cosmetics, to have nicer column names and values
37-
x$ROPE_percentage <- sprintf("%.*f %%", digits, x$ROPE_percentage)
38-
colnames(x)[which(colnames(x) == "ROPE_percentage")] <- "inside ROPE"
37+
x$ROPE_Percentage <- sprintf("%.*f %%", digits, x$ROPE_Percentage)
38+
colnames(x)[which(colnames(x) == "ROPE_Percentage")] <- "inside ROPE"
3939

4040
# In case we have multiple CI values, we create a subset for each CI value.
4141
# Else, parameter-rows would be mixed up with both CIs, which is a bit

R/rope.R

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ rope <- function(x, ...) {
9999
#' @method as.double rope
100100
#' @export
101101
as.double.rope <- function(x, ...) {
102-
x$ROPE_percentage
102+
x$ROPE_Percentage
103103
}
104104

105105

@@ -131,7 +131,7 @@ rope.numeric <- function(x, range = "default", ci = .89, verbose = TRUE, ...) {
131131

132132
out <- do.call(rbind, rope_values)
133133
if (nrow(out) > 1) {
134-
out$ROPE_percentage <- as.numeric(out$ROPE_percentage)
134+
out$ROPE_Percentage <- as.numeric(out$ROPE_Percentage)
135135
}
136136

137137
# Attributes
@@ -183,19 +183,19 @@ rope.BFBayesFactor <- function(x, range = "default", ci = .89, verbose = TRUE, .
183183
HDI_area <- .hdi_area <- hdi(x, ci, verbose)
184184

185185
if (anyNA(HDI_area)) {
186-
ROPE_percentage <- NA
186+
rope_percentage <- NA
187187
} else {
188188
HDI_area <- x[x >= HDI_area$CI_low & x <= HDI_area$CI_high]
189189
area_within <- HDI_area[HDI_area >= min(range) & HDI_area <= max(range)]
190-
ROPE_percentage <- length(area_within) / length(HDI_area) * 100
190+
rope_percentage <- length(area_within) / length(HDI_area) * 100
191191
}
192192

193193

194194
rope <- data.frame(
195195
"CI" = ci * 100,
196196
"ROPE_low" = range[1],
197197
"ROPE_high" = range[2],
198-
"ROPE_percentage" = ROPE_percentage
198+
"ROPE_Percentage" = rope_percentage
199199
)
200200

201201
attr(rope, "HDI_area") <- c(.hdi_area$CI_low, .hdi_area$CI_high)
@@ -230,7 +230,7 @@ rope.stanreg <- function(x, range = "default", ci = .89, effects = c("fixed", "r
230230
tmp <- .clean_up_tmp_stanreg(
231231
tmp,
232232
group = .x,
233-
cols = c("CI", "ROPE_low", "ROPE_high", "ROPE_percentage", "Group"),
233+
cols = c("CI", "ROPE_low", "ROPE_high", "ROPE_Percentage", "Group"),
234234
parms = names(parms)
235235
)
236236

@@ -307,7 +307,7 @@ rope.brmsfit <- function(x, range = "default", ci = .89, effects = c("fixed", "r
307307
tmp,
308308
group = .x,
309309
component = .y,
310-
cols = c("CI", "ROPE_low", "ROPE_high", "ROPE_percentage", "Component", "Group"),
310+
cols = c("CI", "ROPE_low", "ROPE_high", "ROPE_Percentage", "Component", "Group"),
311311
parms = names(parms)
312312
)
313313

man/equivalence_test.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-rope.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ test_that("rope", {
1818
testthat::expect_equal(rope(rnorm(1000, mean = 0, sd = 3), ci = c(.1, .5, .9))$CI, c(10, 50, 90))
1919

2020
x <- equivalence_test(rnorm_perfect(1000, 1, 1), ci = c(.50, .99))
21-
testthat::expect_equal(x$ROPE_percentage[2], 4.94, tolerance = 0.01)
21+
testthat::expect_equal(x$ROPE_Percentage[2], 4.94, tolerance = 0.01)
2222
testthat::expect_equal(x$ROPE_Equivalence[2], "undecided")
2323

2424
testthat::expect_error(rope(rnorm_perfect(1000, 0, 1), range = c(0.0, 0.1, 0.2)))

0 commit comments

Comments
 (0)