mixedmodels
Mixed models, or mixed-effects models, are statistical models that include both fixed effects and random effects to handle correlation and non-independence in data arising from clustering, repeated measurements, or hierarchical structure. Fixed effects describe systematic, population-level influences, while random effects capture unit-specific deviations and variance components associated with grouping factors such as subjects, sites, or schools. The standard linear mixed model uses a normal response and can be written as y = Xβ + Zb + ε, where Xβ represents fixed effects, Zb represents random effects with b ~ N(0, D), and ε ~ N(0, σ^2 I) is residual error. Generalized linear mixed models extend this framework to non-normal responses through a link function: g(E[y|b]) = Xβ + Zb.
Estimation typically proceeds by maximum likelihood or restricted maximum likelihood (REML); Bayesian approaches using MCMC are
Random effects can include random intercepts, random slopes, or more complex structures; designs may be nested
Applications span psychology, ecology, education, biostatistics, and econometrics, especially with longitudinal and clustered data. Model selection