Module 4: Roads and Regressions
Overview
With fishing bays selected and collars in need of replacement, the team faces two new challenges: identifying the makers of a mystery batch of collars, and planning a road to the fishing sites that minimizes harm to Antarctica’s fragile ecosystem - including avoiding habitat for Antarctic hair grass and penguin nesting sites. Students learn to combine datasets using joins and binds, get an introduction to machine learning through K-Nearest Neighbors classification, and dive into linear and multiple regression to model environmental relationships. By the end of the module, students can work with data from multiple sources, fit regression models, and interpret their results.
Learning Objectives
By the end of this module, students will be able to:
- combine data frames using binding and joining operations in
tidyverse - explain the basic concept of K-Nearest Neighbors (KNN) as a classification algorithm
- describe what a model is and how it can be used to understand and predict relationships between variables
- run and interpret a simple linear regression using
lm()andsummary() - interpret regression output including the slope, intercept, R-squared value, and p-value
- add a regression line to a
ggplot2scatter plot usinggeom_smooth() - explain when and why multiple regression is preferable to simple linear regression
- run and interpret a multiple regression with more than one independent variable
Lessons & Assignments
Lessons
Assignments
| Assignment | QMD | Data Files | Outputs |
|---|---|---|---|
| M4A1: Phosphorus and Hair Grass | Download | hairgrass_data.csv | Download |
| M4A2: Exploring Environmental Variables | Download | hairgrass_data.csv | None |
| M4A3: Comparing Populations | Download | nonvascular_plants.csv | Download |
| M4A4: Practice for the Final | Download | None (uses palmerpenguins R package) | Download |
GitHub
To clone the entire course, visit the course GitHub repository.