Unit 3
Introduction
Welcome to Week 3 of BIO144!
Course book
This week we will be covering Chapter 3: Simple linear regression – Part 1 of the course book.
Code walkthrough
The R code of this week’s chapter is in a code walkthrough script, with a video walkthrough of it. Both are linked at the top of the course book chapter. Work through them before the practical: the last section of the script (“Practical toolbox”) shows code that this week’s practical uses but the chapter does not.
Learning objectives
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:
- Explain when simple linear regression is an appropriate tool for a biological question.
- Write the simple linear regression model as an equation, and identify the intercept, slope and error term.
- Explain the least squares principle by which the intercept and slope are estimated.
- Calculate fitted values and residuals from a regression equation and data.
- Explain what degrees of freedom are: the number of independent pieces of information left for estimating variation after the model parameters have been estimated, so that the residual degrees of freedom equal the number of observations minus the number of estimated parameters.
- Explain why the residual variance of a simple linear regression is estimated by dividing the residual sum of squares by n − 2, and calculate the residual degrees of freedom.
- Explain why few residual degrees of freedom are a problem: imprecise estimates of the residual variance, larger critical t-values and so wider confidence intervals and less power, a risk of fitting noise, and difficulty checking assumptions.
- Describe how the error term is modelled: normally distributed, with mean zero and constant variance.
- State the assumptions of simple linear regression.
- Use R to fit a simple linear regression with
lm()and obtain the estimated intercept and slope. - Use diagnostic plots to judge whether the assumptions of a linear regression are reasonably met, and identify which assumption is violated if not.
- Explain leverage and Cook’s distance, and identify influential observations.
- Identify common problems in a regression (e.g. non-linearity, non-constant variance, influential observations) and select an appropriate remedy (e.g. a transformation).
- Interpret the coefficients of a regression with a log-transformed response and/or explanatory variable (e.g. as proportional or multiplicative effects).
- Explain what makes a model linear (linear in its parameters), so that models with transformed variables can still be fitted with
lm().
Lecture
Please attend the lecture. If for any reason you can’t, please watch the podcast, which is available on OLAT.
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.