Data In The Wild
  1. Module 5
  2. Assignment 3
  • 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

On this page

  • Assignment Details
    • Purpose
    • Task
    • Criteria for Success
  • Assignment Questions
    • Set-Up
    • Visual Comparison
    • Fitting Models
    • Plotting Logistic Models
    • Comparing Populations
  1. Module 5
  2. Assignment 3

Module 5, Assignment 3: Comparing Populations

Author

Ellen Bledsoe, Lily McMullen

Assignment Details

Purpose

The goal of this assignment is to assess your ability to apply concepts of data visualization, measures of central tendency and variability, fitting logistic growth models, and using inferential statistics to compare populations.

Task

Write R code which produces the correct answers and correctly interpret the results of visualizations and models.

Criteria for Success

  • Code is within the provided code chunks
  • Code chunks run without errors
  • Code produces the correct result
    • Code that produces the correct answer will receive full credit
    • Code attempts with logical direction will receive partial credit
  • Written answers address the questions in sufficient detail

Assignment Questions

Some of our colleagues from the “mainland” have heard about our work estimating carrying capacities and fitting logistic growth models to populations and have asked for our help.

In their research, they have been using the mass (weight) of the fish they have caught to estimate populations of fish over the last 50 years. In fisheries, using mass as a proxy for, or representation of, abundance is common practice.

Our colleagues have collected data in an interesting location, where the ranges of both species of toothfish (genus: Dissostichus) overlap. Therefore, they have population estimates for both the Patagonian toothfish (also known as Chilean sea bass, D. eleginoides) and the Antarctic toothfish (D. mawsoni) populations in the area.

They want to know (a) what the estimated carrying capacity of each population is and (b) if the population sizes are statistically different from each other.

Set-Up

  1. Load both of the packages (tidyverse, drc) that we will need to use to answer the questions.
  1. Read in the dataset toothfish.csv sent to us by our colleagues with their data.
  1. Examine the data frame, either through code or visually. To complete our analyses, we will need data for (a) time, (b) abundance, and (c) population. Below, identify which columns in the data frames represent which data.
  • Time:
  • Abundance:
  • Population:

Visual Comparison

Let’s start with a visual comparison of the populations.

  1. Make a scatter plot of the two populations. Ensure that the dependent variable is on the y-axis and the independent variable is on the x-axis. Use color to differentiate between the fish populations.

    Be sure to modify your axes labels to be clearer and more descriptive; also, choose a theme for your plot.

  1. Based on your plot above, make some initial observations. (2 points)

    • Does each population appear to be showing growth more akin to exponential or logistic growth?
    • Do the populations show a lot or a little variation?
    • Does one population show more variation? Which population do you expect to have a higher carrying capacity, if it has one?

Answer:

Fitting Models

  1. In order to estimate the carrying capacity of each population, we will first separate the data into two data frames, one for each species of fish.

    Below, create the two new data frames. Be sure to save them as new objects.

Now that we have separate data frames, we can fit the logistic models to each species’ population.

  1. Let’s start with the Patagonian toothfish. Use the drm function to fit a logistic model to the population. Remember to use the fct = LL.4() argument.
  1. Do the same thing for the Antarctic toothfish.
  1. Report the respective carrying capacities in the table below.
Toothfish Species Estimate of K
Patagonian
Antarctic

Plotting Logistic Models

  1. To add the logistic growth curves to our plot, we need to add the “predicted” values from the model to each data frame. We can do this using the predict() function within a mutate() function.

    In each data frame, create a new column called predicted_values that contains the output from the predict() function. Be sure to save the resulting data frame to ensure that the new column is included.

  1. Combine the data frames for the Patagonian and Antarctic toothfish back together into one data frame using the bind_rows() function.
  1. Add the logistic growth curves for each toothfish species to the scatter plot you made earlier. You will use geom_line() to accomplish this task.

    Optional: make the data points partially transparent so we can see the logistic growth curves more clearly.

Comparing Populations

  1. Based on where the logistic models “level off,” let’s numerically and statistically analyze the two populations starting from the year 1995.

    Create and save a new data frame as an object that contains only rows from 1995 or later.

  1. Before we run any inferential statistics, let’s calculate some summary statistics.

    For each species, calculate the average fish mass and the standard deviation of the fish mass.

  1. Compare the average values to the carrying capacity estimates; they will not be exactly the same, but are they close to what we might expect?

    How about our measure of variability, the standard deviation? Do those values match with your interpretation from Question 5? Why or why not? (2 points)

Answer:

  1. Our colleagues have asked us to use an inferential statistical test to determine whether or not the Patagonian toothfish and Antarctic toothfish populations in their study area are of significantly different sizes.

    Run the appropriate statistical test to answer their question.

  1. How do we interpret the results of this statistical test? Are the populations different sizes? How do you know? (2 points)

Answer:

2026, University of Arizona & Lewis & Clark College

 
  • Made with Quarto