Modelling dependent data

It can well be argued that at better title for the course could be modelling dependent data or something like that.

With linear models (LMs) and generalized linear models (GLMs), focus is on modelling independent random variables. Often, however, data exihibit some sort of correlation. An example could be repeated measurements (over time) on the same person/animal/physical location. In such cases, groups of observations will often exhibit a correlation. Ignoring this correlation may lead to invalid statistical inference. The typical situation is that the parameter estimates (regression coefficients) are fine, but the estimated standard errors are too small (the typical case) or too large (more rare but both things can happen). This means that test statistics can become too extreme (just think about how a \(t\)-test is constructed). This in turn can lead to that too strong conclusions about the significance of e.g. a treatment effect.

Mixed models provides a toolbox for handling such situations.

Updates on this page

This page will be updated as we move along, so please do not forget refresh your browser.

Course material

The textbook for the course is

Madsen, H. and Thyregod, P. (2011) Introduction to General and Generalized Linear Models, Chapman and Hall/CRC, parts of chapters 5 and 6

In addition, various notes and articles will be provided.

Some material and a plan for the course can be found here

Additional literature:

  • Faraway (2006) Extending the linear model with R, Chapman and Hall/CRC, chapter 2 and 8, which is a useful reference regarding more practical aspects of fitting mixed models.

  • Demidenko (2013) Mixed Models: Theory and Applications with R, Second Edition, Pages 41-60 give technical background on MLE and REML.

  • Christensen (2025): Plane answers to complex questions, chapter 11 and 12.

Software

We will use R. Prior to the course you are requested to install the most recent version of R and the following packages: remotes, dplyr, ggplot2, lme4, nlme, doBy, caracas, pbkrtest.

All packages should install from CRAN right away except caracas, which requires python to be installed. Please see here for installation details.

It is recommended to frequently (also during the course) to run

update.packages()

During the course, there will certainly be updates of the packages doBy, pbkrtest and caracas which I maintain/develop. To install development versions of these packages do:

remotes::install_github("hojsgaard/doBy")
remotes::install_github("hojsgaard/pbkrtest")
remotes::install_github("r-cas/caracas")

Evaluation

The course will be evaluated by active participation in solving exercises, presenting solutions of exercises, and handing in miniproject reports.