jasp-stats / jasp-issues

This repository is solely meant for reporting of bugs, feature requests and other issues in JASP.
58 stars 29 forks source link

[Bug]: Bayesian GLMM with binomial aggregate won't accept count or proportion as dependent variable #1614

Closed Itswhatson closed 2 years ago

Itswhatson commented 2 years ago

JASP Version

0.16

Commit ID

No response

JASP Module

jaspMixedModels

What analysis are you seeing the problem on?

Bayesian Generalized Linear Mixed Models

What OS are you seeing the problem on?

macOS Monterey 12.1

Bug Description

I'm trying to analyze error data. First I formatted them as counts. That generates the error message "Generalized linear mixed model with binomial family and logit link function requires that the dependent variable is higher than 0 and lower than 1," which suggests that the DV should be formatted as proportions. I then formatted them as proportions, which generated the error message "Generalized linear mixed model with binomial family and logit link function requires that the dependent variable is proportion of successes out of the number of trials," which is a bit ambiguous. For messages see attached screenshot. Jasp file also attached.

Screen Shot 2022-02-12 at 9 28 46 AM

GLMM_binom_aggregate.zip

Expected Behaviour

Seems like one or the other should work. Maybe I'm missing something. In the data, all proportions are 0 <= proportion <=1 and all counts are >= 0.

Steps to Reproduce

  1. Select Mixed Models/Bayesian/Generalized Linear Mixed Models
  2. Select Family/Binomial (Aggregated)
  3. Subject -> Random effects grouping factors
  4. Condition -> Fixed effects variables
  5. ErrorType -> Fixed effects variables
  6. PropnErrors OR NumErrors -> Dependent variable (eithers generates an error message)
  7. NumTrials -> Number of trials

Log (if any)

No response

Final Checklist

FBartos commented 2 years ago

Hi @Itswhatson,

sorry for the late reply (I missed the original notification).

You are corrent in the initial assessment: the dependend variable needs to be specified as a proportion. The reason it did not work with your second try is that there a input check to verify that the proportion indeed corresponds to a possible number of trials (by back multiplying the proportion with the number of trials). There must have been some small rounding inconsistencies in the way you computed the proportion -- I recomputed the variable within JASP and it worked for me (unzip the attached file). Nontheless, I will need to decrease sensitivity of the input checks to not incorrectly flag a bad input just due to a rounding differences.

Best, Frantisek

FBartos commented 2 years ago

I had to upload the analysis using the frequentist GLMM since the Bayesian output is too large to send via GitHub (all the posterior samples) GLMM_binom_aggregate_new.zip