-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
find_formula: remove double "+" symbols with lmBF #566
Conversation
Shouldn't |
@bwiernik I don't know, I never use this kind of models, I just stumbled upon this while looking at easystats/bayestestR#505 because it seemed to be an issue I could try to solve. I just assumed that the output of |
@strengejacke based on the which_random argument, shouldn't the product term be in random too? |
I don't use the BayesFactor package, I think this is something @mattansb implemented? |
@bwiernik yeah, something is off there. I also think I implanted this support for BayesFactor. Thanks @etiennebacher ! |
This seems like a problem with
library(BayesFactor)
mtcars$cyl <- factor(mtcars$cyl)
mtcars$gear <- factor(mtcars$gear)
model1 <- lmBF(mpg ~ cyl + gear + cyl:gear, mtcars,
progress = FALSE, whichRandom = c("gear", "cyl:gear"))
model2 <- lmBF(mpg ~ cyl + gear + cyl:gear, mtcars,
progress = FALSE, whichRandom = c("gear"))
model2 / model1
#> Bayes factor analysis
#> --------------
#> [1] cyl + gear + cyl:gear : 1 ±0%
#>
#> Against denominator:
#> mpg ~ cyl + gear + cyl:gear
#> ---
#> Bayes factor type: BFlinearModel, JZS Created on 2022-05-19 by the reprex package (v2.0.1) |
Okay it looks like the output is correct given the way that BF is implemented |
What's the state of this PR? |
Codecov Report
@@ Coverage Diff @@
## main #566 +/- ##
=======================================
Coverage 55.10% 55.10%
=======================================
Files 124 124
Lines 14341 14343 +2
=======================================
+ Hits 7902 7904 +2
Misses 6439 6439
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
I noticed that using
find_formula
withlmBF()
keeps two consecutive+
in the conditional part of the formula. I suppose this is a bug so this PR removes the duplicate+
(but I never had an issue with sth like that, it just looked like a bug).Before:
Created on 2022-05-17 by the reprex package (v2.0.1)
After:
Created on 2022-05-17 by the reprex package (v2.0.1)