IA statistics, step by step · Correlation and regression
Pearson's correlation and the regression line, step by step
Is there a straight-line relationship, how strong is it, and what is the line? Here are r, r² and the regression line worked by hand from the deviations, with the scatter graph, the AI HL significance test and the limits of what it all shows.
Example data, invented for this guide. The context is realistic, but the numbers were made up to show the method. Use your own collected or sourced data in your IA.
When to use it
- Two numerical variables measured on the same individuals.
- The scatter graph shows a roughly straight-line pattern.
- You want to predict one variable from the other, inside the range of the data.
Course fit: Every course: scatter diagrams, Pearson's product-moment correlation coefficient r and the regression line of y on x are in the SL core of AA and AI (AA SL also has x on y). Testing whether the population correlation is zero is AI HL.
New course (first assessment May 2029): the IB has confirmed that the hypothesis test for the correlation coefficient (testing ρ = 0) is not on the AI HL syllabus from 2029 (AI curriculum updates). You can still use it in an IA if you explain it clearly.
The example data
Twelve students recorded their recreational screen time on one school day and how long they slept that night (from a phone sleep tracker).
| i | x: Daily screen time (h) | y: Sleep the following night (h) |
|---|---|---|
| 1 | 1.5 | 8.6 |
| 2 | 2 | 8.1 |
| 3 | 2.5 | 8.4 |
| 4 | 3 | 7.9 |
| 5 | 3.5 | 7.6 |
| 6 | 4 | 7.8 |
| 7 | 4.5 | 7.2 |
| 8 | 5 | 7.4 |
| 9 | 5.5 | 6.9 |
| 10 | 6 | 7.1 |
| 11 | 7 | 6.5 |
| 12 | 8 | 6.2 |
r, r² and the regression line
Every quantity comes from the deviations from the means. A GDC does all of this in one command; showing it once by hand makes clear what r measures.
Step 1 · Means and deviations
x̄ = 4.3750, ȳ = 7.4750, n = 12
| i | x | y | x − x̄ | y − ȳ | (x − x̄)(y − ȳ) | (x − x̄)² | (y − ȳ)² |
|---|---|---|---|---|---|---|---|
| 1 | 1.5 | 8.6 | −2.875 | 1.125 | −3.234 | 8.266 | 1.266 |
| 2 | 2 | 8.1 | −2.375 | 0.6250 | −1.484 | 5.641 | 0.3906 |
| 3 | 2.5 | 8.4 | −1.875 | 0.9250 | −1.734 | 3.516 | 0.8556 |
| 4 | 3 | 7.9 | −1.375 | 0.4250 | −0.5844 | 1.891 | 0.1806 |
| 5 | 3.5 | 7.6 | −0.8750 | 0.1250 | −0.1094 | 0.7656 | 0.01562 |
| 6 | 4 | 7.8 | −0.3750 | 0.3250 | −0.1219 | 0.1406 | 0.1056 |
| 7 | 4.5 | 7.2 | 0.1250 | −0.2750 | −0.03438 | 0.01563 | 0.07563 |
| 8 | 5 | 7.4 | 0.6250 | −0.07500 | −0.04688 | 0.3906 | 0.005625 |
| 9 | 5.5 | 6.9 | 1.125 | −0.5750 | −0.6469 | 1.266 | 0.3306 |
| 10 | 6 | 7.1 | 1.625 | −0.3750 | −0.6094 | 2.641 | 0.1406 |
| 11 | 7 | 6.5 | 2.625 | −0.9750 | −2.559 | 6.891 | 0.9506 |
| 12 | 8 | 6.2 | 3.625 | −1.275 | −4.622 | 13.14 | 1.626 |
| Σ | −15.787 | 44.563 | 5.9425 |
Step 2 · Pearson's correlation coefficient r
r = Σ(x − x̄)(y − ȳ) / √[Σ(x − x̄)² Σ(y − ȳ)²] = −15.787 / √(44.563 × 5.9425) = −0.9702
r² = 0.9412: about 94.1% of the variation in y is associated with the linear relationship with x. On its own terms, a very strong negative linear correlation.
In the full worked analysis
- The rest of the working: steps 3 to 4
- What the example shows, in context
- On a GDC: TI-84 Plus CE, TI-Nspire CX and Casio fx-CG50
- What examiners look for
- Common mistakes
- Limitations to discuss
How this maps to the IA criteria
- A Criterion A (Presentation): Scatter graph, calculation and interpretation in one place, in that order.
- B Criterion B (Mathematical communication): r, r², the line and its variables defined with units; the graph labelled.
- C Criterion C (Personal engagement): Choosing variables you care about and thinking hard about what else could explain the link.
- D Criterion D (Reflection): Discussing causation, the sample and influential points — what the correlation does and does not show.
- E Criterion E (Use of mathematics): r and the line calculated correctly (one by hand, the rest by technology) and interpreted correctly.
These are the current criteria A–E, for exams up to November 2028. For the new courses (first assessment May 2029) the IB has confirmed one set of four criteria for SL and HL: A Problem specification (4 marks), B Abstraction (6), C Computation (4) and D Interpretation (6), still 20 marks and 20% of the grade at both levels — see the IB's new AA and AI subject briefs. The detailed descriptors come with the new guide; check with your teacher which criteria apply to you. The advice is our summary, not the IB's wording.
Frequently asked questions
What is a good r value in a Maths IA?
There is no pass mark. Describe strength and direction honestly (|r| near 1: strong; near 0: little linear correlation), check the scatter graph, and interpret r² as the proportion of variation explained.
Do I need to calculate r by hand?
Show one calculation clearly so the examiner sees you understand it, then use technology and say so. At HL, more of the mathematics shown or derived helps Criterion E.
Is correlation enough for a statistics IA?
On its own it is often thin, especially at HL. Combine it with a good question, careful data, a test where your course has one, and real reflection on causation and limitations.
Next steps
- Criterion E: use of mathematicsWhat “commensurate with the level of the course” means for statistics, at SL and HL.
- Criterion D: reflectionSample, bias, assumptions and causation: where statistics IAs gain or lose marks.
- Plan your statistics IAThe section-by-section framework for a statistics exploration, with your own notes.
- Get feedback on your write-upCriterion-by-criterion feedback on your draft, with evidence from your own text.
- Exemplar: Sleep and reactions (statistics)AI SL · a statistics exploration that uses this technique, marked criterion by criterion.
- Exemplar: Mid-band draft (statistics)AI SL · a statistics exploration that uses this technique, marked criterion by criterion.
Related: Spearman's rank correlation · Is my data normal?. Or analyse your own data, find a data set in the IA data bank, and see what the IA package adds.
Free: the IA checklist an examiner uses
Every check for Criteria A–E in a 4-page PDF, the mistakes that cost the most marks and a self-assessment grid. We'll email it with a short IA tip every few days, timed to your deadline if you give it. Free — no account, no payment.
While you wait for the email: read the full statistics workflow →