richarddmorey / BayesFactor

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

Why is anovaBF storing bf in logarithmic form? #140

Closed acquafredda closed 4 years ago

acquafredda commented 4 years ago

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%

I can do the ratio calling a[4]/a[3] but then I can't compute the log10 of this ratio. Looking ad the object a itself, I noticed that a@bayesFactor[["bf"]] contains these values: `[1] -2.46322 50.94380 48.53981 46.21458 which are the natural logarithm 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

richarddmorey commented 4 years ago

Yes, use as.vector(a), as.data.frame(a), or extractBF(a).

Note that you can do this with any BF object, so:

z = a[4]/a[3]
extractBF(z)

or

as.vector(a[4]/a[3])

will work.

acquafredda commented 4 years ago

Thank you very much, sorry for my many questions.

Best, Miriam Acquafredda

Scarica Outlook per iOShttps://aka.ms/o0ukef


Da: Richard Morey notifications@github.com Inviato: Friday, March 20, 2020 5:11:05 PM A: richarddmorey/BayesFactor BayesFactor@noreply.github.com Cc: acquafredda miry26@hotmail.it; Author author@noreply.github.com Oggetto: Re: [richarddmorey/BayesFactor] Why is anovaBF storing bf in logarithmic form? (#140)

Yes, use as.vector(a), as.data.frame(a), or extractBF(a).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/richarddmorey/BayesFactor/issues/140#issuecomment-601781749, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AO24MDDHGZMEM6JRJMT77BTRIOIRTANCNFSM4LQJCLGA.