Categories &

Functions List

Class Definition: LinearMixedModel

statistics: LinearMixedModel

Linear mixed-effects model fitted to data.

A LinearMixedModel object represents a fitted linear mixed-effects model $$ y = X\beta + Zb + \varepsilon, $$ with fixed effects beta, random effects b distributed as N(0, Psi), and independent errors N(0, sigma2). Objects are created with fitlmematrix (from design matrices).

The estimated fixed effects and their statistics are available through the Coefficients table; the covariance parameters through covarianceParameters; the random-effect BLUPs through randomEffects; and predictions, residuals, and hypothesis tests through the predict, residuals, anova, coefTest, and coefCI methods.

See also: fitlmematrix, fitlm

Source Code: LinearMixedModel

The LinearMixedModel class contains the following properties:

A character vector, either 'ML' for maximum likelihood or 'REML' for restricted maximum likelihood, naming the method that fitted the model. This property is read-only.

A positive integer counting the observations used for the fit. This property is read-only.

A positive integer counting the fixed-effects coefficients of the model. This property is read-only.

A positive integer counting the fixed-effects coefficients estimated from the data. Every coefficient the model carries is estimated, so this equals NumCoefficients. This property is read-only.

A table with one row per fixed-effects coefficient, its row names taken from CoefficientNames, and the variables Estimate, SE, tStat, DF, pValue, Lower and Upper. Lower and Upper bound a 95% confidence interval. This property is read-only.

A square numeric matrix, one row and column per fixed-effects coefficient, holding the estimated covariance of the estimates in Coefficients. This property is read-only.

A cell array of character vectors with one name per fixed-effects coefficient. This property is read-only.

A scalar, the maximised log-likelihood, or the maximised restricted log-likelihood when FitMethod is 'REML'. This property is read-only.

A scalar structure with the fields AIC, BIC, LogLikelihood and Deviance. The parameter count behind AIC and BIC holds the fixed-effects coefficients, the covariance parameters and the residual variance. This property is read-only.

A scalar structure with the fields Ordinary and Adjusted. Ordinary is one less the ratio of SSE to SST, and Adjusted corrects that ratio for the error degrees of freedom. This property is read-only.

A nonnegative scalar, the sum of the squared differences between the response and the conditional fit. This property is read-only.

A nonnegative scalar, the sum of the squared deviations of the conditional fit about the mean of the response. This property is read-only.

A nonnegative scalar, SSE plus SSR. This property is read-only.

A positive scalar, the estimate of the error variance. This property is read-only.

A nonnegative integer, NumObservations less NumCoefficients. This property is read-only.

A character vector describing the model. It is empty for a fit built from design matrices, which carries no formula. This property is read-only.

A character vector naming the response. It is empty for a fit built from design matrices. This property is read-only.

The LinearMixedModel class offers the following public methods:

LinearMixedModel: lme = LinearMixedModel (info)

LinearMixedModel: beta = fixedEffects (lme)
LinearMixedModel: [beta, names] = fixedEffects (lme)

LinearMixedModel: b = randomEffects (lme)
LinearMixedModel: [b, names] = randomEffects (lme)

LinearMixedModel: [psi, mse] = covarianceParameters (lme)

LinearMixedModel: yf = fitted (lme)
LinearMixedModel: yf = fitted (lme, "Conditional", tf)

LinearMixedModel: r = residuals (lme)
LinearMixedModel: r = residuals (lme, "ResidualType", type)

LinearMixedModel: ypred = predict (lme, Xnew, Znew, Gnew)
LinearMixedModel: [ypred, yci] = predict (…)
LinearMixedModel: […] = predict (…, name, value)

LinearMixedModel: tbl = anova (lme)
LinearMixedModel: tbl = anova (lme, "DFMethod", method)

LinearMixedModel: p = coefTest (lme)
LinearMixedModel: p = coefTest (lme, H)
LinearMixedModel: [p, F, df1, df2] = coefTest (…)

LinearMixedModel: ci = coefCI (lme)
LinearMixedModel: ci = coefCI (lme, alpha)

LinearMixedModel: D = designMatrix (lme, type)