Supplement 2. R code used for wolf analysis.

<h2>File List</h2><blockquote> <p><a href="Wolf code.r">Wolf code.r</a> – Source code to run wolf analysis</p> </blockquote><h2>Description</h2><blockquote> <p>This is provided for illustration only, the wolf data are not offered online. The code operates on a data frame in which rows correspond to points in space. The data frame contains a column for use (1 for a telemetry observation, 0 for a control point selected from the wolf’s home range). It also contains columns for x and y coordinates of the point, environmental covariates at that location, wolf ID and wolf pack membership.</p> <p>1. Data frame preparation</p> <p>The data set is first thinned, for computational expediency, the covariates are standardized to improve convergence and the data frame is augmented with columns for wolf-pack-level covariate expectations (required by the GFR approach).</p> <p>2. Leave-one-out validation</p> <p>The code allows the removal of a single wolf from the data set. Two models (one with just random effects, the second with GFR interactions) are fit to the data and predictions are made for the missing wolf. The function gof() generates goodness-of-fit diagnostics.</p> </blockquote>