Skip to main content

Unit 6

Introduction

Welcome to Week 6 of BIO144!

Learning objectives for the week

These learning objectives, together with the content of the course book chapter, define what you need to know for the exam.

After this unit, students will be able to:

  1. Identify biological questions that require a model with more than one explanatory variable.
  2. Write the multiple regression model as an equation, and explain what each coefficient represents.
  3. Use R to fit a multiple regression with lm().
  4. Use diagnostic plots to judge whether the assumptions of a multiple regression are reasonably met.
  5. Calculate the model and residual degrees of freedom of a multiple regression, counting k − 1 degrees of freedom for a categorical explanatory variable with k levels, and use them in the F-test and in adjusted R².
  6. Use the overall F-test to judge whether the explanatory variables together explain variation in the response.
  7. Interpret each coefficient as the association between that explanatory variable and the response with the other explanatory variables held constant, including its direction and size.
  8. Use R to obtain R² and adjusted R², and explain why adjusted R² is needed when comparing models with different numbers of explanatory variables.
  9. Compare the importance of explanatory variables measured on different scales using standardised coefficients, and explain what is lost by standardising.
  10. Use predict() to make predictions for given values of all explanatory variables.
  11. Explain what collinearity is, detect it (e.g. correlations among explanatory variables, variance inflation factors), and describe its consequences for coefficient estimates and their uncertainty.
  12. Use the residual degrees of freedom of two nested models in an F-test comparing them.
  13. Explain what a confounding variable is, how including a measured confounder in a multiple regression reduces bias in the estimated effect of another variable, and why this cannot prove causation.
  14. Recognise a correct and complete statement of multiple regression results.

Book chapter

This week we will be covering Chapter 6: Multiple regression of the course book.

Video and code walkthrough

Each chapter of the course book has a code walkthrough: an R script with the code of the chapter, with comments explaining each step, and a video in which Owen works through the script. Use them to learn the R code you need this week. Work through them before the practical, ideally running the script line by line while you watch the video. The last section of the script (“Practical toolbox”) shows code that the practical uses but the chapter does not.

Script: walkthrough_ch06_multiple_regression.R

To download the script straight into your RStudio project folder (for example on RStudio Server), run this line in the Console:

download.file("https://opetchey.github.io/BIO144_Course_Book/walkthroughs/walkthrough_ch06_multiple_regression.R", destfile = "walkthrough_ch06_multiple_regression.R")

Video: coming soon.

Lecture

Please attend the lecture. If for any reason you can’t, please watch the podcast, which is available on OLAT.

Optional: some ideas for how you could prepare for the lecture (no preparation is also fine) are in Preparing for lectures.

Homework, Practical, and Weekly Quiz

Available here. You will need to be on a UZH network to access this link, so if you are not on campus, you will need to connect to the UZH VPN first.