Skip to main content

Common Statistical Tests

Author

Bill Perry

A reference guide to the R code we use in class — each page is a worked example. These lists are generated automatically from each page’s YAML frontmatter (topic_number:/order:, week:, description:); nothing here is hand-typed.

Click a topic to open its walkthrough. Every vignette page has a “📥 Download the R script” button at the top, so you can view the write-up and grab the runnable .R file directly.

Common Code

General-purpose R and data-science skills used throughout the course, in the order we cover them.

Common Code Topic What it covers
Common Code 01 — Libraries Every R package used in the course, grouped by purpose, with a one-time install script so you never re-run install.packages() by accident.
Common Code 02 — Reading and Writing Files Read and write CSV and Excel files, clean names with janitor, and save a tidy copy — the full raw-to-clean pipeline in one script.
Common Code 03 — Basic ggplot2 The basics of using ggplot
Common Code 04 — Filter and Select how to clean up rows and columns of data
Common Code 05 — mutate() how to do math and add columns based on calculations or mutations
Common Code 06 — Pivoting Data how to switch from wide to long and long to wide data
Common Code 07 — Advanced Plotting More advanced plotting with ggplot
Common Code 08 — Custom ggplot2 Themes How to use and resuse themes for cleaning up graphs
Common Code 09 — Descriptive Statistics Descriptive statistics 3 ways
Common Code 10 — Joining Data Frames How to join dataframes into a new one
Common Code 11 — Dates with lubridate How to work with dates
Common Code 12 — Strings and Factors How to arrange and work with factors
Common Code 13 — Writing Functions Making functions or your own short commands
Common Code 14 — Iteration with purrr How to redo things over and over
Common Code 15 — Quarto Document Basics Markdown programming the easy way
No matching items

Statistical Tests

Worked examples of the statistical tests we use in class, ordered from simplest to most complex.

Statistical Test Topic
T-Tests: One, Two, and Paired Parametric t-tests
Non-Parametric Two-Group Tests Mann-Whitney U, Wilcoxon signed-rank, permutation
Correlation Pearson and Spearman correlation
Simple Linear Regression Regression with one predictor
Multiple Regression Regression with several predictors
One-Way ANOVA One-way ANOVA and Kruskal-Wallis
Two-Way (Factorial) ANOVA Two factors and their interaction
Generalized Linear Models Poisson, negative binomial, and logistic regression
Linear Mixed Models Random intercepts for nested data
Mixed Model Structures Random slopes and variance-covariance structures
Mixed Models Under the Hood Where the variance components and p-values come from
ANCOVA Analysis of covariance
Principal Component Analysis PCA
No matching items