Statistical Methods with R
This site holds the teaching materials for a graduate course in statistical methods for the behavioral and social sciences: slides, in-class practice activities, assignments, readings, and datasets, covering fifteen chapters across five units. Anyone is welcome to teach from these materials or work through them independently. Nothing here is tied to a particular semester, institution, or offering, since schedules, deadlines, and grading belong wherever the course is actually being run.
Teach from these materials freely: assign the chapters, point your students at the slides, and build your own schedule, activities, and grading around them. Linking to a page here needs no permission at all.
Answer keys, practice solutions, and grading rubrics are deliberately not published, since students can read this site as easily as you can. If you are teaching a course and want them, email from your institutional address with a short note about the course.
These materials are licensed CC BY-NC-ND 4.0, which means you can link to them and teach from them, with credit. Please do not republish them under your own name, whether edited or verbatim, and do not sell them or fold them into paid training. If you need a change (a fix, a different dataset, a slide that would work better reordered), email me and I will consider making it here, where everyone gets it.
About the Course
A graduate introduction to statistical methods for the behavioral and social sciences, taught entirely in R.
The course opens with the R ecosystem itself: projects, Quarto, and the data wrangling and exploration needed to get real data ready to analyze. It then builds up statistical inference from sampling and estimation through hypothesis testing, correlation, t-tests, and one-way ANOVA. The largest part of the course develops the general linear model: simple and multiple regression, categorical predictors and dummy coding, interaction effects for testing moderation, and polynomial and spline regression for curvilinear relationships. From there it turns to what to do when a model’s assumptions do not hold: diagnostics, the bootstrap and other robust methods, and missing data. It closes with measurement reliability, power analysis, and how to report and critically review a linear model analysis.
Some of that material is outlined but not yet written, and is marked coming soon wherever it appears: piecewise and spline regression, bootstrap and robust inference, missing data, reliability and measurement error, and reviewing statistical claims. Each chapter page shows what its lectures will cover.
Throughout, the emphasis is on estimating and interpreting effects rather than on hypothesis testing alone, and on writing code you could hand to someone else.
The material assumes a prior introductory statistics course, but starts from the beginning with R itself and expects no programming experience.
Learning Outcomes
By the end of the material, students should be able to:
- Describe the parts of the R ecosystem used in the course
- Understand and apply R code for basic programming tasks
- Accomplish basic data wrangling and exploration tasks in R
- Summarize the main roles that statistics play in psychology
- Discuss the logic of estimation and hypothesis testing
- Estimate group comparisons and variable associations
- Design, conduct, and interpret an effect size analysis
- Discuss the logic and steps of the general linear model
- Regress continuous outcomes on any predictor variables
- Apply interaction effects to test moderation hypotheses
- Design, conduct, and interpret a linear model analysis
- Model curvilinear relationships with polynomial regression
- Fit and interpret piecewise and spline regressions (coming soon)
- Discuss, diagnose, and address violated model assumptions
- Estimate uncertainty by bootstrapping and resampling (coming soon)
- Address missing data with multiple imputation or FIML (coming soon)
- Evaluate the reliability of measures and its cost to power (coming soon)
- Conduct an a priori power analysis to determine sample size
- Report and review the results of a linear model analysis
Readings
There is no required textbook. The lectures are meant to stand on their own, and each chapter page lists its own readings, linking straight to the source whenever that source is open access.
The four books below are for readers who want to go further than a lecture does. Chapter pages point at specific sections of them where they are relevant, but none of the four is required.
Freely available online
- R for Data Science (2nd ed.) by Hadley Wickham, Mine Çetinkaya-Rundel, and Garrett Grolemund. Goes deeper on the tidyverse tools introduced in Unit A.
- Learning Statistics with R by Danielle Navarro. A slower, book-length treatment of the inference material in Unit B.
Available for purchase
- Applied Multiple Regression/Correlation Analysis for the Behavioral Sciences (3rd ed.) by Jacob Cohen, Patricia Cohen, Stephen G. West, and Leona S. Aiken. Routledge, 2013. The standard reference for the linear model material in Unit C.
- Beyond Significance Testing: Statistics Reform in the Behavioral Sciences (2nd ed.) by Rex B. Kline. American Psychological Association, 2015. Makes the case for the estimation-first emphasis this course takes.