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_2020.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/7/2020
Lecture: Class intro, Intro to R.
Lab: 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, matrices and lists, markdown intro
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-2020
Homework: Intro to R and Data Frames
9/14/2020
Lecture: Descriptive statistics, and the creation of good observational sampling designs. - Sampling and Simulation for Estimation.
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-2020
Packages for the Week: dplyr - install.packages(c("dplyr", "purrr"))
In Class Code: Code from Lab for dplyr, Code from Lab for simulation from a population, Code from Lab for Bootstrapped SE
Homework: R, Dplyr, and Iteration
9/21/2020
Lecture: More on simulation of sample properties, Data visualization
Lab Topic: Introduction to ggplot2.
Reading: W&S Chapter 2, Unwin 2008, W&G Chapters on Data Vizualization and Graphics for Communication, DC Starting with Data
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-2020
Packages used this Week: ggplot2, ggridges, ggdist - install.packages(c("ggplot2", "ggridges", "palmerpenguins", "ggdist"))
Cheat Sheets: Ggplot2 cheat sheet, Choosing a good chart cheat sheet
In Class Code: Intro to data and ggplot2
Homework: ggplot2 homework
9/28/2020
Lecture: Functions, Data import, libraries, factors and forcats, Tidy data, Joins
Data: Hemlock
Reading: Data organization in spreadsheets, 10 Commandments for Good Data Managament, W&G Chapters on functions, tidy data, Strings, and Dates
Cheat Sheets: Reading data into R.
Packages: install.packages(c("janitor", "skimr", "lubridate", "tidyr", "readr", "readxl", "tibble"))
- readr, readxl, tibble, skimr, janitor, visdat Etherpad: http://etherpad.wikimedia.org/p/607-tidy-2020
In Class Code: functions, loading data, data reshaping, created data
Homework: Functions and Pivot homework
10/5/2020
Lecture: Introduction to Regression: Correlation and Regression, Fit and Precision
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-2020
In Class Code: reproducible examples, lm
Homework: Correlation and Linear Models
10/12/2020
Lecture: Ways of Knowing: NHST and Likelihood with LRT
Lab Topic: Likelihood and linear models, data
Reading: W&S 20, W&G Chapter Iteration
Etherpad: https://etherpad.wikimedia.org/p/607-lm-eval-2020, https://etherpad.wikimedia.org/p/607-mle-2020
In Class Code: linear models with likelihood
Packages for The Week: install.packages(c("MASS", "profileModel", "bbmle", "rsample"))
Homework:inference and likelihood
10/19/2020
10/26/2020
Lecture: Ways of Knowing: Cross-Validation and AIC, Bayesian Data Analaysis, Fitting a line with Bayesian techniques, Bayesian Inference on a Line
Lab Topic: Cross-Validation, Bayes
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-cv-bayes-2020, https://etherpad.wikimedia.org/p/607-bayes-lm-2020
In Class Code: Cross-Validation, Bayesian Demo, Bayesian Linear Model
Homework: CV and some Bayesian Grid sampling
MIDTERM: here
11/2/2020
Lecture: Tidy Tuesday for Election Day, It s All Linear Models; t-test edition
Lab Topic: Comparing Means, Final Proposal Meetings
Reading: Common statistical tests are linear models, W&S Chapters 11-12
Packages for The Week: install.packages(c("car", "emmeans", "multcompView", "contrast"))
Etherpad: https://etherpad.wikimedia.org/p/607-linear_everywhere-2020 In Class Code: comparing two means
11/9/2020
Lecture: Categorical Predictors and ANOVA part 1, part 2
Lab Topic: One-Way ANOVA
Lab Data: Multiple Files
Reading: W&S Chapter 14-15, Cottingham et al. 2005
Packages for The Week: install.packages(c("car", "emmeans", "multcompView", "contrast"))
Etherpad: https://etherpad.wikimedia.org/p/607-anova-2020 In Class Code: lots of anova
11/16/2020
Lectures: Factorial ANOVA, General Linear Model: ANCOVA and MLR
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
Etherpad: https://etherpad.wikimedia.org/p/607-many-predictors-2020
In Class Code: lots of anova
Homework: GLM Homework
11/23/2020
Lecture: Many Predictors Multiple Regression and the General Linear Model, 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
Etherpad: https://etherpad.wikimedia.org/p/607-mlr-2020
Packages for the Week: install.packages(c("AICcmodavg", "MuMIn", "modelr"))
In Class Code: ancova, mlr, and aic
11/30/2020
Lecture: Causal Inference and Experiments, Fundamental Experimental Designs from a Causal Perspective
Reading: A Beastiary of Experimental Designs, Experimental Design Reading Packet
Optional Readings: Non-assigned papers in the packet, The whole Ecology Special Section on P Values is incredible reading.
Etherpad: https://etherpad.wikimedia.org/p/607-experiments-2020
Lab: Discussion of papers (see here for assignments)
12/7/2020
Lecture: Using causal models to get valid inference from observational studies, Design of Observational Studies with Causal Models as a Guide
Reading: Scientist’s guide to developing explanatory statistical models using causal analysis principles, Simplicity and Complexity in Ecological Data Analysis, The Causal Dag and Haunted Terror
Optional Reading: Collider Bias and Covid
Etherpad: https://etherpad.wikimedia.org/p/607-obs-2020
Lab: Discussion of papers
12/14/2020
Lecture: Modeling Error: 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
FINAL PRESENTATIONS Fri. Dec 18th in Lab Slot