Lizards in sun vs. shade, frogs in parks vs. wetlands, blackbirds before vs. after a hormone implant. Each time, two groups have different averages. The t-test tells you whether that gap is bigger than you'd expect from ordinary variation alone.
How to use this page
Work through the tabs in order. Each tab matches a section of your Canvas questions. Two buttons in the bottom corner stay with you everywhere: the Calculator (so you don't need a separate one) and the t-table. Answer boxes check themselves as you type.
1Which t-test do I need?
A t-test asks: "Are the means of two groups statistically different from each other?" Before you calculate anything, you have to know how your two groups are related.
Independent samples t-test
Compares two separate groups of different individuals. Each individual appears in only one group.
Lizards from grassland vs. lizards from forest. Treated cells vs. untreated cells.
Paired samples t-test
Compares the same individuals measured twice (before/after, or under two conditions). You test the difference within each individual.
The same 13 blackbirds before and after a testosterone implant.
Quick sort: independent or paired? 0 / 6
Ask yourself: could I draw a line connecting each measurement in group 1 to one specific measurement in group 2?
Choose the right test, one question at a time
This follows the "2-Sample Comparison" flowchart from lecture. Answer the questions and the page tells you which test to run.
The six steps of every t-test
State the hypotheses. H₀: μ₁ = μ₂ (no difference). HA: μ₁ ≠ μ₂ (there is a difference).
Choose a significance level (α), usually 0.05.
Calculate the t-statistic.
Determine the p-value (or compare t to the critical value from the table).
Compare p to α and draw a conclusion. p ≤ α → reject H₀. p > α → fail to reject H₀.
If p is close to α, check the effect size to see how big the difference really is.
Try this
Finish the quick sort. Which clue in the study description told you a design was paired?
Use the flowchart for the lecture's horned lizard study: 30 lizards killed by shrikes vs. 154 different living lizards, data look normal, Levene's test p = 0.15. Which test does it give you?
2Signal vs. noise: what the t-statistic measures
The t-statistic is a ratio. The top is the signal: how far apart the two means are. The bottom is the noise: how much those means would wobble by chance (the standard error). A big t means the gap is many standard errors wide.
t =x̄₁ − x̄₂√( s₁²/n₁ + s₂²/n₂ )
signal (difference in means) ÷ noise (standard error, SE)
Move the groups and watch t
Two groups of beetles, body length in mm. The curves show where individual beetles fall in each group.
Group 1 (moves with the slider)Group 2 (x̄₂ = 10 mm)
t-statistic–
df = n₁ + n₂ − 2–
t-critical (α = 0.05, two-tailed)–
p-value–
Bigger difference → bigger t. The signal grows, so the means are more standard errors apart.
More spread → smaller t. Noisy data make the same gap less convincing.
Bigger n → bigger t. Averages from big samples wobble less, so the SE shrinks.
Shaded red tails = rejection region. If t lands in the red, p < α and you reject H₀.
Lecture example: horned lizards. Spike length of lizards killed by shrikes (x̄ = 21.99 mm, s = 2.71, n = 30) vs. living lizards (x̄ = 24.28 mm, s = 2.63, n = 154). The difference of 2.29 mm works out to about 4.3 standard errors, far into the rejection region, so p < 0.001 and we reject H₀. Significant, but is it important? That's Tab 7.
Try this
Set difference = 1.0 mm, spread = 2.0 mm, n = 8. Is the result significant? Now raise n to 40 without changing anything else. What happened to t and p?
Put n back to 8. Find a spread that makes a 2.0 mm difference significant. What does this tell you about noisy data?
3Worked example: lizard tail lengths
A field biologist studies whether habitat affects tail length in western fence lizards (Sceloporus occidentalis). She measures tail length (cm) of 8 lizards from sunny grassland and 8 different lizards from shaded forest. Is there a significant difference at α = 0.05?
Data
Hypotheses
H₀: There is no significant difference in tail length between lizards in sunny grassland and shaded forest.
HA: There is a significant difference in tail length between lizards in the two habitats.
α = 0.05, two-tailed
Try this
Before opening Step 2, look at the data. Which habitat looks more spread out? Check your guess against the two variances.
Open Step 5 and click the highlighted cell in the t-table. Why do we use the df = 14 row?
4Your turn: frog body mass
A herpetologist suspects that Pacific tree frogs (Pseudacris regilla) in urban parks weigh less than frogs in rural wetlands, possibly because of food availability and stress. She weighs 8 frogs (g) from each habitat. Test whether body mass differs between the two populations at α = 0.05.
Work each step yourself. You can type a plain number or a whole calculation into any answer box, like sqrt(0.3827/8 + 0.2855/8), then press Enter. The Calculator button works too. Boxes turn green when you're right. If you get stuck, each step has a Show the answer button. If you change the data, every answer is checked against your numbers.
The data
Try this
Complete Steps 1–7. Use the "Fill in the deviations for me" button only after you've tried at least two rows by hand.
Your t is negative. Does that mean anything biologically? (Hint: what happens to the sign if you swap which group is Group 1?)
5Equal variance? Student's vs. Welch's t-test
The independent t-test has two assumptions to check first: each group's data should be roughly normal, and the two groups should have similar spread (homogeneity of variance, "similarity in variation in a dataset").
Student's t-test (pooled, equal variance)
Assumes both groups have the same variance. df = n₁ + n₂ − 2. This is the test in the worked example and the frog problem.
Welch's t-test (unequal variance)
Does not assume equal variances. It adjusts the df downward when spreads differ, which makes it more cautious and more reliable.
Pull the spreads apart
Both groups have the same mean difference (8 units). Change their spreads and sizes and compare the two tests.
Group 1 (mean 100)Group 2 (mean 108)
Variance ratio (larger ÷ smaller)–
How do you know? Levene's test
Levene's test checks whether the groups have the same variance in the population. It has its own hypotheses:
H₀: the groups have equal variances.
H₁: the groups have different variances.
Levene p > 0.05: no evidence the variances differ. Use Student's t-test.
Levene p ≤ 0.05: the variances differ. Use Welch's t-test.
In jamovi: Independent Samples T-Test → tick Homogeneity test and Normality test under Assumption Checks. If Levene's test is significant, tick Welch's under Tests. The Data Lab tab runs Levene's test on any data you enter.
Try this
Set both spreads to 10 and both n to 30. How different are the Student's and Welch's results?
Now set s₁ = 5, s₂ = 15, n₁ = 30, n₂ = 8. What happens to Welch's df? Do the two tests reach the same decision?
6Paired t-test: red-winged blackbirds
High testosterone can help attract mates, but too much may weaken immunity. Researchers measured antibody production (ln[mOD/min]) in 13 male red-winged blackbirds before and after a testosterone implant. Did antibody production change? α = 0.05, two-tailed.
Data and differences
Each line is one bird
There's a lot of variation between birds, but each bird changes only a little. A paired test focuses on the change within each bird and ignores the bird-to-bird differences.
t =d̄ − 0sd / √n
d̄ = mean of the differences, sd = SD of the differences, n = number of pairs, df = n − 1
Why pairing matters
What if the researchers had (wrongly) treated "before" and "after" as two separate groups of birds?
Try this
Complete the paired steps. Is the change in antibody production significant?
Press "Compare paired vs. independent analysis." Which analysis gives the smaller p-value, and why?
7Statistically significant vs. biologically important
Statistical significance
The difference is unlikely to be due to random variation. That's what p tells you.
Biological significance
The effect size is meaningful for the system you study. A 0.1 g difference in a 14 g frog may be real but not matter.
Same tiny difference, more and more data
Two groups of frogs truly differ by a small amount. Watch p and the effect size as you collect more frogs.
Spread within each group is fixed at s = 0.6 g.
t–
p-value–
Effect size (Cohen's d)–
Size of effect–
Cohen's d = (x̄₁ − x̄₂) / spooled · spooled = √( (s₁² + s₂²) / 2 ) for equal n Rough guide: d ≈ 0.2 small · 0.5 medium · 0.8 or more large
How strong is the evidence?
p isn't just "yes or no." This scale from lecture describes the strength of evidence against H₀. The row for the p-value above is highlighted.
Value of p
Inference
p > 0.10
No evidence against the null hypothesis
0.05 < p ≤ 0.10
Weak evidence against the null hypothesis
0.01 < p ≤ 0.05
Moderate evidence against the null hypothesis
0.001 < p ≤ 0.01
Strong evidence against the null hypothesis
p ≤ 0.001
Very strong evidence against the null hypothesis
Effect sizes from this activity
Always report both: "Urban frogs weighed significantly less (t₁₄ = −6.23, p < 0.001), a large effect (d = 3.1)."
Try this
Keep the difference at 0.15 g. Slide n up until p drops below 0.05. How many frogs per group did it take, and what is Cohen's d there?
Would you tell a conservation manager that urban frogs are "much smaller" based on that result? Why or why not?
8Data Lab: run a t-test on any data
Type or paste two columns of numbers (from Excel, Google Sheets or your notes) and the page does every step, shows the working, and checks the assumptions. Use it to check your hand calculations or to analyze your own data.
Load an example:
Design
9The t-table
Critical values of the t-distribution. Click any cell to pin it; the page reads it back to you in words.