Data In The Wild
  1. Module 4
  2. Overview
  • Home
  • Contact Us
  • For Instructors

  • Module 1
    • Overview
    • 1.1: Introduction to R and RStudio
    • 1.2: Intro to Coding in R
    • 1.3: Introduction to the tidyverse
    • Assignment 2
    • Assignment 3
  • Module 2
    • Overview
    • 2.1: Good Food Gone Bad
    • 2.2: Plotting with ggplot2
    • 2.3: Data Visualization
    • 2.4: Exploring geom Functions
    • 2.5: Module 2 Wrap-Up
    • Assignment 1
    • Assignment 2
    • Assignment 3
  • Module 3
    • Overview
    • 3.1: Leopard Seals
    • 3.2: T-Tests
    • 3.3: Comparing (Multiple) Means
    • Assignment 1
    • Assignment 2
  • Module 4
    • Overview
    • 4.1: Combining Datasets (Joins & Binds)
    • 4.2: K-Nearest Neighbor
    • 4.3: Roads and Regressions
    • 4.4: Multiple Regression
    • 4.5: Writing Functions
    • Assignment 1
    • Assignment 2
    • Assignment 3
    • Assignment 4
  • Module 5
    • Overview
    • 5.1: Population Growth
    • 5.2: Sustainable Fishing
    • 5.3: Comparing Populations
    • Assignment 1
    • Assignment 2
    • Assignment 3
  • Final Project

  • Resources
  1. Module 4
  2. Overview

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() and summary()
  • interpret regression output including the slope, intercept, R-squared value, and p-value
  • add a regression line to a ggplot2 scatter plot using geom_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

Lesson QMD Data Files
4.1: Combining Datasets Download collar_data.csv, new_collars.csv, old_collars_new_data.csv
4.2: KNN and Accuracy Download all_collar_data.csv
4.3: Roads and Regressions Download hairgrass_data.csv
4.4: Multiple Regression Download site_changes.csv
4.5: Writing Functions Download hairgrass_data.csv

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.

2026, University of Arizona & Lewis & Clark College

 
  • Made with Quarto