Generalized Linear Mixed Model (GLMM)
A generalized linear mixed model (GLMM) extends a generalized linear model with normally distributed cluster random effects, so binary or count outcomes from clustered data are modelled with cluster-specific effects on the link scale.
일반화 선형 혼합모형(GLMM)은 일반화 선형모형에 정규분포를 따르는 군집 무선효과를 더해, 군집 자료의 이분형·빈도 결과를 연결함수 척도의 군집별 효과로 모형화하는 방법입니다.
How do I model a binary outcome measured on patients nested in hospitals while accounting for the hospital clustering?
병원에 속한 환자들의 이분형 결과를 병원 군집을 고려해 분석하려면 어떻게 하나요?
A generalized linear mixed model fits a logistic, Poisson or negative binomial regression in which each cluster has its own random intercept (and optionally a random slope) drawn from a normal distribution, and the random effects are integrated out of the likelihood. The fixed effects are cluster-specific odds ratios or rate ratios, and the random-effect variance and latent-scale ICC describe how much clusters differ.
When to use Generalized Linear Mixed Model (GLMM)
- The outcome is binary (0/1) or a count and observations are grouped in clusters
- You want cluster-specific (conditional) odds ratios or incidence rate ratios
- You need the between-cluster variance or an ICC on the latent scale
When to use something else
- You want population-averaged effects and do not need the cluster variance: use Generalized Estimating Equations (GEE)
- The outcome is continuous and roughly normal: use Hierarchical Linear Modeling (HLM)
Assumptions and requirements
- Random effects are normally distributed and independent of the features
- Observations are independent given the cluster effects, with the stated family and link
- Enough clusters (about 10 or more) to estimate the random-effect variance
What the analysis reports
- Fixed effects with SE, Wald z, p and odds/rate ratios with confidence intervals
- Random-intercept (and slope) variance, SD and correlation; latent-scale ICC
- Log-likelihood, AIC, BIC and a likelihood-ratio test against the GLM without random effects
- Overdispersion ratio for Poisson models and a normality check of predicted cluster effects
- Nakagawa marginal and conditional R² with distribution-specific variance
How to report it
A logistic GLMM with a random intercept for [k] clusters (N = [n]; Laplace approximation) estimated a random-intercept variance of [value] (latent ICC = [value]); for [predictor], OR = [value], 95% CI [[value], [value]], p = [value].
Common variants
자주 쓰는 설정
The same analysis with settings already chosen. Each runs Generalized Linear Mixed Model (GLMM) itself, at the same price.
- Events/trials binomial GLMM — trials set to “”
- Beta GLMM — family set to “beta”
- Gamma GLMM — family set to “gamma”
- Inverse Gaussian GLMM — family set to “invgauss”
- Lognormal GLMM — family set to “lognormal”
- Exponential GLMM — family set to “exponential”
- Geometric GLMM — family set to “geometric”
- Probit GLMM — link set to “probit”
- Complementary log-log GLMM — link set to “cloglog”
- Log-log GLMM — link set to “loglog”
- Three-level nested GLMM — nested in set to “”
- GLMM Type III tests of fixed effects — type3 set to “on”
- GLMM with spline fixed effects — spline set to “”
- Multilevel NB1 count model — family set to “negbin1”
- GLMM random slope with adaptive quadrature — nagq set to “7”; slope aghq set to “on”
- GLMM random-effect predictions (empirical Bayes) — predict re set to “on”
- Gamma random-effects Poisson — family set to “poisson”; re dist set to “gamma”
- Crossed random-effects GLMM — crossed with set to “None”
Related methods
- Generalized Estimating Equations (GEE)
- Hierarchical Linear Modeling (HLM)
- Logistic Regression
How this method is validated
이 방법의 검증 근거
- R reference test. 1 reference test against R (performance::r2_nakagawa) passes at a stated tolerance of 2e-3.
R 참조 시험. R(performance::r2_nakagawa) 대조 참조 시험 1건 통과(허용오차 2e-3).
- Independent computation. 3 reference tests compare the results with direct computations (formulas, enumeration or simulation).
독립 계산. 직접 계산(식·열거·모의실험) 대조 참조 시험 3건 통과.
Tolerances are relative differences (absolute differences for values near zero). R comparisons and reference tests are re-run before each release of the analysis engine.
허용오차는 상대 차이입니다(0 근처 값은 절대 차이). R 대조와 참조 시험은 분석 엔진을 배포할 때마다 다시 돌립니다.
Run Generalized Linear Mixed Model (GLMM) on Quorant
- Data you need
- a table (CSV or Excel) with an outcome variable, predictor (feature) columns and a cluster ID
- Price
- 600 credits for one analysis up to 10,000 rows (complexity level 4); larger or wider data costs more. Optional methodologist review: 2400 credits.
- Checking
- Results cross-checked against R
- Before you pay
- A free pre-analysis diagnosis checks your data and gives an exact quote; nothing is deducted until you approve it.