easystats / easystats/parameters

Mislabelled output for `BayesFactor::regressionBF()` models?

Open
#1,084 18 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug :bug: Enhancement :boom: Low priority :sleeping:
Dominant language
R
Stars
499
Forks
45
Avg merge
3d 1h
Merged PRs (30d)
3

Description

With regressionBF, if I inspect a model directly I get

require(discovr)
require(BayesFactor)

album_tib <- discovr::album_sales
album_bf <- BayesFactor::regressionBF(sales ~ adverts + airplay + image, rscaleCont = "medium", data = album_tib)
album_bf


  |==================================================================================================| 100%
Bayes factor analysis
--------------
[1] adverts                   : 1.320123e+16 ±0%
[2] airplay                   : 4.723817e+17 ±0.01%
[3] image                     : 6039.289     ±0%
[4] adverts + airplay         : 5.65038e+39  ±0%
[5] adverts + image           : 2.65494e+20  ±0%
[6] airplay + image           : 1.034464e+20 ±0%
[7] adverts + airplay + image : 7.746101e+42 ±0%

Against denominator:
  Intercept only 
---
Bayes factor type: BFlinearModel, JZS

but with model_parameters(album_bf) I get:

model_parameters(album_bf)


Multiple `BFBayesFactor` models detected - posteriors are extracted from the first numerator
  model.
  See help("get_parameters", package = "insight").
# Extra Parameters 

Parameter |  Median |             95% CI |   pd |       BF
----------------------------------------------------------
mu        |  193.03 | [ 183.63,  202.51] | 100% | 1.32e+16
adverts   |    0.09 | [   0.08,    0.11] | 100% | 4.72e+17
sig2      | 4389.28 | [3629.69, 5366.11] | 100% | 6.04e+03
g         |    0.42 | [   0.08,   12.32] | 100% | 5.65e+39

# Fixed Effects 

Parameter |       BF
--------------------
adverts   | 2.65e+20
airplay   | 1.03e+20
image     | 7.75e+42

The values in column BF map onto the output of album_bf but the labels in Parameter do not. Am I misunderstanding the labels, or is model_parameters() mis-labelling? [For the record I'm using model_parameters() to get nice output and because I want students to learn a consistent workflow with all models.]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the reproducible R example with discovr, BayesFactor, and model_parameters(album_bf). Read the model_parameters() and get_parameters() entry points mentioned in the report, then compare the returned parameter labels with the original regressionBF output. Done means the BF values and parameter names are aligned for this model.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.