Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

Population Ecology in Practice – Online Exercises

Welcome to the online exercises for Population Ecology in Practice. The online exercises are
intended to supplement the topics and concepts covered in individual chapters, and thus should
be used as a companion to help readers develop skills in the application of commonly-used
procedures and statistical approaches outlined in chapters. The exercises provide worked through
examples of empirical data sets that are designed to help readers strengthen their basic
programming and analytical skills, and thereby establish a framework for conducting robust
analyses of their own datasets. Accordingly, the collective intent of these exercises is to provide
the tools necessary for readers to implement a variety of contemporary and robust analyses in
population ecology.

Each chapter folder contains a pdf document that outlines all of the respective materials for each
exercise. A majority of chapters include datasets, instructions, and scripts for conducting the
online exercises in Program R. For some chapters, authors developed sample exercises based on
other types of open source software. Here, the chapter folders include stepwise explanations for
accessing and using other types of external software. The intent is for each chapter folder to
contain the materials necessary to replicate the basic statistical analyses that are described in
each chapter. Users who are unfamiliar with the use of Program R are advised to first begin by
reading and conducting exercises from Chapter 16 before attempting to conduct most of the other
exercises. Finally, given the large diversity of analytical techniques that are currently available to
ecologists, including the sample of methods provided here, we remind that it is always good
practice for first-time users to consult with experienced colleagues or statisticians when
attempting new analyses. Online fora also offer a valuable resource for setting a strong analytic
foundation, and are especially useful for debugging computer code or learning about
computational shortcuts or pitfalls.

Things to note:

1) R is case sensitive, so keep this in mind if you are receiving error messages about objects
or functions. Sometimes rewriting code works better than copying and pasting, even if
the resulting line of code looks exactly the same.

2) Some R exercises will work best if run in base R or in RStudio. Compatibility issues can
arise when trying to run the exercises in RMarkdown or the Mac OS, especially with
some of the sample exercises from chapters 11, 13, and 15.

3) All of the R exercises have been prepared in RMarkdown but in a few cases the pdf
document for the exercise is slightly different than the R script for the exercise. For
example, an annotation or command with a # symbol in front that needs to be removed in
order to run the command properly. The issues are addressed within the exercise text and
highlight which commands must be run in a separate document.

4) Chapter 7 includes exercises that use the RMark package as an interface to Program
Mark. Program Mark was written as a Windows application. To run Programs R and
Mark on a Mac OS requires setting up a virtual environment for Windows software using
bootcamp, Parallels, or Virtual Box. For current information, see
www.phidot.org/software/mark.

5) Many of the online exercises require additional R packages with specialized functions
designed for ecological analyses. The R packages need to installed into Program R
before the exercises can be run, for example by using the “install.packages()”
function. Once the packages have been downloaded and installed, use of the
“library()” function will load the packages into the R environment so that the
functions are available for use.

We hope that the exercises are useful and help to facilitate new analyses for Population Ecology
in Practice!

Patrick Heney and Dennis L. Murray


Trent University
Peterborough, Ontario, Canada

Brett K. Sandercock
Norwegian Institute for Nature Research
Trondheim, Trøndelag, Norway

5 May 2019
Overview of online exercises:

Part 1: Tools for Population Biology

Chapter 1  How to Ask Meaningful Ecological Questions


Charles J. Krebs

No exercises are available for this introductory chapter.

Chapter 2  From Research Hypothesis to Model Selection: A Strategy for Robust


Inference in Population Ecology
Dennis L. Murray, Guillaume Bastille-Rousseau, Lynne E. Beaty, Megan L. Hornseth, Jeffrey R.
Row, and Daniel H. Thornton

The online exercises are designed to provide an understanding of the basic steps toward robust
analysis in population ecology. Exercise 1 uses a snowshoe hare (Lepus americanus) dataset to
conduct exploratory analysis and develop a statistical model assessing factors affecting body
condition. Exercise 2 develops multiple models predicting cause of death for snowshoe hares
relative to body condition and environmental factors. Exercise 3 extends this approach to
conduct model selection and multimodel inferencing.

Part 2: Population Demography

Chapter 3  Estimating Abundance or Occupancy from Unmarked Populations


Brett T. McClintock and Len Thomas

The online exercises include four exercises intended to familiarize the user with analysis of
unmarked animals.  Exercises 1 and 2 use data for minke whales (Balaenoptera acutorostrata)
and pantropical spotted dolphins (Stenella attenuata) to provide comparative examples of
classical and model-based distance sampling analyses. Exercise 3 conducts an analysis of
spatially replicated counts for Mallards (Anas platyrhynchous). Exercise 4 uses the same dataset
to fit single-season occupancy models. 

Chapter 4  Analyzing Time Series Data: Single Species Abundance Modelling


Steven Delean, Thomas A.A. Prowse, Joshua V. Ross, and Jonathan Tuke

The online exercises provide a variety of examples of time series analysis for animal
populations. Exercise 1 fits auto-regressive moving-average (ARMA) models to a time series for
abundance of beavers. Exercise 2 outlines approaches for fitting continuous ordinary differential
equations to a time series of sheep abundance, followed by likelihood maximization of discrete-
time density dependence models that include a stochastic term, thereby approximating a
continuous-time model. Exercise 3 uses a time series for Cackling Geese (Branta hutchinsii) to
introduce the concept of fitting state-space models for density dependence to single species time
series. The exercise estimates model parameters using a Laplace approximation, and uses a
parametric bootstrap to evaluate density dependence. The exercise also demonstrates how to
apply a full Bayesian analysis to estimate model parameters.
Chapter 5  Estimating Abundance from Capture-Recapture Data
J. Andrew Royle and Sarah J. Converse

The online exercises illustrate the application of some of the standard capture-recapture models
as well as a spatially-explicit capture-recapture model, using captures of deer mice (Peromyscus
maniculatus).

Chapter 6  Estimating Survival and Cause-Specific Mortality from Continuous Time


Observations
Dennis L. Murray and Guillaume Bastille-Rousseau

The online exercises use simulated and real data to illustrate the principles of survival analysis
from continuous time observations. Exercise 1 uses a simulated dataset to show basic data
management needs for survival analysis, including how to properly structure the time variable.
Next, the exercise conducts simple hypothesis tests and demonstrates how to graph survival
functions. Exercises 2 and 3 demonstrate the processes for developing more complex semi-
parametric and parametric models to evaluate mortality risk determinants, using data from a
study of nest predation with two species of freshwater turtles. Exercise 4 uses data from a
population of gray wolves (Canis lupus) to demonstrate the steps for a competing risks analysis,
including generating corresponding graphical functions to compare across risk types. 

Chapter 7  Mark-Recapture Models for Estimation of Demographic Parameters


Brett K. Sandercock

The online exercises focus on data management and estimating demographic parameters from
capture-mark-recapture data. Exercise 1 provides an R script for a songbird dataset that shows
how to convert a vertical file with captures on different occasions to a horizontal encounter
history with ones and zeros for detection and nondetection events. Exercise 2 is used to
summarize encounter histories into a standard m-array for input to different software
packages. Exercise 3 uses the RMark software as an interface to Program MARK to estimate
apparent survival and probability of detection for a well-known dataset for White-throated
Dippers (Cinclus cinclus) based on a Cormack-Jolly-Seber model. 

Part 3: Population Models

Chapter 8  Projecting Populations


Stéphane Legendre

The online exercises include example projection matrices for songbirds and wolves (Canis
lupus). Seven exercises illustrate matrix calculations for models based on constant deterministic
matrices, models with environmental stochasticity (with and without autocorrelation), a 2-site
model, and a 2-sex model with demographic stochasticity.

Chapter 9  Combining Counts of Unmarked Individuals and Demographic Data Using


Integrated Population Models
Michael Schaub

The online exercises provide examples of an integrated population model fitted to counts,
capture-recapture data and data on productivity. The models are based on JAGS code and are run
from R using functions in the R package jagsUI. Exercise 1 is modified for the case where no
data on productivity are available. Exercise 2 extends a model based on constant demographic
rates to one with random temporal effects. Exercise 3 adapts the model to consider the possible
outcomes from alternative management scenarios, as part of a population viability analysis.

Chapter 10  Individual and Agent-Based Models in Population Ecology and Conservation


Biology
Eloy Revilla

The online exercises illustrate the applications of individual-based models in population analysis.
Exercise 1 is an exponential model representing an iteroparous organism with a single
reproductive event each year. Exercise 2 extends the exponential model by adding the effects of
density-dependence in a single population. Exercise 3 extends the model with density-
dependence for a single population to a spatially-explicit model with three different types of
habitat: non-habitat, sink habitat, and source habitat.

Part 4: Population Genetics and Spatial Ecology

Chapter 11  Genetic Insights into Population Ecology


Jeffery R. Row and Stephen C. Lougheed

The online exercises illustrate both individual and population-based genetic analyses for example
data from different populations. Exercise 1 uses Bayesian models to examine spatial clustering
and genetic structure among foxsnakes (Pantheropis sp.) that were genotyped with microsatellite
markers. Exercise 2 is an example of spatial clustering of simulated genotypes across a climatic
cline. Exercises 3 and 4 use spatial Principal Components Analysis (sPCA) to identify spatially-
explicit genetic structure. Exercises 5 and 6 use Bayesian models to estimate effective population
size and population trends based on coalescent analysis.

Chapter 12  Spatial Structure in Population Data


Marie-Josée Fortin

The online exercises illustrate the basics of point pattern analysis, area pattern analysis, and
spatial interpolation. Exercise 1 provides an example of spatial data in a quadrat sampling
scheme, including calculating different versions of Ripley’s K statistic and kernel density
functions. The effect of outliers is illustrated by repeating the calculations on different subsets of
the dataset. Exercise 2 illustrates spatial modeling where point data are transformed into
abundance data to examine patterns of spatial autocorrelation using Moran’s I statistic. Different
functions in R packages are used to illustrate spatial interpolation based on kriging techniques. 

Chapter 13  Animal Home Ranges: Concepts, Uses and Estimation


Jon S. Horne, John Fieberg, Luca Börger, Janet L. Rachlow, Justin M. Calabrese, and Chris H.
Fleming

The original dataset used for online exercises are no longer available for public use. The authors
are in the process of finding a suitable dataset.

Chapter 14  Analysis of Resource Selection by Animals


Joshua J. Millspaugh, Christopher T. Rota, Robert A. Gitzen, Robert A. Montgomery, Thomas
W. Bonnot, Jerrold L. Belant, Christopher R. Ayers, Dylan C. Kesler, David A. Eads, and
Catherine M. Bodinof Jachowski

The online exercises provide users with practical applications of the analysis of resource
selection data. Exercise 1 uses simulations representing common sampling methods to highlight
the importance of assessing bias and precision of parameter estimates in studies of resource
selection. Exercise 2 demonstrates the use of discrete choice models to identify important
resource features for a reintroduced population of hellbender salamanders (Cryptobranchus
alleganiensis), and highlights the use of discrete choice models when available resources are
explicitly paired. Exercise 3 demonstrates development of a resource utilization function, thereby
highlighting the application of a continuous response variable as estimated by a utilization
distribution.  Exercise 4 provides an application of Poisson Regression using count data to
investigate resource selection by black-footed ferrets (Mustela nigripes). Exercise 5 highlights
how resource use can be tied with species condition by assessing the effects of resource use on
the percent body fat of black bears (Ursus americanus). 

Chapter 15  Species Distribution Modeling


Daniel H. Thornton and Michael J.L. Peers

The online exercises illustrate species distribution modeling based on locality records for the
striped skunk (Mephitis mephitis). Exercise 1 uses the Program MaxEnt to develop a rangewide
model of the probability of occurrence, including showing how spatial rarification of occurrence
records can help address for spatial bias. Exercise 2 extends the model to predict impacts of
different climate change scenarios on species distribution. Exercise 3 illustrates use of
the Program MigClim to combine scenarios of climate change with information on dispersal
distances to predict future species distributions. 

Part 5: Software Tools

Chapter 16  The R Software for Data Analysis and Modeling


Clément Calenge

The online exercises provide a basic introduction to Program R. Exercise 1 is an example of a


graphical exploration of data on the ecological niches of two species of grouse: Rock Ptarmigan
(Lagopus muta) and Black Grouse (Lyrurus tetrix). The example illustrates basic
functions for importing and summarizing data, creating graphs, and programming
loops. Exercise 2 illustrates steps for using a generalized linear model (GLM) to model species
occurrence as a function of habitat variables. Exercise 3 shows how predicted values from the
GLM can be plotted to visualize model results. 

You might also like