# Bayes factor using "hypothesis" function: Binomial w/ and w/o logit link

Hi,
I was trying to learn Bayes factors and how to get them via ‘brms’ and so I tried to replicate this blog post:

Bayes factor brms blog

I also happen to read this paper: proportion puzzle
In which it says that using logistic transformation and normal priors on the transformed parameter, will result in smaller BF when two proportions are equal and close to 0, compared to when we assign beta(1,1) prior on the proportions themselves and don’t make any transformation. Anyway, I tried to replicate their results and what I noticed was that if I put the transformed parameter as the hypothesis argument, i.e., this line:

`hypothesis(m1_log, "pledgeyes = pledgeno") `

Then I’ll replicate what the paper says, but if I use this:

`hypothesis(m1_log, "exp(pledgeyes)/(1+exp(pledgeyes)) = exp(pledgeno)/(1+exp(pledgeno)) `

Then the resulting Bayes factors will be similar to the no transformation and beta prior. Now my questions is probably more general than Bayes factor itself: When we’re testing a null hypothesis, should it be done on the transformed parameter? Or should we test what we’re actually interested (the proportions, i.e.,

`exp(pledgeyes)/(1+exp(pledgeyes)) and exp(pledgeno)/(1+exp(pledgeno)` .

I don’t even know why the two tests differed, so overall I’m a bit confused and maybe something in what I say does not make sense.

I’ve attached my code.
Thank you so much!
Farzin
example 1_lowEqualPs.R (1.7 KB)

I did a few edits on your comment to make it easier to read using the ``` . This should be bumped up to the top again. Thanks for attaching the code.

1 Like