Classes

Week 11 Lab -- GLMM

The first dataset we’ll look at is from Zuur et al. (2009); the data are from Vicente et al. (2005) who looked at the distribution and faecal shedding patterns of 1st stage larvae of Elaphostrongylus cervi in red deer. Here we’re interested in the presence and absence of larvae in deer as functions of size (length in cm), sex, and farm identity. library(tidyverse) library(NRES803) library(lme4) data(ecervi) head(ecervi) The average number of larvae in a fecal sample is highly skewed to the right – many zeros but also some very large values.

NRES / STAT 803 Week 12

Learning objectives Distinguish between profile and approximate confidence limits on parameters Generate bootstrap confidence limits on predictions Monday Help with Week 11 Lab Nothing to turn in this week. Work on your project. Wednesday NO CLASS – Dr. Tyre giving R seminar in Denver Friday Week 12 Lab instructions, turn it in on Canvas.

Week 12 Lab -- Confidence Intervals in (G)LMM

This week we’ll continue to look at Linear and Generalized linear mixed effects models, emphasizing how to get confidence intervals on the predictions. We’ll start with something easy - a linear mixed effects model with the sleepstudy data. library(tidyverse) library(lme4) ## notice conflicts with tidyr library(broom) library(boot) ssBase <- ggplot(sleepstudy, aes(x = Days, y = Reaction)) + geom_point(aes(color = Subject)) + scale_color_discrete() + labs(x = "Days with no sleep", y = "Reaction time [ms]") ssBase + geom_smooth(method = "lm") + facet_wrap(~Subject) + guides(color = FALSE) So there’s the basic data, and now we fit a mixed model with both the intercept and Days varying across subjects.

NRES / STAT 803 Week 13

Learning objectives Estimate parameters of a non-linear model Distinguish between linear and non-linear models Monday Help with Week 12 Lab Wednesday Three videos to watch. This is the data, in case you want to follow along. What makes it non-linear? Fitting a species area curve Maximizing the likelihood Questions about non-linear models. Friday Week 13 Lab instructions, turn it in on Canvas.

Week 13 - Non-linear models 1

In this exercise you will fit a non-linear model to some data simulated from information in Cousens (1985) paper on wheat yields in competition with barley. Unfortunately Cousens only reported the mean values and the residual sums of squares from the non-linear fits. So I have attempted to simulate data that has (at least approximately) the right means and variances. The script that simulates the data can be downloaded here, and the necessary data files are here and here.