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.
F = Fieberg, R4DS = Wickham et al., U/P for linked pdfs = biol607
Change .html to .Rmd in your browser to get the markdown of all lectures, etc.
Recorded Lecture: All lectures and labs will be recorded and are available at https://www.youtube.com/playlist?list=PLZRMqMK8aRmIMuiEX-QVxLNk2o6SlRa-m
Turning in Homework: All homework should be completed using RMarkdown or Quarto. You’ll freely mix answers in text and code there. Use projects. Please zip up the full project folder for each to submit so that we have the .rmd (or .qmd), .html output, data, etc. and can recompile your homework if we need to. An ideal project structure would be something like this:
homework_X/
|— markdown
|— scripts
|— data
directory structure, so that all data is in data/
.
Please zip up the archive for the homework and standardize
filenames as follows:
number_lastName_firstName_2023.zip
where number is
the week number the homework is due (from weeks below) 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, use the dropbox link you were sent by the TA.
9/4/2023
Lecture: Class
intro, Intro to R.
Lab: Matrices, Lists and Data
Frames. Introduction to
Markdown
Reading: R4DS Intro, Workflow basics, Scripts and Projects,
Code Style, Vectors, and Quarto
Further Exploration: Quarto Formats, https://quarto.org/ for
everything!
Cheat Sheets: Quarto Cheat
Sheet
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-2023
Homework: Intro to
R and Data Frames
9/11/2023
Lecture: Data visualization
Lab Topic: Introduction to
ggplot2.
Reading: R4DS Chapters on Data Vizualization, Layers of Plots, and Graphics for
Communication, Introducing
Palmer Penguins
Further Exploration: Friendly
2008 on History of Data Viz, Unwin
2008, DC
Starting with Data, Fundamentals of Data
Visualization - note, this is a whole book, but scan it - it’s
amazing
Etherpad: https://etherpad.wikimedia.org/p/dataviz-2023
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
Homework: ggplot2
homework
9/18/2023
Lecture/Lab: Data
import, using libraries, Pipes,
data manipulation, summarization, and making it tidy
Data: Portal Data -
and learn more here
Reading: Data organization in
spreadsheets, R4DS Chapters on data import, pipes,
data
transformation, tidy
data
Optional Reading: 10
Commandments for Good Data Managament, Managing
Data Frames with the Dplyr package, Strings, factors, and Dates
Cheat Sheets: Reading
data into R, Dplyr
cheat sheet.
Packages:
install.packages(c("dplyr", "janitor", "skimr", "lubridate", "tidyr", "readr", "readxl", "tibble"))
- readr, readxl, tibble, skimr, janitor, visdat
Etherpad: http://etherpad.wikimedia.org/p/607-tidy-2023
Homework: Data
Manipulation and Pivot homework
9/25/2023
Lecture: What is a Sample? and Sampling Distribution.
Lab Topic: Sampling and
simulation.
Reading: Cumming
et al. 2007 on SDs, SEs, and CIs
Etherpad: https://etherpad.wikimedia.org/p/sampling-2023
Packages for the Week: dplyr -
install.packages(c("dplyr", "purrr"))
Homework: Sampling, Simulation,
and Tidy Tuesday
10/2/2023
Lecture: Introduction to Regression: Correlation and Regression,
Fit and
Precision
Lab Topic: Linear regression,
diagnostics, visualization, and data
Reading: Fieberg
linear regression review, R4DS on model basics
Etherpad: https://etherpad.wikimedia.org/p/607-lm-2023
Homework: Correlation and Linear
Models
10/9/2023
Lecture: Many
Predictors, Categorical Predictors: Just
Another Linear Model
Lab Topic: Models with Categorical
Variables
Lab Data: Multiple Files
Reading: Feiberg
3, Common
statistical tests are linear models, Feiberg
ch 6
Optional Reading: Analysis
of variance with unbalanced data: an update for ecology &
evolution, Day and
Quinn 1989 on Post-hocs.
Packages for The Week:
install.packages(c("car", "emmeans", "multcompView", "contrast", "visreg"))
Etherpad: https://etherpad.wikimedia.org/p/607-many-predictors-2023
Homework: None. Catch up!
10/16/2023
Lectures: Many categories or
mixing categories and continuous predictors, When one predictor’s effect depends
on the other
Lab Topic: Models with many types of
predictors - and interactions!
Lab Data: Multiple
Files
Reading: Feiberg
ch 6, Simple means to
improve the interpretability of regression coefficients, Understanding
‘it depends’ in ecology: a guide to hypothesising, visualising and
interpreting statistical interactions
Optional Readings: Interactions
in statistical models: Three things to know, Centring in regression
analyses: a strategy to prevent errors in statistical
inference
Etherpad: https://etherpad.wikimedia.org/p/607-complex-linear-models-2023
Homework: Complex linear
models
Project Proposal: general instructions here
10/23/2023
Lecture: Generalized Linear
Models, Fitting, Count
Data, and Overdispersion
Data: GLS
Data, GLM Data
Lab Topic: Generalized
Linear Models
Packages for the Week:
install.packages(c("MASS", "readxl", "betareg", "DHARMa", "TMB", "glmmTMB"))
Reading: Feiberg
on Generalized Linear Models, Models
for Count Data, Feiberg
on Logistic Regression - ignore Bayes parts in these. Hartig
DHARMa vignette, Analyzing
% Cover and Porportional Data
Additional Reading: Maximum
Likelihood, O’Hara
and Kotze 2010, Wharton
and Hui 2011, Ver
Hoef and Boveng 2007 on NB v. Quasi, Intro to Beta Regression
for % Cover Data, Zero-One
Inflated Beta Regression, Feiberg
on GLS
Etherpad: https://etherpad.wikimedia.org/p/607-glm-2023
Homework: Surviving the
Titanic
10/30/2023
Lecture: Random
Effects, Mixed Models
Data: TBA
Lab Topic: Mixed
Models
Packages for the Week:
install.packages(c("glmmTMB", "lme4", "merTools", "broom.mixed))
Reading: Linear
Mixed Effects Models, Generalized
Linear Mixed Effects Models
Additional Reading: Generalized
linear mixed models: a practical guide for ecology and evolution, Gelman
and Hill Ch 12 login/pass biol609, Zuur
ch. 9. Your One Stop FAQ: Your One Stop FAQ:
Ben Bolker’s Mixed Model’s FAQ, optimizer
tips
Etherpad: https://etherpad.wikimedia.org/p/607-mixed-2023
MIDTERM: Due Tues Nov 17th, 5pm. Get it here
11/6/2023
Lecture: Causal
Inference
Lab: Daggity and Causal
Models
Reading: Arif
et al. on Structural Causal Models, Fieberg on
Causal Models.
Optional Reading: An Intro to
the PO Framework from The Causal Mixtape, Grace and Irvine on designing SCMs,
Does
Water Kill?
Etherpad: https://etherpad.wikimedia.org/p/607-causal-2023
11/13/2023
Lecture: Causal Inference and
Experiments, Using
causal models to get valid inference from observational and
quasi-experimental studies
Paper Discussion: Thursday discussion of papers - see here
for assignments
Reading: Kimmel et al. on Experimental
Design, The Causal Dag and
Haunted Terror, Butsic et
al 2021 on Quasi-Experiments,
Optional Reading: A Beastiary of
Experimental Designs, Bellemare et al. on Front
Doors
Etherpad: https://etherpad.wikimedia.org/p/607-causal-expts-2023
11/20/2023
Thanksgiving Week. Paper Discussion:
Discussion of papers - see here
for assignments
Optional Reading: Collider Bias and
Covid
Etherpad: https://etherpad.wikimedia.org/p/607-obs-2023
11/27/2023
Lecture: Ways of Knowing: NHT, NHT and testing models, Power Analysis
Lab Topic: Null Hypothesis
Testing, Power
Analysis
Data for Lab: mole rats, intertidal algae, cryptosporidium infection, Keeley et al. data
Reading: W&S 20, Muff et al. 2022 on p-values,
Feiberg
on Maximum Likelihood
Etherpad: https://etherpad.wikimedia.org/p/607-nht-eval-2023
Packages for The Week:
install.packages(c("car", "MASS", "profileModel"))
12/4/2023
Lecture: Ways of Knowing: Cross-Validation and
AIC
Lab Topic: Cross-Validation and AIC
Reading: AIC
in Behavioral Ecology, Fieberg on
Modeling Strategies, Aho et al. 2014 on
BIC
Optional Reading: Ellison
1996
Optional Books: Model
Selection and Multimodel Inference Packages for The
Week: install.packages(c("AICcmodavg")
Etherpad: https://etherpad.wikimedia.org/p/607-cv-2023
12/11/2023
Project work and Project Presentations on Dec 15th