Howdy, Stranger!

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

Supported by

Can I use lmBF() for logistic regression?

Hi,

I need to perform a logistic regression with two categorical predictor variables (two levels each). I am trying to figure out whether I can use the lmBF() function from the BayesFactor package to do this. I could not find any information on this in the documentation. Bringing up ?regressionBF in R gives me this information:

The vector of observations y is assumed to be distributed as: y ~ Normal(α 1 + Xβ, σ^2 I).

This suggests to me that binomial ys are not appropriate.

I did go ahead and tried it anyways. And lmBF will happily fit the models and give me results. I just don't know whether they actually mean anything. Specifically, I compared the output of

glmer(y ~ f1 + f2 + f1:f2+ (1|subj) + (1|item), data=data, family = binomial)

with the output of

lmBF(y ~ f1 + f2 + f1:f2, whichRandom = c("subj", "item"), data=data)

and they corresponded quite closely.


I constructed a simpler example (without the random effects etc.) to test whether the outcomes converge. And they seem to:

set.seed(3)
data <- data.frame(y = rbinom(100, 1, .5), 
                   f1 = as.factor(sample(rep(LETTERS[1:2], 50))), 
                   f2 = as.factor(sample(rep(letters[1:2], 50))))


# Traditional log. regression:
m.trad <- glm(y ~ .,family=binomial(link='logit'),data=data)

# Using lmBF:
m.bf <- lmBF(y ~ ., data=data)
chains <- posterior(m.bf, iterations = 10000)
coeff.est <- colMeans(chains)

# Comparing param. estimates for observation in f1 = B and f2 = b
# Trad. glm:
invlogit <- function(X) { 1 / (1+exp(-X)) }
invlogit(sum(coef(m.trad)))

# lmBF:
coeff.est['mu'] + coeff.est['f1-B'] + coeff.est['f2-b']

Can someone put my mind at ease and confirm that I am doing this right and that lmBF does return meaningful parameter estimates (etc.) for binomially distributed ys?

Thanks a lot!

  • Florian

Comments

  • EJ Wagenmakers was visiting my faculty today so I had a chance to ask him in person. Logistic regression is not yet possible but they'll start working on it soon.

    That means, what I outlined above should not be used.

  • https://sincrenete.blogspot.am/2017/07/logistic-regression-explained-and.html I also put here an example of Logistic regression done by R. In a case of any question I am ready. Thanks ))

  • @EJ is there a time-line for including Bayesian logistic regression to JASP or R BayesFactor?

  • Not a strict timeline but it is the logical next step

  • Yeah, but is it the logistical next step?
    (my wife advised against this joke, but I am my own man!)

  • Hello! Is there a way either in JASP or using the BayesFactor package to do a binomial regression model without Random factors like this: Camping~Age+Gender+Explain_num+Order where 'Camping' is binomial?

  • Dear dontchaknowjo,

    I can't speak about the BayesFactor package, however, JASP currently does not support logistic regression in the Bayesian framework. Nevertheless, you can still fit a frequentist logistic regression in the Regression module.

    Cheers,

    Frantisek

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games