Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

How can I compute log10 of BF ratio?

If I do this calculation

a = anovaBF(phasedur ~ phasetype*cond + subj, data = BR_post, whichRandom = "subj")

it gives me these results:

[1] cond + subj                              : 0.08527758   ±0.81%
[2] phasetype + subj                         : 1.346699e+22 ±0.96%
[3] cond + phasetype + subj                  : 1.233265e+21 ±2.25%
[4] cond + phasetype + cond:phasetype + subj : 1.197829e+20 ±1.75%

Since, I want to compute the log10 of the ratio between the interaction model and the main effect only model ( [4] and [3]) I need to call these values in this way:

`a@bayesFactor[["bf"]]

which gives:

`[1] -2.46322 50.94380 48.53981 46.21458

These values are the ln forms of the ones shown in the output of the anova. How can I have access to the original values without computing the exp everytime?

Thank you

Comments

  • I'll forward this to Richard

  • Thank you

  • Use extractBF with `logbf = FALSE`


    library(BayesFactor)
    
    data(attitude)
    output <- regressionBF(rating ~ complaints + privileges,
                           data = attitude, progress = FALSE)
    output
    #> Bayes factor analysis
    #> --------------
    #> [1] complaints              : 417938.6 ±0.01%
    #> [2] privileges              : 3.177784 ±0%
    #> [3] complaints + privileges : 75015.23 ±0%
    #> 
    #> Against denominator:
    #>   Intercept only 
    #> ---
    #> Bayes factor type: BFlinearModel, JZS
    
    
    extractBF(output, onlybf = TRUE, logbf = FALSE)
    #> [1] 4.179386e+05 3.177784e+00 7.501523e+04
    


Sign In or Register to comment.