10 points — graded
This is a preview, run before we've covered anything formally. You are not expected to know what most of these numbers mean yet — that's the point. The goal is to see a real research question answered start to finish, so that the next several weeks of descriptives, distributions, and sampling have an obvious reason to exist. We'll come back to this exact dataset, formally, in Chapter 15.
One dataset, one line of code, nothing to download or upload:
This is a fictional classroom survey. Forty students, several things measured about each one. We're going to ask it three different questions.
Twenty of the forty students studied the same vocabulary list for five minutes in silence. The other twenty studied it with café-style background chatter playing. Everyone was then tested on how many words they could recall.
Does studying with background chatter hurt recall?
Look at the two boxes. One group sits visibly higher than the other, with only a little overlap. Before we run anything, that plot is already suggesting an answer — we're about to check whether the data backs it up.
Six numbers to know how to find, even before you know exactly why each one looks the way it does:
| What | Value | For now, just know... |
|---|---|---|
| t | −4.657 | A bigger distance from zero (either direction) means a bigger gap between the groups, relative to how noisy the data are. |
| df | 37.99 | Comes from your sample size. We'll unpack exactly how in a few weeks. |
| p | 3.85e-05 (0.0000385) | The smaller this is, the less plausible it is that a gap this big happened by chance alone. |
| Means | Chatter 10.40, Silence 14.55 | The group averages — what the plot was showing you visually. |
| SDs | Chatter 2.80, Silence 2.84 | How spread out each group's scores are around its mean. |
| Cohen's d | 1.47 | The size of the effect — how many standard deviations apart the two groups' averages are. p tells you "probably real"; d tells you "how big." We always report both, not just whichever one looks better. |
p here is tiny — far smaller than the usual .05 cutoff you'll hear about soon. That's what "statistically significant" means: this result is a candidate for "probably not just chance."
Same dataset, two different column pairs. For each one: predict first, then run the code and see if the data agrees.
The same students also reported how many hours they slept the night before, and whether they're left- or right-handed.
The code below has two blanks. Fill them in using the pattern from Step 1–2 before you run it:
Twenty of the students sat in the front of the classroom all semester, twenty sat in the back. At the final, everyone rated their test anxiety from 1–10.
Does where you sit predict how anxious you feel at test time?
No starter code this time. Using the pattern from Questions 1 and 2, write R code to:
anxiety_score by seat_locationanxiety_score for each seat_location groupanxiety_score by seat_locationFill in the row for Question 2 and Question 3 yourself, then look at the pattern:
| Question | t | df | p | Verdict |
|---|---|---|---|---|
| Recall (chatter vs. silence) | −4.657 | 37.99 | 0.0000385 | Clearly significant |
| Sleep (handedness) | Fill in this row in your answer document | |||
| Anxiety (seat location) | Fill in this row in your answer document | |||
Notice too that p and Cohen's d don't have to tell the same story: a tiny effect can still hit significance with enough data, and a real effect can miss it with too little. That's exactly why we report effect size regardless of whether p is significant — "significant" and "big" are two different questions.
It's not magic — two formulas, using numbers you already have. The one new piece for t is SE, "standard error." Here's the idea: SE is a measure of how much you'd expect a group's mean to bounce around if you ran this study again and again with a new batch of 20 students each time. It's built from two things you already have: how spread out each group's scores are (SD) and how many people are in each group (n) — more spread means more bounce, more people means less. For the recall question:
Same number R gave us. The whole test is really just: how big is the gap between the groups, compared to how much the groups' means naturally jitter from sample to sample?
Cohen's d asks a related but different question — not "how big is the gap compared to sampling jitter," but "how big is the gap compared to how spread out scores normally are within a group":
Same means you already had, divided by a version of SD that blends both groups together. t and d are close cousins — both compare the gap between means to some measure of spread — but t divides by SE (which shrinks as sample size grows) while d divides by SD (which doesn't). That's why a study can gain a bigger t just by adding more people, without the effect itself getting any bigger — exactly the "significant vs. big" distinction from Step 5. Everything we cover for the next several weeks — populations vs. samples, why we look at spread, where df comes from — exists to make these formulas precise and trustworthy.
We didn't check any assumptions before running these tests. We didn't ask whether 20 students per group is "enough." We didn't talk about what a sample is standing in for, or why SD is the number we chose to measure spread. All of that is coming — this was just enough of a look at the destination to make the trip worth taking.
You haven't read Chapter 15 yet, but it's already sitting in the book, and it covers two things this activity deliberately skipped: how to judge the size of a Cohen's d value, and how to read the confidence interval R printed but we didn't touch.