Lecture 45—Friday, April 7, 2006

What was covered?

Terminology defined

Level-2 predictors in multilevel models

where . The iid notation means independent and identically distributed and refers to the fact that error terms and random effects with different values of the subscript are independent but share a common distribution. In other words, the random variations within a species are independent (and independent of those from other species) and the random effects for a species are independent of the random effects from other species.

> inverts[1:10, c("species", "lnPLD", "lntemp", "climate.3", "feeding.type")]
               species    lnPLD   lntemp climate.3 feeding.type
1 Amphiprion melanopus 2.509599 3.218876  tropical            P
2 Amphiprion melanopus 2.197225 3.332205  tropical            P
3      Armases miersii 2.960105 3.173878  tropical            L
4      Armases miersii 2.397895 3.377588  tropical            L
5 Balanus amphitrite 1 2.833213 2.708050 temperate            P
6 Balanus amphitrite 1 2.639057 2.995732 temperate            P
7 Balanus amphitrite 1 2.302585 3.135494 temperate            P
8 Balanus amphitrite 1 2.079442 3.218876 temperate            P
9 Balanus amphitrite 1 2.197225 3.295837 temperate            P
10    Balanus eburneus 2.028148 2.995732 temperate            P

Using a level-2 predictor to explain intercept variability

lme(fixed=y~1+x+z,random=~1+x|species,data=inverts)

or more simply because the intercept is assumed in each case.

lme(fixed=y~x+z,random=~x|species,data=inverts)

Using a level-2 predictor to explain slope variability

lme(fixed=y~1+x+z:x,random=~1+x|species,data=inverts)

or more simply because the intercept is assumed in each case.

lme(fixed=y~x+z:x,random=~x|species,data=inverts)

Here the notation z:x is used to denote the interaction term in the model.

Using a level-2 predictor to explain slope and intercept variability

lme(fixed=y~1+x+z+z:x,random=~1+x|species,data=inverts)

or more simply because the intercept is assumed present in each case.

lme(fixed=y~x+z+z:x,random=~x|species,data=inverts)

We can enter this even more simply using R's shortcut notation, x*z = x + z + x:z

lme(fixed=y~x*z,random=~x|species,data=inverts)

Some general comments

Population-averaged (marginal) model:

The subject-specific model includes both the fixed and random effects (but not the level-1 error term).

Subject-specific (conditional) model:

The notation used on the lefthand side of the last equation means that given values for the random effects, the mean of the response is as shown.

A concrete example using the climate variable in the larval development data set

> contrasts(inverts$climate.3)
          temperate tropical
polar             0        0
temperate         1        0
tropical          0        1

or in composite form

Course Home Page


Jack Weiss
Phone: (919) 962-5930
E-Mail: jack_weiss@unc.edu
Address: Curriculum in Ecology, Box 3275, University of North Carolina, Chapel Hill, 27516
Copyright © 2006
Last Revised--April 7, 2006
URL: http://www.unc.edu/courses/2006spring/ecol/145/001/docs/lectures/lecture45.htm