An Interactive ‘Co-Laboratory’ Manual for Undergraduate Statistics using R
What is this thing?
Existing statistics textbooks are very good at two broad tasks: (1) teaching the precise details of statistical theory in a pencil-and-paper kind of way, and (2) teaching the foundations of statistical computing in a precise and detailed kind of way. This is great news if you are either a first- or second-year undergraduate student trying to get a firm grasp on the basics of statistical theory, or a first- or second-year graduate student trying to get a firm grasp on the practical use of statistical software like R or IBM SPSS.
But in-between these two stages of most researchers’ lives is a senior undergraduate research project that presents one’s first real encounter with practical data analysis. These projects are usually undertaken as part of voluntary research assistantships in addition to a full-time course load. Compounding all this work is the very real pressure to perform exceptionally in both arenas in order to secure one of the few coveted spots in the graduate programs of one’s field.
I believe that senior undergraduates try to succeed in both their course work and their voluntary research, not just for the prestige that can come with admission to graduate school, but because they genuinely want to contribute to science and the discovery of new knowledge. This brief manual is for those students who have conquered introductory statistics, but who do not have the bandwidth to tackle 1,000 page statistical computing texts on a self-directed basis. It strives to provide a lightspeed crash course in statistical computing that prepares undergraduate psychology students to run their first real analyses. It provides lots of practical examples with regular opportunities to reflect critically on the procedures being taught. To this end, this manual does not cover every detail of statistical testing in psychological science or any other field. Instead, it presents a handful of practical methods and core competencies for getting started with statistical computing in R. It is best described as a limited introduction to computing classical statistics; a bridge between undergraduate-level theory and graduate-level practice which trusts that readers will seek out much better books as they continue to develop their scientific acumen.
How do I use this?
For each chapter, I provide a Word document (.docx) that you can read and edit as you go. You will find diagrams, examples of working code, and opportunities to write in your responses to different questions that ask you to Explain a procedure, Reflect on a lesson, or complete and Activity.
You will also find an RMarkdown script (.Rmd) that was used to generate the chapter lesson. By downloading this file alongside any comma-separated data files (.csv) and other materials used in the lesson, this script will allow you to explore and recreate the examples used in each chapter (provided that you have downloaded the software R and RStudio). Please note: these codes will work properly only if they are saved inside the same file as the data that go along with them. They are bundled together in zipped files for your convenience.
Credits and License
All codes and graphics presented in this manual were created by W. Spencer Murch (2023), and are licensed under Creative Commons CC BY-NC 4.0. All functions, packages, and data used here are owned by their respective creators. Special thanks are owed to Zakary Draper whose example datasets appear throughout, and who provided revisions on several chapters.
One more thing: this manual is currently being developed for use in the laboratory component of a third-year undergraduate course in Research Methods and Statistics for Psychology. It is in Beta testing, meaning that some errors or typos may become apparent, and some code may not work on all devices. You are among the first people to see this manual. So, if you find any issues, I will be very grateful if you can email me.
With all that said, let’s get started!
Table of Contents
Lesson 1 - Welcome! [Word] [Materials]
Lesson 2 - Introduction to R [Word] [Materials]
Lesson 3 - Data cleaning and visualization using dplyr and ggplot2 [Word] [Materials]
Lesson 4 - Frequency tables, chi squared tests and the odds ratio [Word] [Materials]
Lesson 5 - t-Tests [Word] [Materials]
Lesson 6 - Select topics in correlation and regression [Word] [Materials]
Lesson 7 - One-way ANOVA [Word] [Materials]
Lesson 8 - Factorial ANOVA [Word] [Materials]
Download the full manual as a Word document [HERE]
or as a PDF [HERE]