AE 10: Ice cover in Madison, WI area lakes

Application exercise
Important

These are suggested answers. This document should be used as reference only, it’s not designed to be an exhaustive key.

The data for this application exercise comes from the lterdatasampler package. The mission of the Long Term Ecological Research program (LTER) Network is to “provide the scientific community, policy makers, and society with the knowledge and predictive understanding necessary to conserve, protect, and manage the nation’s ecosystems, their biodiversity, and the services they provide.”

Specifically we’ll be using data from the North Temperate Lakes LTER (NTL-LTER) site, which is located in the Madison, WI area, modeling the relationship between number of days that a lake is frozen, excluding periods where the lake thaws before refreezing again, and annual average temperature.

Getting started

Packages

We will use the tidyverse package for data visualization and wrangling and the tidymodels package for modeling.

Data

The data can be found in the data folder; it’s called icecover.csv.

# add code here

The data dictionary is below:

Variable Name Description
lakeid Lake name
ice_on Date of freeze of lake
ice_off Date of ice breakup of lake
ice_duration Number of days between the freeze and breakup dates of each lake
year Year of observation
annual_avg_temp Annual average air temperature (°C)

Visualizing the model

We’re going to investigate the relationship between ice_duration and annual_avg_temp.

  • Create an appropriate plot to investigate this relationship. Add appropriate labels to the plot.
# add code here
  • If you were to draw a a straight line to best represent the relationship between ice duration and annual average temperature, where would it go? Why?

Start from the top left and go towards bottom right. Identify the first and last point and draw a line through most the others.

# add code here
  • What types of questions can this plot help answer?

Add response here.

  • We can use this line to make predictions. Predict what you think the ice duration would be in a year with annual average temperature of 7, 10, and 12 °C. Which prediction is considered extrapolation?

Add response here.

  • What is a residual?

Add response here.

Model fitting

Fit a model to predict ice cover from average annual temperature.

# add code here

Model summary

  • Display the model summary including estimates for the slope and intercept along with measurements of uncertainty around them. Show how you can extract these values from the model output.
# add code here
  • Write out your model using mathematical notation.

\[ \widehat{ice~duration} = 148 - 6.18 \times annual~avg~temp \]

Correlation

We can also assess correlation between two quantitative variables.

  • What is correlation? What are values correlation can take?

Add response here.

  • What is the correlation between heights and weights of fish?
# add code here

Fitting other models

We can fit more models than just a straight line. Change the plotting code from earlier to use method = "loess". What is different from the plot created before?

# add code here