Main Content

Linear Mixed-Effects Models

Linear mixed-effects models are extensions of linear regression models for data that are collected and summarized in groups. These models describe the relationship between a response variable and independent variables, with coefficients that can vary with respect to one or more grouping variables. A mixed-effects model consists of two parts, fixed effects and random effects. Fixed-effects terms are usually the conventional linear regression part, and the random effects are associated with individual experimental units drawn at random from a population. The random effects have prior distributions whereas fixed effects do not. Mixed-effects models can represent the covariance structure related to the grouping of data by associating the common random effects to observations that have the same level of a grouping variable. The standard form of a linear mixed-effects model is

y = X β f i x e d + Z b r a n d o m + ε e r r o r ,

where

  • yis then-by-1 response vector, andnis the number of observations.

  • Xis ann-by-pfixed-effects design matrix.

  • βis ap-by-1 fixed-effects vector.

  • Zis ann-by-qrandom-effects design matrix.

  • bis aq-by-1 random-effects vector.

  • εis then-by-1 observation error vector.

The assumptions for the linear mixed-effects model are:

  • Random-effects vector,b, and the error vector,ε, have the following prior distributions:

    b ~ N ( 0 , σ 2 D ( θ ) ) , ε ~ N ( 0 , σ I 2 ) ,

    whereDis a symmetric and positive semidefinite matrix, parameterized by a variance component vectorθ,Iis ann-by-n单位矩阵,σ2is the error variance.

  • Random-effects vector,b, and the error vector,ε, are independent from each other.

Mixed-effects models are also calledmultilevel modelsorhierarchical modelsdepending on the context. Mixed-effects models is a more general term than the latter two. Mixed-effects models might include factors that are not necessarily multilevel or hierarchical, for example crossed factors. That is why mixed-effects is the terminology preferred here. Sometimes mixed-effects models are expressed as multilevel regression models (first level and grouping level models) that are fit simultaneously. For example, a varying or random intercept model, with one continuous predictor variablexand one grouping variable withMlevels, can be expressed as

y i m = β 0 m + β 1 x i m + ε i m , i = 1 , 2 , .. , n , m = 1 , 2 , ... , M , ε i m ~ N ( 0 , σ 2 ) , β 0 m = β 00 + b 0 m , b 0 m ~ N ( 0 , σ 0 2 ) ,

whereyimcorresponds to data for observationiand groupm,nis the total number of observations, and b0mand εim在dependent of each other. After substituting the group-level parameters in the first-level model, the model for the response vector becomes

y i m = β 00 + β 1 x i m f i x e d e f f e c t s + b 0 m r a n d o m e f f e c t s + ε i m .

A random intercept and slope model with one continuous predictor variablex, where both the intercept and slope vary independently by a grouping variable withMlevels is

y i m = β 0 m + β 1 m x i m + ε i m , i = 1 , 2 , ... , n , m = 1 , 2 , ... , M , ε i m ~ N ( 0 , σ 2 ) , β 0 m = β 00 + b 0 m , b 0 m ~ N ( 0 , σ 0 2 ) , β 1 m = β 10 + b 1 m , b 1 m ~ N ( 0 , σ 1 2 ) ,

or

b m = ( b 0 m b 1 m ) ~ N ( 0 , ( σ 0 2 0 0 σ 1 2 ) ) .

You might also have correlated random effects. In general, for a model with a random intercept and slope, the distribution of the random effects is

b m = ( b 0 m b 1 m ) ~ N ( 0 , σ D 2 ( θ ) ) ,

whereDis a 2-by-2 symmetric and positive semidefinite matrix, parameterized by a variance component vectorθ.

After substituting the group-level parameters in the first-level model, the model for the response vector is

y i m = β 00 + β 10 x i m f i x e d e f f e c t s + b 0 m + b 1 m x i m r a n d o m e f f e c t s + ε i m , i = 1 , 2 , ... , n , m = 1 , 2 , ... , M .

If you express the group-level variable,xim, in the random-effects term byzim, this model is

y i m = β 00 + β 10 x i m f i x e d e f f e c t s + b 0 m + b 1 m z i m r a n d o m e f f e c t s + ε i m , i = 1 , 2 , ... , n , m = 1 , 2 , ... , M .

In this case, the same terms appear in both the fixed-effects design matrix and random-effects design matrix. Eachzimandximcorrespond to the levelmof the grouping variable.

It is also possible to explain more of the group-level variations by adding more group-level predictor variables. A random-intercept and random-slope model with one continuous predictor variablex, where both the intercept and slope vary independently by a grouping variable withM水平,和一组级别的预测变量vmis

y i m = β 0 i m + β 1 i m x i m + ε i m , i = 1 , 2 , ... , n , m = 1 , 2 , ... , M , ε i m ~ N ( 0 , σ 2 ) , β 0 i m = β 00 + β 01 v i m + b 0 m , b 0 m ~ N ( 0 , σ 0 2 ) , β 1 i m = β 10 + β 11 v i m + b 1 m , b 1 m ~ N ( 0 , σ 1 2 ) .

This model results in main effects of the group-level predictor and an interaction term between the first-level and group-level predictor variables in the model for the response variable as

y i m = β 00 + β 01 v i m + b 0 m + ( β 10 + β 11 v i m + b 1 m ) x i m + ε i m , i = 1 , 2 , ... , n , m = 1 , 2 , ... , M , = β 00 + β 10 x i m + β 01 v i m + β 11 v i m x i m f i x e d e f f e c t s + b 0 m + b 1 m x i m r a n d o m e f f e c t s + ε i m .

The termβ11vmximis often called a cross-level interaction in many textbooks on multilevel models. The model for the response variableycan be expressed as

y i m = [ 1 x 1 i m v i m v i m x 1 i m ] [ β 00 β 10 β 01 β 11 ] + [ 1 x 1 i m ] [ b 0 m b 1 m ] + ε i m , i = 1 , 2 , ... , n , m = 1 , 2 , ... , M ,

which corresponds to the standard form given earlier,

y = X β + Z b + ε .

In general, if there areRgrouping variables, andm(r,i) shows the level of grouping variabler, for observationi, then the model for the response variable for observationiis

y i = x i T β + r = 1 R z i r b m ( r , i ) ( r ) + ε i , i = 1 , 2 , ... , n ,

whereβis ap-by-1 fixed-effects vector,b(r)m(r,i)is aq(r)-by-1 random-effects vector for therth grouping variable and levelm(r,i), andεiis a 1-by-1 error term for observationi.

References

[1] Pinherio, J. C., and D. M. Bates.Mixed-Effects Models in S and S-PLUS. Statistics and Computing Series, Springer, 2004.

[2] Hariharan, S. and J. H. Rogers. “Estimation Procedures for Hierarchical Linear Models.”Multilevel Modeling of Educational Data(A. A. Connell and D. B. McCoach, eds.). Charlotte, NC: Information Age Publishing, Inc., 2008.

[3] Hox, J.Multilevel Analysis, Techniques and Applications. Lawrence Erlbaum Associates, Inc., 2002

[4] Snidjers, T. and R. Bosker.Multilevel Analysis. Thousand Oaks, CA: Sage Publications, 1999.

[5] Gelman, A. and J. Hill.Data Analysis Using Regression and Multilevel/Hierarchical Models. New York, NY: Cambridge University Press, 2007.

See Also

||

Related Topics