Nobody cares about the 34,762 example messages as such
They were measured to learn about chat in general
The honest question is not whether a pattern exists in the sample
It is whether chance is an unconvincing explanation for that pattern
The test starts from the null hypothesis
The null hypothesis says there is no pattern: no link, no gap
How a Test Decides
Assume the null hypothesis is true: no real link or gap
Ask how often a pattern this big would show up anyway, by chance alone
That share is the p-value; a small one makes the null hard to believe
What Every Test Reports
p-value: how likely a pattern at least this big would be if the null hypothesis were true. Below .05 is called statistically significant.
Effect size: how big a difference or a relationship is, on a scale that does not grow with the sample. Example: Cramér’s V near 0 means two categories barely go together.
The p-value says whether chance explains the pattern; the effect size says how big it is
The Variables Choose the Test
Two categorical variables: chi-square
A numeric outcome across two groups: the t-test
A numeric outcome across three or more groups: ANOVA
Two numeric variables: linear regression
Write down the level of measurement of each variable first. The test follows from those two levels
The Variables Choose the Test (cont.)
A test on the wrong kind of data produces a meaningless number
Unsure? Write your choice down, then click the AURA Lab R Companion icon on VS Code’s left edge
Under Test, click Check my test choice
It says whether your choice fits these rules; it does not choose for you
Name the Variables First
In the R Companion panel, under Test, click Settings block (name the test variables), then Run it
It reloads data/twitch_analysis.RDS and keeps six columns under fixed names: outcome, group2, group3, predictor, cat_a, cat_b
Every test block the R Companion writes uses those names, so run this block first
For your own study, change only this block: put your own column after each =
These slides use the original column names; each test block writes the same test with the fixed names
Two Categories: Chi-Square
In the R Companion panel, under Test, Chi-square test with Cramer’s V writes this same test for cat_a and cat_b
Whether a message contained a question mark was associated with whether its channel was gaming, χ²(1, N = 34,762) = 12.00, p < .001, Cramér’s V = .02.
χ²(1, N = 34,762) = 12.00: the statistic, its df, and the number of messages
Cramér’s V = .02: the effect size, with no zero before the point because V never passes 1
Common mistake: leaving out N, or calling the link strong because p is tiny
The Gap and the Doubt
Message length is a number and gaming status has two groups, so the test is the t-test
In the example data, gaming channels averaged 28.49 characters per message, non-gaming channels 33.70
That is a difference of a little over five characters
The doubt about that gap is not idle
Split any group in two at random and the two averages differ
The gap could be real, or it could be ordinary sampling wobble
The histogram cannot tell the two apart, because both produce a gap.
Running the Test
In the R Companion panel, under Test, Welch t-test with Cohen’s d writes this same code with outcome and group2
cohens_d() comes from the effectsize package; v2v keeps the older run_t_test() as a deprecated shortcut, and this is the code you write
analysis %>%filter(!is.na(message_length), !is.na(is_gaming)) %>%group_by(is_gaming) %>%summarize(n =n(),mean =mean(message_length),sd =sd(message_length))t.test(message_length ~ is_gaming, data = analysis)cohens_d(message_length ~ is_gaming, data = analysis)
The Output
# A tibble: 2 × 4
is_gaming n mean sd
<lgl> <int> <dbl> <dbl>
1 FALSE 3457 33.7 60.7
2 TRUE 31305 28.5 38.5
FALSE is non-gaming and TRUE is gaming, in the order R sorts them, so the gap is non-gaming minus gaming: 33.70 minus 28.49, or 5.21
sd is each group’s spread, 60.68 against 38.47; keep those two numbers for the next slide
The Output (cont.)
Welch Two Sample t-test
data: message_length by is_gaming
t = 4.9418, df = 3768.7, p-value = 8.077e-07
alternative hypothesis: true difference in means between group FALSE and group TRUE is not equal to 0
95 percent confidence interval:
3.144345 7.280115
sample estimates:
mean in group FALSE mean in group TRUE
33.70234 28.49011
p-value = 8.077e-07 is scientific notation for 0.0000008077, reported as p < .001
The 95 percent confidence interval says the true gap most likely sits between 3.14 and 7.28 characters
Why Welch, and Not Student
The ordinary (Student) t-test assumes the two groups have equal spread
Week 12 showed standard deviations of 60.68 against 38.47
The Welch version drops that assumption, so it is the safer default
Reading t and df
t = 4.9418 measures the gap in units of its own noise
The sign shows direction only
df is not a round number because Welch computes it from both groups
Reading the p-value
If the two groups truly shared one mean length,
a gap this large would occur in fewer than one sample in a thousand
So the data are surprising under that assumption
A p-value below .05 counts as significant, and this one clears it easily
Chance alone is an unconvincing explanation for the gap. That is the entire content of the p-value.
What the p-value Does Not Say
It is not the probability that the null hypothesis is true
The null is either true or false. The p-value is a statement about the data
It is not the probability that the result is a fluke
It is not a measure of how large the difference is
It is not a measure of how much the difference matters
How Big Is the Difference
For a gap between two means, the effect size is Cohen’s d
It states the gap in units of the natural variation in the data
Cohen’s benchmarks: about 0.2 is small, 0.5 is medium, 0.8 is large (Cohen, 1988)
A d of 0.13 is below small, and the word for it is negligible
The Effect Size in the Output
Cohen's d | 95% CI
------------------------
0.13 | [0.09, 0.16]
- Estimated using pooled SD.
Cohen’s d measures the gap against how much message lengths vary: 0.13, with an interval from 0.09 to 0.16
0.13 does not reach Cohen’s small: negligible
The sign of t and d follows the group order: gaming first, as in the write-up, gives -4.94 and -0.13
Missing values detected. NAs dropped. is a warning, not an error: the unlabeled messages were left out
Why a Negligible Gap Reached Significance
The raw gap is fifteen percent of the non-gaming mean, which does not sound negligible
But d measures that gap against standard deviations of 38 and 61 characters
And the sample held 34,762 messages
A large enough sample detects a difference far too small to care about.
On the Threshold Itself
“Scientific conclusions and business or policy decisions should not be based only on whether a p-value passes a specific threshold.”
Wasserstein & Lazar (2016, p. 131)
A p-value of .049 and one of .051 describe almost identical evidence
Ten tests run without correction produce one false positive on average
Declare your tests and your correction for multiple tests in advance
Exercise: Justify the Alpha
Lakens et al. (2018)
“we propose that researchers should transparently report and justify all choices they make when designing a study, including the alpha level.”
Lakens et al. (2018, p. 168)
A study compares gaming and non-gaming message length and calls p below .05 significant
What one sentence would justify .05 for this study, rather than leaving it as habit?
Retiring the Phrase
“it is time to stop using the term ‘statistically significant’ entirely.”
Wasserstein, Schirm, and Lazar (2019, p. 2)
Write your own result in one sentence without the phrase “statistically significant”
Then write down one thing the sentence lost and one thing it gained
Standard Error and the Interval
Standard error: how much an estimate, such as a group’s mean, would shift from one sample to the next. Example: a mean from a large group has a smaller standard error than one from a small group.
Confidence interval: a range around an estimate, built by a method that captures the true value in a stated share of repeated samples, such as 95 in 100. Example: a group’s mean plus or minus 1.96 standard errors gives its 95% interval.
A 95% interval does not mean a 95% chance that this one interval holds the true value
This code computes each group’s mean and standard error, then turns the standard error into a ninety-five percent confidence interval you can plot.
What the Intervals Show
The two confidence intervals are tiny, and they do not overlap
That is the visual signature of statistical significance
Both points still sit close together, far above zero
That is the negligible effect size made visible
Writing the Result Up
Gaming channels produced shorter chat messages on average than non-gaming channels (28.49 vs. 33.70 characters; n = 31,305 and 3,457), Welch’s t(3768.7) = -4.94, p < .001, Cohen’s d = -0.13.
In the R Companion panel, under Test, APA numbers to check your sentence prints these numbers from your own run
Check your sentence against it
Then Say It Plainly
The two kinds of channel do differ in message length, but so slightly that they are better thought of as alike than as different.
A reader who cannot follow the notation still has to be able to follow the claim
The R Companion’s APA numbers to check your sentence prints the numbers to check; the statistics line, the plain sentence, and the interpretation are yours to write
When p Is Above .05
set.seed(2026)small <- analysis %>%filter(!is.na(is_gaming)) %>%slice_sample(n =30)small %>%count(is_gaming)t.test(message_length ~ is_gaming, data = small)cohens_d(message_length ~ is_gaming, data = small)
The same comparison, on 30 messages drawn at random instead of 34,762
set.seed() makes the random draw the same every time it runs
When p Is Above .05 (cont.)
# A tibble: 2 × 2
is_gaming n
<lgl> <int>
1 FALSE 4
2 TRUE 26
Welch Two Sample t-test
data: message_length by is_gaming
t = -1.7881, df = 27.665, p-value = 0.08473
p = .085 is above .05: this test cannot rule out chance
Four non-gaming messages against 26 gaming ones: the draw is lopsided, and nothing in the test fixes that
When p Is Above .05 (cont.)
Cohen's d | 95% CI
-------------------------
-0.39 | [-1.44, 0.68]
- Estimated using pooled SD.
The sign has even flipped: in this draw gaming messages run longer
d’s interval runs from -1.44 to 0.68, so the data fit a large gap either way, or none
A null result is reported in full, with the means, t, df, p, and d, and never as “no difference”
n1 = 4
n2 = 26
d = 1.558841
sig.level = 0.05
power = 0.8
Leave d out and pwr solves for it: the smallest gap these group sizes detect 80% of the time
Here that is d = 1.56, far past large, so this sample could only have found a huge difference
Task 3.3 of the worksheet runs the same check on your thirty hand-coded messages
Four Groups, Four Means
game category n mean length
Fortnite 4000 33.23
Hearthstone 3004 36.82
Just Chatting 2429 39.03
League of Legends 4000 22.63
A t-test compares two means, and here there are four
Six pairwise t-tests would each carry their own false-positive chance, and those chances pile up
ANOVA
In the R Companion panel, under Test, One-way ANOVA with eta squared writes this same code, with Welch’s version, omega squared, and Tukey’s pairs after it
Mean message length differed across the four game categories (N = 13,433), F(3, 13429) = 92.26, p < .001, η² = .02. Tukey’s HSD showed that five of the six pairs differed; Just Chatting and Hearthstone did not (p = .26).
F(3, 13429): categories minus 1, then messages minus categories
η² = .02: game category accounts for about two percent of the variation
Common mistake: naming which pairs differ from F alone; the Tukey line does that
What Regression Is
Regression: a model that estimates how an outcome variable changes with one or more other variables. Example: predicting message length from the hour of the day.
A Number or a Category
Dummy variable: a category recoded as 0 and 1 so a regression can use it. Example: non-gaming is 0 and gaming is 1.
The outcome is always a number, such as message length
A number as predictor: the slope is the change per one-unit step, such as characters per hour
A category as predictor: R turns it into a dummy, and the slope is the gap between the two group means
A category with k groups takes k - 1 dummies, each compared with one baseline group
In your worksheet and paper, regression takes two numbers; a category goes to the t-test or ANOVA
Regression Re-Derives the t-test
In the R Companion panel, under Test, Linear regression writes lm(outcome ~ predictor), and the Settings block keeps predictor a number (the hour of the day)
Pick linear regression for a number and a category, and Check my test choice says it does not fit
The code below gives lm() the gaming dummy only to show what a t-test is underneath
fit_lm <-lm(message_length ~ is_gaming, data = analysis)summary(fit_lm)standardize_parameters(fit_lm)
Regression Re-Derives the t-test (cont.)
Call:
lm(formula = message_length ~ is_gaming, data = analysis)
Residuals:
Min 1Q Median 3Q Max
-32.70 -21.49 -12.49 6.30 471.51
Call repeats the model you asked for
Residuals summarize how far each message falls from its group’s mean; they are not the part to read
is_gamingTRUE is the dummy (gaming is 1); its slope, -5.21, is exactly the gap the t-test found, written as a baseline plus an adjustment
Pr(>|t|) is each row’s p-value; 1.75e-12 reads as p < .001
Regression Re-Derives the t-test (cont.)
Residual standard error: 41.22 on 34760 degrees of freedom
(505 observations deleted due to missingness)
Multiple R-squared: 0.00143, Adjusted R-squared: 0.001401
F-statistic: 49.79 on 1 and 34760 DF, p-value: 1.747e-12
Multiple R-squared: 0.00143 is the share of the variation the model explains
505 observations deleted are the unlabeled messages
standardize_parameters(), from effectsize, puts the slope in standard deviations of the outcome
-0.13 means gaming messages sit 0.13 standard deviations of message length below non-gaming, close to Cohen’s d (also -0.13), which divides by the within-group spread instead
With a yes/no predictor that is all it means; with a number predictor, as in the worksheet, it is the change per standard deviation of the predictor
One Framework, Three Faces
A t-test is a regression with one dummy variable: two groups
An ANOVA is a regression with k - 1 dummies: three for the four games
Regression is the general form of both
Its t differs from Welch’s because regression pools the two spreads
The coefficient itself is identical
R² is about 0.001, so gaming status accounts for almost none of the variation
All three are the general linear model, wearing three different names.
Residuals
Residual: the gap between a real value and the value the model predicts for it. Example: if the model predicts 29 characters and the message has 400, the residual is 371.
A model’s credibility rests on its residuals; plot(fit_lm) draws four diagnostic plots of the Linear regression block’s model
Residuals against fitted values: checks linearity and equal spread
A Q-Q plot: checks whether the residuals are normally distributed
Leverage: checks whether one point is carrying the result
Whether a Variable Earns Its Place
Whether an added variable earns its place in the model is a model-comparison question
Compare adjusted R², AIC, or a nested F-test, never raw R²
Gaming status, coded 1 for gaming and 0 for non-gaming channels, was associated with message length, b = -5.21, SE = 0.74, t(34760) = -7.06, p < .001, R² = .001.
Coded 1 and 0: gaming status is a dummy variable, so the slope is the gap between the groups
b = -5.21: the slope, in characters; R² = .001: the share of variation it explains
Common mistake: writing that gaming causes shorter messages; a slope describes an association
In the worksheet the predictor is a number, so the slope is characters per hour; the sentence keeps this shape
Discrete or Continuous
Discrete (categorical): each value is a category you count, not a number you average. Example: gaming or non-gaming, or a code from your codebook.
Continuous (numeric): each value is a measured number where an average makes sense. Example: message length in characters.
A code stored as a number is still discrete
Which Test Fits
Outcome
Other variable
Test
Discrete
Discrete
Chi-square, with Cramér’s V
Continuous
Two groups
Welch t-test, with Cohen’s d
Continuous
Three or more groups
One-way ANOVA, with eta squared
Continuous
Continuous
Linear regression, with R²
One variable alone
None
Counts and percents, no test
In your paper, regression takes two numbers. A category goes to the t-test or ANOVA
The White Paper: IMRaD, one citation style used consistently, with effect sizes, confidence intervals, and power statistics
Its Methods carry three transparency markers: data provenance, the reliability report, and the pre-registration disclosure, citing the dated file in your repository
Its Discussion situates the finding in your theoretical literature
The White Paper and Its Poster (cont.)
The poster: appropriately large (48 by 36 inches recommended), landscape, from title to implications
A QR code to your pre-registration or portfolio
Your ninety-second pitch, built from one or two figures
Due Friday, December 18, 11:59 PM: White Paper and conference poster, 200 points: one ZIP file holding the paper PDF, the poster PDF, and your AI-use log, plus the live URL of your site pasted into the submission