\[ \DeclareMathOperator{\argmin}{argmin} \DeclareMathOperator{\Var}{Var} \DeclareMathOperator{\Cor}{Cor} \]


This book should help you get familiar with analysis of variance (ANOVA) and mixed models in R. From a methodological point of view, we build upon the knowledge of an introductory course to probability and statistics covering the basic concepts of statistical inference (estimation, hypothesis tests, confidence intervals) up to the two-sample \(t\)-test.

There are of course already excellent textbooks covering ANOVA (including experimental design) in great detail. Examples are Oehlert (2010), Kuehl (2000), Montgomery (2019) and many more. We build upon these great books. From a mathematical point of view, we use similar notation as Oehlert (2010). We try to provide a compact overview of the most important topics including the corresponding applications in R (R Core Team 2021) using flexible mixed model approaches. We also use examples from the classical text books and will redo the corresponding statistical analysis in R. This means you will see a lot of both R code and R output having the following form.

text <- "Let's get started ..."
paste(text, "now!", sep = " ")
## [1] "Let's get started ... now!"

For better readability, we sometimes shorten the R output a bit. This is indicated with the symbol “## ...” If you are completely new to R you can get an overview of online courses for example at https://education.rstudio.com/.

In addition, we try to give you an intuition when and how things can go wrong. This is useful not only when planning an experiment on your own but also when analyzing data from other sources or when reading a research paper. As this is an introductory text, the focus is on getting to know multiple experimental design types, when they are being used and how a proper analysis in R looks like. A textbook which focuses more on setting up a design “from scratch” is Kaltenbach (2021).

If you find any errors, inconsistencies or if you miss something, please e-mail me or fill out the (anonymous) feedback form at https://goo.gl/ZBvjj9.

Lukas Meier