Generalized Linear Mixed Model (GLMM)

The GLMM tab fits random intercept models g(μi)=xiβ+uj[i]g(\mu_i) = x_i'\beta + u_{j[i]}, ujN(0,σu2)u_j \sim N(0, \sigma_u^2) for data with group structure. It extends GLM by adding random effects. See GLMM Fundamentals for the mathematical background.

For example, when analyzing student test scores from multiple schools, GLMM can estimate the effect of study hours (fixed effect) while accounting for school-level differences (random intercept). Ignoring group structure with GLM leads to underestimated standard errors and inflated significance.

Basic Usage

Opening GLMM

Select Analysis > GLMM (Mixed Model)... from the menu bar.

Setting Up Variables

Dataset selects the dataset to analyze.

Dependent Variable (Y) selects the response variable. Only numeric columns are available.

Fixed Effects (X) selects predictor variables for fixed effects. Only numeric columns are selectable. To use categorical variables, convert them with Dummy Coding first.

Group Variable selects the grouping variable for random intercepts. Categorical (nominal/ordinal) or string columns are available.

Distribution Family selects the distribution family. The same options as GLM:

FamilyUse Case
Gaussian (Normal)Continuous values
Binomial (Logistic)Binary data
Poisson (Count)Count data
GammaPositive continuous

Link Function selects the link function. Defaults to the canonical link for the selected family.

Include intercept toggles the intercept term (default: on).

Advanced Options

  • Max Iterations: Maximum optimization iterations (default: 100)
  • Convergence Tolerance: Convergence threshold (default: 1e-6)

Running the Analysis

Click Run GLMM. The estimation algorithm differs by family (see details). A progress dialog shows the estimation stage.

Understanding Results

Random Effects

Displays variance components for random effects.

ItemDescription
GroupGroup variable variance σu2\sigma_u^2 and standard deviation
ResidualResidual variance σe2\sigma_e^2 and standard deviation (Gaussian only)

For non-Gaussian families, residual variance is not shown because the dispersion parameter is handled differently per family (Poisson/Binomial fix ϕ=1\phi = 1; Gamma estimates ϕ\phi from profiled deviance).

ICC (Intraclass Correlation Coefficient)

ICC represents the proportion of total variance attributable to between-group differences (ICC=σu2/(σu2+σe2)\text{ICC} = \sigma_u^2 / (\sigma_u^2 + \sigma_e^2) for Gaussian). See GLMM Fundamentals for non-Gaussian computation.

ICC RangeInterpretation
0 -- 0.05Small group differences
0.05 -- 0.20Small to moderate group effect
0.20 -- 0.50Large group effect
0.50+Group differences dominate

This table is a rough guide for the Gaussian family. For non-Gaussian families, ICC is computed on a latent scale and the interpretation differs (see GLMM Fundamentals). Group size should also be considered (see When to Use GLMM vs GLM).

Fixed Effects

Coefficient table for fixed effects.

ColumnDescription
VariableVariable name
EstimateRegression coefficient β^\hat\beta
Std. ErrorStandard error (computed via (XV1X)1(X'V^{-1}X)^{-1} using the Woodbury formula)
z valueWald statistic z=β^/SE(β^)z = \hat\beta / \text{SE}(\hat\beta)
p-valueTwo-sided p-value from the standard normal distribution
95% CIWald-based 95% confidence interval

Coefficient interpretation follows GLM conventions (on the link function scale). See GLM coefficient interpretation for details.

Model Fit

MetricDescription
DevianceConditional deviance
AICAkaike Information Criterion
BICBayesian Information Criterion

For Gaussian, AIC and BIC are REML-based and should not be used to compare models with different fixed effects (details). For non-Gaussian families, AIC/BIC are based on the Laplace-approximated marginal log-likelihood.

BLUP (Random Effect Predictions)

Displays the predicted random intercept (BLUP) for each group. Smaller groups are shrunk more toward the overall mean (shrinkage details).

Saving and Diagnostics

Enter a model name in Model Name and click Save Model to save the model to the project. A diagnostic derived dataset is automatically created on save.

ColumnDescription
fitted_valuesPredicted values (fixed + random effects)
deviance_residualsDeviance residuals
pearson_residualsPearson residuals
group_random_effectGroup random intercept (BLUP)

After saving, Open Model Details and View Diagnostics buttons become available.

Notes

Current Limitations

The current GLMM implementation supports random intercept models ((1Group)(1 \mid \text{Group})) only. Random slopes ((xGroup)(x \mid \text{Group})) and crossed random effects are not supported.

When to Use GLMM vs GLM

When ICC is small, ignoring group structure and using GLM produces nearly identical results. The impact depends not only on ICC but also on group size; the design effect DEFF=1+(nˉ1)×ICC\text{DEFF} = 1 + (\bar n - 1) \times \text{ICC} provides a rough guide (see GLMM Fundamentals). When ICC is large, GLM violates the independence assumption between observations, leading to underestimated standard errors. GLMM explicitly models within-group correlation, enabling valid inference.

Automatic Exclusion of Missing Values

Rows containing missing values, non-numeric values, or infinity are automatically excluded. The count and reasons for excluded rows are displayed in the results.

Convergence Issues

If the model fails to converge:

  • Increase Max Iterations (100 → 500)
  • Relax Convergence Tolerance (1e-6 → 1e-4)
  • Very few groups (2-3) can make variance component estimation unstable
  • Large scale differences between predictors may cause the GLM initial-value estimation to fail (internal scaling is applied, but extreme cases may still have issues)

See also

  • GLM - Generalized linear models without random effects
  • GLMM Fundamentals - Mathematical background of random effect models