GLMM (binary) — logistic mixed-effects (random intercept)
VerifiedAdvanced & specialized
Run this test straight away on a free built-in teaching dataset — no data of your own needed — or bring your own. Either opens the guided workspace: variable setup, assumption diagnostics, results with effect sizes and confidence intervals, figures, and APA-ready reporting.
Loading teaching datasets…
Or use your own dataset
Loading your datasets…
Fits Pr(y_ij = 1) = logit⁻¹(x_ij'β + u_j), u_j ~ N(0, σ²_u), with Bernoulli family + logit link.
Handles BINARY outcomes measured repeatedly within clusters or subjects. Returns fixed-effect coefficients with odds ratios, posterior SD, 95% credible intervals, p-values, the latent-scale ICC (σ²_u / (σ²_u + π²/3)), per-cluster predicted probabilities, and a Bernoulli-GEE comparison documenting the subject-specific vs population-averaged interpretation. Estimation via Laplace or adaptive Gauss-Hermite quadrature.
Worked example
What drives a yes/no outcome measured repeatedly within clusters?
A generalised linear mixed model (binary) adds random effects for clusters to a logistic model, giving subject-specific odds ratios.
The treatment raised the subject-specific odds of success (OR = 1.9, p = .002); between-cluster variance was notable.
A binary GLMM showed the treatment increased the odds of success, OR = 1.9, p = .002 (random cluster intercepts).
When to use it
- Repeated binary measures per subjectTrial-level data: correct response ~ trial-block + condition + (1 | subject) in 60 subjects × 200 trials each.
- Nested binary outcomes (multi-level studies)Graduated yes/no ~ ses + gender + (1 | school) (n = 5000 students × 100 schools).
When NOT to — use instead
- Independent binary observationsUse standard logistic regression — no clustering structure needed. → Binomial Logistic Regression \u2014 odds ratios + ROC AUC + classification
- Continuous outcome (clustered)Use linear mixed-effects model. → Linear Mixed Effects (LMM) \u2014 clustered / repeated data (ICC, BLUPs)
- Count outcome (clustered)Use Poisson GLMM. → GLMM (Poisson) \u2014 count mixed-effects (random intercept)
- Population-average inference (not subject-specific)Use binomial GEE for marginal / population-average effects. → GEE \u2014 population-averaged regression with robust SE
Hypotheses
Parameter tested: fixed-effect log-odds coefficients β + random-effect variance σ²_u
Assumptions (and what to do if they fail)
Check: σ²_u posterior mean and latent ICC.
If violated: ICC_latent ≈ 0 → no meaningful between-cluster variance in the log-odds.
Check: Compute the attenuation factor and attenuated β.
If violated: Large gap between re-scaled GLMM and GEE suggests the random-effects distribution may be misspecified or σ²_u is poorly estimated.
Check: All posterior SDs finite; SD/|mean| < 2 for all predictors.
If violated: Unstable posteriors often indicate separation or sparse clusters.
Ready to run a GLMM (binary) — logistic mixed-effects (random intercept) on your own data?
Guided setup, automatic assumption checks, effect sizes, figures and an APA write-up.
Run this test →