Skip to main content

Module mixed

Module mixed 

Source
Expand description

Mixed / hierarchical linear models — regression for grouped (clustered, repeated-measures, multilevel) data, where observations within a group are correlated and ordinary least squares would understate the uncertainty.

  • LinearMixedModel — a random-intercept model yᵢⱼ = xᵢⱼᵀβ + bⱼ + εᵢⱼ with one grouping factor, fit by REML (default) or ML. Because there is a single random intercept the marginal covariance inverts in closed form per group, so estimation is a one-dimensional search over the variance ratio λ = σ²_b/σ²_e — no general optimizer needed.
  • MixedModel — the general Gaussian LMM: one or more RandomEffect terms giving random slopes and/or crossed / nested grouping factors. Profiles β and σ²_e out and optimizes the relative covariance parameters with Nelder–Mead over a dense Cholesky solve; it reduces to LinearMixedModel exactly for a single intercept term.
  • GlmmFit — a generalized linear mixed model (random intercept, Poisson or Bernoulli) via the Laplace approximation: an inner Newton loop for the conditional modes inside an outer search over β and σ_b.

The diagnostics that matter here are the ones OLS cannot express: the variance components, the intraclass correlation ICC (how much of the variance is between groups), the shrinkage BLUPs of the group effects, and fixed-effect standard errors that account for the within-group correlation.

§Scope and scale

The general models use a dense O(n³) solve — appropriate for the grouped datasets these diagnostics target, not for very large n. The random-intercept LinearMixedModel is exact: for a balanced one-way design its REML variance components equal the classical ANOVA estimators (tests/mixed.rs).

Structs§

GlmmFit
A fitted random-intercept generalized linear mixed model (GLMM),
LinearMixedModel
A fitted random-intercept linear mixed model
MixedModel
A fitted general linear mixed model with one or more random-effect terms — random slopes and/or crossed & nested grouping factors — estimated by REML (default) or ML.
RandomEffect
One random-effect term: a grouping factor plus the columns whose coefficients vary randomly across its groups.

Enums§

GlmmFamily
Conditional response family for a GlmmFit.
Method
Estimation method for the variance components.