Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting ROPE limits #600

Open
nahorp opened this issue Apr 8, 2023 · 7 comments
Open

Setting ROPE limits #600

nahorp opened this issue Apr 8, 2023 · 7 comments

Comments

@nahorp
Copy link
Contributor

nahorp commented Apr 8, 2023

Hello!

I'm wondering if there is some function in bayestestR (or the wider easystats universe) that is able to create ROPE limits based on Kruschke's recommendation (±0.1; half of Cohen's recommendation of a small effect)? Reading the documentation, I see that there are defaults for certain model types and if the model doesn't fall into those types, then the default is an absolute -0.1 and 0.1. If no such function exists, any advice on how I could achieve this myself would be great!

For context, the model is a GLMM (student's t distribution; identity link) with 2 categorical predictors (A with 2 levels and B with 3 levels). Thank you for reading :)

@nahorp
Copy link
Contributor Author

nahorp commented Apr 16, 2023

Would appreciate any input/advice with this. Thank you!

@strengejacke
Copy link
Member

strengejacke commented Apr 17, 2023

You mean rope()? Resp. rope_range()?

@nahorp
Copy link
Contributor Author

nahorp commented Apr 17, 2023

You mean rope()? Resp. rope_range()?

Ah, rope_range().

@nahorp
Copy link
Contributor Author

nahorp commented Apr 27, 2023

Anything @strengejacke or the team? :)

@mattansb
Copy link
Member

Hi @nahorp the default behavior is to do just this, assuming the x predictors are unit-scaled. Is this not what you're getting? Please attach a reprex if not.

I generally recommend finding your own ROPE and not using defaults.

@nahorp
Copy link
Contributor Author

nahorp commented Apr 28, 2023

Hey @mattansb!

the default behavior is to do just this, assuming the x predictors are unit-scaled

What are 'unit-scaled x predictors'? And how do I do that/ensure they are that in my GLMM?

@strengejacke
Copy link
Member

I think the issue is that the ROPE is dependent on the SD of y, and despite your coefficient might be identical (see Sepal Width and SepalW10 in the table at the bottom), the ROPE and equivalence test results differ. Thus,whether +/- 0.1 SD reflects an appropriate region of practical equivalence, also depends on the unit of your predictors.

library(easystats)
data(iris)
m1 <- lm(Sepal.Length ~ Sepal.Width + Species, data = iris)
equivalence_test(m1)
#> # TOST-test for Practical Equivalence
#> 
#>   ROPE: [-0.08 0.08]
#> 
#> Parameter            |       90% CI |   SGPV | Equivalence |      p
#> -------------------------------------------------------------------
#> (Intercept)          | [1.64, 2.86] | < .001 |    Rejected | > .999
#> Sepal Width          | [0.63, 0.98] | < .001 |    Rejected | > .999
#> Species [versicolor] | [1.27, 1.64] | < .001 |    Rejected | > .999
#> Species [virginica]  | [1.78, 2.11] | < .001 |    Rejected | > .999

d <- iris
d$Sepal.Length10 <- 10 * d$Sepal.Length
d$SepalW10 <- 10 * d$Sepal.Width
m2 <- lm(Sepal.Length10 ~ SepalW10 + Species, data = d)
equivalence_test(m2)
#> # TOST-test for Practical Equivalence
#> 
#>   ROPE: [-0.83 0.83]
#> 
#> Parameter            |         90% CI |   SGPV | Equivalence |      p
#> ---------------------------------------------------------------------
#> (Intercept)          | [16.39, 28.63] | < .001 |    Rejected | > .999
#> SepalW10             | [ 0.63,  0.98] | 0.570  |    Rejected | 0.409 
#> Species [versicolor] | [12.73, 16.44] | < .001 |    Rejected | > .999
#> Species [virginica]  | [17.81, 21.12] | < .001 |    Rejected | > .999

compare_parameters(m1, m2)
#> Parameter            |                m1 |                   m2
#> ---------------------------------------------------------------
#> (Intercept)          | 2.25 (1.52, 2.98) | 22.51 (15.21, 29.82)
#> Species (versicolor) | 1.46 (1.24, 1.68) | 14.59 (12.37, 16.80)
#> Species (virginica)  | 1.95 (1.75, 2.14) | 19.47 (17.49, 21.44)
#> Sepal Width          | 0.80 (0.59, 1.01) |                     
#> SepalW10             |                   |  0.80 ( 0.59,  1.01)
#> ---------------------------------------------------------------
#> Observations         |               150 |                  150

Created on 2023-05-17 with reprex v2.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants