-
-
Notifications
You must be signed in to change notification settings - Fork 39
Mislabelled output for BayesFactor::regressionBF()
models?
#1084
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
Comments
What about the bayestestR functions? |
You mean, what about using them instead? I don't have space to properly talk about priors so I need something that has defaults comparable to BayesFactor (which I'm useing as a gateway drug for the reader!) I don't have space to get into stuff like I should also add that @DominiqueMakowski is exerting considerable pressure to do everything with |
Haha I literally said to andy "use parameters instead of bayestestR for that" But regardless, same issue:
|
We probably never implemented full support for RegressionBF in insight:
|
Yes, I think so, too |
This is definitely wrong. I'll take a look. (However, @profandyfield might I suggest not teaching the |
I think the only context - other rthan those you list - that I use it is comparing linear models (as in the example above). For this case what would you suggest instead? (Bearing in mind the aim is as a gateway to more sophisticated approaches should the user be convinced to find out more about Bayesian methods.) |
The |
Sidetracking the original issue, but I also only use {BayesFactor} exclusively for t-tests & correlations, and find I would also just not use BFs for anything else than simple tests, and simply signpost that doing Bayesian regressions requires a bit more thought / different approach and is outside the scope of the module... |
I just saw that the BF function does a combined all variables and indeed tests models. In this case, you could fit the single models and use |
(and that might be the reason why parameters or insight fail, because of the dynamic output which we haven't taken into consideration yet) |
album_tib <- discovr::album_sales
lm0 <- lm(sales ~ 1, data = album_tib)
lm1 <- lm(sales ~ adverts, data = album_tib)
lm2 <- lm(sales ~ airplay, data = album_tib)
lm3 <- lm(sales ~ image, data = album_tib)
lm4 <- lm(sales ~ adverts + airplay, data = album_tib)
lm5 <- lm(sales ~ adverts + image, data = album_tib)
lm6 <- lm(sales ~ airplay + image, data = album_tib)
lm7 <- lm(sales ~ adverts + airplay + image, data = album_tib)
bayestestR::bf_models(lm0, lm1, lm2, lm3, lm4, lm5, lm6, lm7, denominator = 1)
#> Bayes Factors for Model Comparison
#>
#> Model BF
#> [lm1] adverts 3.50e+16
#> [lm2] airplay 1.39e+18
#> [lm3] image 5.40e+03
#> [lm4] adverts + airplay 6.24e+40
#> [lm5] adverts + image 7.11e+20
#> [lm6] airplay + image 2.67e+20
#> [lm7] adverts + airplay + image 1.00e+44
#>
#> * Against Denominator: [lm0] (Intercept only)
#> * Bayes Factor Type: BIC approximation Created on 2025-04-18 with reprex v2.1.1 |
@profandyfield For a soft entry into Bayesian estimation, I would avoid Regarding your issue, I think we discussed this elsewhere, but I think in both cases the BF column is inappropriate as it implies these are parameter-specific Bayes factors (such as those given by We should be returning information by all the parameters provided by BayesFactor::posterior() other than |
Thanks for the useful comments @mattansb. Given my time constraints, I will use the BIC approximations in the first instance but have made a note-to-self to look at |
@profandyfield I used the Regression and Other Stories textbook when I taught intro regression. It uses rstanarm for all of its code examples and I think it's a great text for folks new to modeling in general or to Bayesian modeling in particular. |
That's a convenient recommendation @bwiernik 😀 |
With
regressionBF
, if I inspect a model directly I getbut with
model_parameters(album_bf)
I get:The values in column
BF
map onto the output ofalbum_bf
but the labels inParameter
do not. Am I misunderstanding the labels, or ismodel_parameters()
mis-labelling? [For the record I'm usingmodel_parameters()
to get nice output and because I want students to learn a consistent workflow with all models.]The text was updated successfully, but these errors were encountered: