Mixed Effects Implement

# Mixed Effects Implement - Linear mixed model implementation...

This preview shows pages 1–4. Sign up to view the full content.

Linear mixed model implementation in lme4 Douglas Bates Department of Statistics University of Wisconsin – Madison May 5, 2009 Abstract We describe the form of the linear mixed-eﬀects and generalized linear mixed-eﬀects models ﬁt by lmer and give details of the repre- sentation and the computational techniques used to ﬁt such models. These techniques are illustrated on several examples. 1 A simple example The Rail data set from the MEMSS package is described in Pinheiro and Bates (2000) as consisting of three measurements of the travel time of a type of sound wave on each of six sample railroad rails. We can examine the structure of these data with the str function > str(Rail) 'data.frame': 18 obs. of 2 variables: \$ Rail : Factor w/ 6 levels "A","B","C","D",. .: 1 1 1 2 2 2 3 3 3 4 . .. \$ travel: num 55 53 54 26 37 32 78 91 85 92 . .. Because there are only three observations on each of the rails a dotplot (Figure 1) shows the structure of the data well. > print(dotplot(reorder(Rail, travel) ~ travel, Rail, xlab = "Travel time (ms)", + ylab = "Rail")) In building a model for these data > Rail 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Travel time (ms) Rail B E A F C D 40 60 80 100 ●● Figure 1: Travel time of sound waves in a sample of six railroad rails. There were three measurements of the travel time on each rail. The order of the rails is by increasing mean travel time. Rail travel 1 A 55 2 A 53 3 A 54 4 B 26 5 B 37 6 B 32 7 C 78 8 C 91 9 C 85 10 D 92 11 D 100 12 D 96 13 E 49 14 E 51 15 E 50 16 F 80 17 F 85 18 F 83 we wish to characterize a typical travel time, say μ , for the population of such railroad rails and the deviations, say b i , i = 1 , . . . , 6 of the individual rails from this population mean. Because these speciﬁc rails are not of interest by themselves as much as the variation in the population we model the b i , which are called the “random eﬀects” for the rails, as having a normal (also called “Gaussian”) distribution of the form N (0 , σ 2 b ). The j th measurement on the i th rail is expressed as y ij = μ + b i + ± ij b i ∼ N (0 , σ 2 b ) , ± ij ∼ N (0 , σ 2 ) i = 1 , . . . , 6 j = 1 , . . . , 3 (1) The parameters of this model are μ , σ 2 b and σ 2 . Technically the b i , i = 1 , . . . , 6 are not parameters but instead are considered to be unobserved ran- dom variables for which we form “predictions” instead of “estimates”. 2
To express generalizations of models like (1) more conveniently we switch to a matrix/vector representation in which the 18 observations of the travel time form the response vector y , the ﬁxed-eﬀect parameter μ forms a 1- dimensional column vector β and the six random eﬀects b i , i = 1 , . . . , 6 form the random eﬀects vector b . The structure of the data and the values of any covariates (none are used in this model) are used to create model matrices X and Z . Using these vectors and matrices and the 18-dimensional vector ± that represents the per-observation noise terms the model becomes y = + Zb + ± , ± ∼ N , ( 0 , σ 2 I ) , b ∼ N ( 0 , σ 2 Σ ) and b ± (2) In the general form we write p for the dimension of β , the ﬁxed-eﬀects parameter vector, and q

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 12/26/2011 for the course ECON 245a taught by Professor Staff during the Fall '08 term at UCSB.

### Page1 / 32

Mixed Effects Implement - Linear mixed model implementation...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online