# Mixed Effects

Linear mixed-effects models

A linear mixed-effects model includes both fixed and random effects in modeling a response variable. This type of model can account for global and local trends in a data set by including the random effects of a clustering variable. You can fit a linear mixed-effects model using `fitlme` if your data is in a table. Alternatively, if your model is not easily described using a formula, you can create matrices to define the fixed and random effects, and then fit the model using `fitlmematrix`.

## Functions

expand all

 `fitlme` Fit linear mixed-effects model `fitlmematrix` Fit linear mixed-effects model
 `predict` Predict response of linear mixed-effects model `random` Generate random responses from fitted linear mixed-effects model `fixedEffects` Estimates of fixed effects and related statistics `randomEffects` Estimates of random effects and related statistics `fitted` Fitted responses from a linear mixed-effects model
 `anova` Analysis of variance for linear mixed-effects model `coefCI` Confidence intervals for coefficients of linear mixed-effects model `coefTest` Hypothesis test on fixed and random effects of linear mixed-effects model `compare` Compare linear mixed-effects models `designMatrix` Fixed- and random-effects design matrices `covarianceParameters` Extract covariance parameters of linear mixed-effects model `partialDependence` Compute partial dependence (Since R2020b) `residuals` Residuals of fitted linear mixed-effects model `response` Response vector of the linear mixed-effects model
 `plotPartialDependence` Create partial dependence plot (PDP) and individual conditional expectation (ICE) plots `plotResiduals` Plot residuals of linear mixed-effects model

## Objects

 `LinearMixedModel` Linear mixed-effects model