richarddmorey / BayesFactor

BayesFactor R package for Bayesian data analysis with common statistical models.
https://richarddmorey.github.io/BayesFactor/
131 stars 48 forks source link

questions about `contingencyTableBF` #150

Closed IndrajeetPatil closed 3 years ago

IndrajeetPatil commented 3 years ago

A couple of questions I couldn't really find answers to after going through the documentation - or at least wasn't sure about the answers I have in mind. So just wanted to double-check with you before we decide on these in our packages.

  1. Is the distribution here really Cauchy?
library(insight)
library(BayesFactor)
data(raceDolls)

# contingency tabs
bf <- contingencyTableBF(raceDolls, sampleType = "indepMulti", fixedMargin = "cols")

get_priors(bf)
#>   Parameter Distribution Location Scale
#> 1     Ratio       cauchy        0     1

If I am not mistaken, we should be providing this value, right?

bf@denominator@type
  1. In the frequentist variant of the test, depending on whether the design is paired or not, one would run McNemar test or Pearson's test. But contingencyTableBF function doesn't really make any mention of such distinction.

Does that mean this distinction doesn't matter in the context of computing BFs or that only non-paired designs are currently supported?

richarddmorey commented 3 years ago
  1. No, it isn't Cauchy. Details are here: https://link.springer.com/article/10.3758/s13428-016-0739-8. Indeed, the necesary information for the prior is in bf@denominator@type and bf@denominator@prior (in particular, the fixed margin is also important).

  2. We don't include models for paired data; all observations are assumed to be independent. The distinction is important.

IndrajeetPatil commented 3 years ago

Thanks a lot for the quick and detailed responses, Richard!

IndrajeetPatil commented 3 years ago

Are there plans to also support paired contingency tabs designs in the future releases?

richarddmorey commented 3 years ago

I have mentioned this to EJ before (in response to another question) as his post doc did the other chunk of the work for the other contingency tables. I don't believe there are active plans right now. It would be a good project for a PhD student, though. I'm going to tag @ejwagenmakers to see what he thinks.

EJWagenmakers commented 3 years ago

Yes, in general this needs more TLC