Howdy, Stranger!

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

Supported by

Reproducing GLMM in R

I have a JASP/R question for you. I'm trying to reproduce results I got from JASP (0.14.1) in R, but I can't seem to get the same results. I'm analyzing categorical accuracy data (Acc: 0 vs 1) where each participant is tested twice (trial factor: let's call it before and after).

In JASP I'm using the generalized linear mixed models module, with all the default settings (Binomal, logit link, type III, likelihood ratio test). Because there are so few trials, only the subject intercepts are included as random effects.

In R, I'm using the following: glmer( Acc ~ Trial + ( 1 | SUB), family = binomial(link="logit"), data=ACData).

For some reason, JASP is giving me a chi-square of 11.76, p < .001, but R is giving me a chi-square of 9.77, p = .0017. I read that JASP is assuming sum contrasts (and not dummy coding), but changing the contrasts in R to (-1,1) doesn't seem to help.

Any thoughts on what I'm doing wrong? Mind you that I am clueless about R. I can post the data of course if needed.

Comments

  • edited October 2021

    Edit: Sorry I spoke too fast, I tried with a factor predictor with more than 2 levels and I'm no longer reproducing the fixed effects, seeing as I would need to change the coding as you mention

    How did you get the chi-square in R? when I do the following (with my own dataset):

    model <- glmer( Acc ~ Trial + ( 1 | SUB), family = binomial(link="logit"), data=ACData)
    anova(model)
    

    I seem to be able to reproduce JASP's results, with the exception that R calls the test an F-test and JASP calls it a chi-square. Note that by default JASP seems to include a random slope as well for Trial, so you need to uncheck the box for Trial under Model -> Random effects

  • for the chi-square I used: car::Anova(model, type = 3, test.statistic="Chisq")

    I think that JASP is calculating the overall model differently because the fixed effects in JASP produce the same p-values as the fixed effects in R, but not the overall model. The difference becomes even more severe if I add more variables. I think the difference might be JASP's assumptions or how the errors are calculated, because if I add a second factor the difference become even more pronounced.

    Here's an example of the output.


  • okay, my current guess is that the difference comes from JASP evaluating the model using likelihood ratio tests and R uses Wald tests.

    For my purposes, this is a big problem, because I only turned to R because I wanted to use a power simulation. BUT I can't use a power simulation on glmer because it will give me the results of the Wald test, and I can't run it on glmmTMB (that can actually run maximum likelihood tests).

    Well... I think it's a dead end.

  • Update:

    I think I solved the problem.

    As far as I can see, the issue was likelihood ratio test vs. Wald test. glmer can't abide with likelihood ratio test, but other packages can, like simr: doTest(model, fixed("IV", "lr")).

    Then I did the power analysis using powerCurve:

    powerCurve(model, fixed("IV", "lr"),along = "subjects",breaks = c(70,80,90))

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