While the topics covered are broad, each week will feature different examples from genetics, ecology, molecular, and evolutionary biology highlighting uses of each individual set of techniques.

W&S = Whitlock and Schluter, W&G = Wickham and Grolemund, U/P for linked pdfs = biol607

Change .html to .Rmd in your browser to get the markdown

**Turning in Homework**: All homework should be completed using RMarkdown. You’ll freely mix answers in text and code there. Please submit both the .Rmd and .html output of your homework. If there are data files associated with your homework, when working on it, please make sure you are using the

homework/

|— markdown

|— data

directory structure, so that all data is in `../data/`

relative to where your homework markdown and outputs are. Please standardize filenames as follows: `number_lastName_firstName_2018.Rmd`

where number is the homework number (you’ll see it in the homework assignment’s filename - and make sure to include the 0s for numbers like 01), and your last and first names - well, you should know them!

To submit homework, go to https://www.dropbox.com/request/MgLy0OxePC4QN8ZDgQ0X and upload the files.

9/3/2018

**Lecture:** How do we use data to understand how the world works?

**Lab:** Intro to R. Matrices, Lists and Data Frames. Introduction to Markdown

**Reading:** W&G Preface, Intro, Workflow basics, Vectors, and Markdown Chapters **Cheat Sheets:** RMarkdown Cheat Sheet, RMarkdown Options Guide

**In Class Code:** Code from Lab

**Install R:** Go to https://cloud.r-project.org/ and get the right version of R for you. Then, go to https://www.rstudio.com/products/rstudio/download/#download and install Rstudio.

**Etherpad:** https://etherpad.wikimedia.org/p/607-intro-2018

9/10/2018

**Lecture:** Sampling and Simulation for Estimation. Descriptive statistics, and the creation of good observational sampling designs.

**Lab Topic:** Sampling and simulation. Libraries in R. Dplyr.

**Reading:** W&S 1,3-4, W&G Chapters on data transformation and pipes, Dplyr cheat sheet

**Optional Reading:** Cumming et al. 2007 on SDs, SEs, and CIs, Simpler Coding with Pipes, Managing Data Frames with the Dplyr package

**Etherpad:** https://etherpad.wikimedia.org/p/sampling-2018

**Packages for the Week:** dplyr - `install.packages("dplyr")`

**In Class Code:** Code from Lab

**Homework:** R, Dplyr, and Sampling

9/17/2018

**Lecture:** Data visualization, Data Creation

**Lab Topic:** Data import, libraries, factors and forcats and Introduction to ggplot2. Data for lab here.

**Reading:** W&S Chapter 2, Unwin 2008, W&G Chapters on Data Vizualization and Graphics for Communication, DC Starting with Data, Data organization in spreadsheets

**Optional Reading:** Friendly 2008 on History of Data Viz, Fundamentals of Data Visualization - note, this is a whole book, but scan it - it’s amazing

**Etherpad:** https://etherpad.wikimedia.org/p/dataviz-2018

**Packages used this Week:** ggplot2, ggridges, forcats, readr, readxl, tibble, lubridate - `install.packages(c("ggplot2", "ggridges", "forcats", "readr", "readxl", "tibble", "lubridate"))`

**Cheat Sheets:** Reading data into R. Ggplot2 cheat sheet, Choosing a good chart cheat sheet

**In Class Code:** Intro to data and ggplot2

**Homework:** ggplot2 homework

9/24/2018

**Lecture:** Frequentist Hypothesis Testing, NHST, Z-Tests, and Power

**Lab Topic:** Distributions in R, Frequentist Hypothesis testing via simulation

**Reading:** W&S 5-7, W&G Chapter 7, 16, Abraham Lincoln and Confidence Intervals and links therein

**Etherpad:** https://etherpad.wikimedia.org/p/607-hypotheses-2018

**Quiz:** http://tinyurl.com/hyp-pre-quiz

**In Class Code:** Distributions and Power

**Homework:** hypothesis testing and power

10/1/2018

**Lecture:** T tests, χ2 tests, and p

**Lab Topic:** Statistical analysis functions for t and \(\chi^2\) in R, data

**Reading:** W&S 8-12, W&G Chapter 10, 20

**Discussion Reading:** ASA Statement on P-Values, And choose one of the accompanying rejoinders (sign up in here) (also feel free to read them all)

**Additional Readings on P-Values**: Peaceful negotiation in the face of so-called ‘methodological terrorism’, P-value madness: A puzzle about the latest test ban (or ‘don’t ask, don’t tell’), The Paradox of Replication, and the vindication of the P-value (but she can go deeper)

**Etherpad**: https://etherpad.wikimedia.org/p/607-t_tests-2018

**In Class Code:** t and chi square

**Homework:** Chi Square and T Tests

10/8/2018

**Lecture:** Least Squares Linear Regression: Correlation and Regression, Fit and Power

**Lab Topic:** Linear regression, diagnostics, visualization, and data

**Reading:** W&S 16-17, W&G on model basics, model building

**Etherpad:** https://etherpad.wikimedia.org/p/607-lm-2018

**In Class Code:** lm

**Homework:** Correlation and Linear Models

10/15/2018

**Lecture:** Likelihood, Fitting a line with Likelihood

**Lab Topic:** Likelihood and linear models, data

**Reading:** W&S 20, W&G Chapter Iteration

**Etherpad:** https://etherpad.wikimedia.org/p/607-likelihood-2018

**In Class Code:** linear models with likelihood

**Packages for The Week:** `install.packages(c("MASS", "profileModel", "bbmle"))`

**Homework:**pufferfish and likelihood

10/22/2018

**Lecture:** Bayesian Inference, Fitting a line with Bayesian techniques

**Lab Topic:** Bayesian computation in R, Fitting a line with Bayesian techniques

**Reading:** Ellison 1996, Statistical Rethinking Chapter 1 and Chapter 2, R Users will Now Inevitably Become Bayesians, bayesplot cheat sheet

**Additional Reading**: how to choose a prior, bayesian t-tests, regression models with brms, rethinking with brms (many very cool examples), brms tutorials, How to use rstanarm, Linear Models in rstanarm, Bayesian basics with R

**Packages for The Week:** `install.packages(c("brms", "rstanarm", "arm", "rethinking"))`

and `devtools::install_github("mjskay/tidybayes")`

**Etherpad:** https://etherpad.wikimedia.org/p/607-bayes-2018

**In Class Code:** Bayesian Data Analysis

10/29/2018

**Lecture:** Joins, Tidy data

**Data:** Hemlock

**Reading:** 10 Commandments for Good Data Managament, W&G Chapters on tidy data, Strings, and Dates

**Packages:** `install.packages(c("reprex", "datapasta", "lubridate", "tidyr"))`

**Etherpad:** http://etherpad.wikimedia.org/p/607-tidy-2018

**In Class Code:** Tidy, markdown options

11/5/2018

**Lecture:** Experimental design and ANOVA part 1, part 2, Cottingham discussion

**Lab Topic:** One-Way ANOVA, Midterm work session

**Lab Data:** Multiple Files

**Reading:** W&S Chapter 14-15, Cottingham et al. 2005

**Optional Reading:** Ecological applications of multilevel analysis of variance with appendices

**Packages for The Week:** `install.packages(c("car", "emmeans", "multcompView", "contrast"))`

**Etherpad:** https://etherpad.wikimedia.org/p/607-anova-2018 **In Class Code:** lots of anova

11/12/2018

**Lectures:** Experimental Design in a Multicausal World - Multiway ANOVA, Factorial ANOVA

**Lab Topic:** Discussion of Hurlbert, Cottingham, Factorial ANOVA

**Lab Data:** Multiple Files

**Reading:** W&S 18, Hurlbert 1984

**Optional Reading:** Analysis of variance with unbalanced data: an update for ecology & evolution

**In Class Code:** lots of anova

11/19/2018

**Lecture:** The General Linear Model: ANCOVA, Multiple Regression, and Interaction Effects, Information Theoretic Approaches

**Lab Topic:** Multiple Regression, Multimodel Inference - data files

**Readings:** Symonds and Moussalli 2010, Simple means to improve the interpretability of regression coefficients, Experimental strategies to assess the biological ramifications of multiple drivers of global ocean change

**Optional Readings:** Centring in regression analyses: a strategy to prevent errors in statistical inference, Model selection for ecologists: the worldviews of AIC and BIC, The whole Ecology Special Section on P Values is incredible reading.

**Etherpad:** https://etherpad.wikimedia.org/p/607-mlr-2018

**Packages for the Week:** `install.packages(c("AICcmodavg", "MuMIn", "modelr"))`

**In Class Code:** ancova, mlr, and aic

11/26/2018

**Lecture:** Generalized Least Squares and Heteroscedasticity, Entering a non-normal world - Modeling count data with Genearlized linear models.

**Data:** GLS Data, GLM Data

**Lab Topic:** Generalized Linear Models

**Packages for the Week:** `install.packages(c("MASS", "readxl", "betareg", "DHARMa"))`

**Reading:** O’Hara 2009 through section on GLMs, O’Hara and Kotze 2010, Wharton and Hui 2011, Hartig DHARMa vignette

12/3/2018

**Lecture:** Iteration with purrr, Class’s Choice

**Data:** gapminder

**Reading:** Murtaugh 2007, iteration in R4DS, functionals in adv-r

**Cheat Sheets:** Apply Functions with purrr Cheat Sheet

**Lab Topic:** Class’s Choice, Final Presentation Open Lab

**In Class Code**: spread and gather

12/10/2018

**Lecture:** Final Presentations