How to find Pearson's r and Spearman's rank correlation on the Casio fx-CG50, TI-84 Plus CE and TI-Nspire CX II
On the fx-CG50: MENU → 2 (STATISTICS) → F2 (CALC) → F3 (REG) → F1 (X) → F1 (ax+b).On the TI-84 Plus CE: stat → CALC → 4: LinReg(ax+b).On the TI-Nspire CX II: menu → Statistics → Stat Calculations → Linear Regression.
Pearson's product-moment correlation coefficient and Spearman's rank coefficient (by ranking, then r). Exact keystrokes for the fx-CG50 first, then the other calculators, a worked example you can check your answers against, the mistakes that cost marks, and the same thing in Desmos.
When you need it
Pearson's r in AA and AI; Spearman's rs in AI (SL and HL) when the relationship is monotonic but not linear, or the data are ranks. No GDC has a Spearman button: rank the data, then find r of the ranks.
Practise it: SL AI bivariate data · SL AI correlation and regression · SL AA bivariate data.
Which IB course and paper
| Course | GDC papers | What you use it for |
|---|---|---|
| AA SL | Paper 2 (Paper 1 is calculator-free) | Pearson's r (Spearman's rank is not in AA). |
| AA HL | Papers 2 and 3 (Paper 1 is calculator-free) | As SL. |
| AI SL | Papers 1 and 2 | Pearson's r and Spearman's rank correlation coefficient. |
| AI HL | Papers 1, 2 and 3 | As SL. |
A GDC is allowed on every AI paper and on AA Papers 2 and 3; AA Paper 1 is calculator-free, so learn the method by hand as well.
Topic notes: Correlation, regression, and Pearson's r (AI SL) · Linear regression and residual analysis (AI HL).
Keystrokes on your calculator
Pick your calculator: the page remembers it next time.
Correlation r and Spearman's rank on the Casio fx-CG50
Written for OS 3.80 (menus unchanged from OS 3.60 onwards as far as we can tell). Casio fx-CG50: graphic (GDC).
Watch the key presses on the fx-CG5016 presses, one at a time
The walkthrough needs JavaScript. The same key presses are in the numbered steps below.
- MENU 2 (STATISTICS). Type the x values into List 1 and the y values into List 2, pressing EXE after each. (Clear an old list first: highlight the list, F6 (▷) F4 (DELETE-ALL) F1 (Yes).)
- Pearson's r: F2 (CALC) F3 (REG) F1 (X) F1 (ax+b). Read r.
- Spearman: type the ranks of x into List 3 and the ranks of y into List 4 (rank each list separately, smallest = 1; tied values share the mean rank).
- F2 (CALC) F6 (SET): XList = List3, YList = List4, EXIT, then F3 (REG) F1 F1 again. This r is rs.
- Sorting helps you rank: F1 (TOOL) → SORT-ASC in the list editor, but sort a copy, not your original lists, or the x–y pairs break.
- Set the SET menu back to List1/List2 afterwards.
Correlation r and Spearman's rank on the TI-84 Plus CE
Written for OS 5.8.x. TI-84 Plus CE: graphic (GDC); also the TI-84 Plus CE Python / CE-T Python Edition.
Watch the key presses on the TI-84 Plus CE9 presses, one at a time
The walkthrough needs JavaScript. The same key presses are in the numbered steps below.
- stat 1: Edit. Clear old data: move onto the L1 heading, clear, enter. Type the x values in L1 and the y values in L2.
- Diagnostics on (mode → STAT DIAGNOSTICS: ON), then stat → CALC → 4: LinReg(ax+b) with L1, L2. Read r.
- Spearman: type the ranks in L3 and L4 and run LinReg(ax+b) with Xlist L3, Ylist L4. That r is rs.
- No r on screen means diagnostics are off.
Correlation r and Spearman's rank on the TI-Nspire CX II
Written for OS 6.x. TI-Nspire CX II: graphic (GDC), non-CAS (the CX II CAS is a different model: check the exam rules before using one).
- Add a Lists & Spreadsheet page (ctrl doc → Add Lists & Spreadsheet). Name column A xs and column B ys in the top row, then type the data.
- menu → Statistics → Stat Calculations → Linear Regression (mx+b) with xs, ys. Read r.
- Spearman: add rank columns (rx, ry): rank each list separately, smallest = 1, tied values share the mean rank. Run the same regression on rx and ry: this r is rs.
For teachers: Show on the board Print a keystroke card Teaching GDC skills
Worked example
x: 12, 15, 17, 20, 23, 25, 28, 30. y: 40, 44, 43, 52, 55, 51, 60, 63. Find r and Spearman's rs.
Answers (checked with Python)
r = 0.955492. Ranks of x: 1–8; ranks of y: 1, 3, 2, 5, 6, 4, 7, 8. r of the ranks gives rs = 0.905.
Now try it on an exam-style question
Use the keystrokes above on IB-style correlation and regression questions. Free to try, no sign-up.
Common calculator mistakes
- Ranking the two lists together instead of separately.
- Ties: two equal values in 3rd and 4th place both get rank 3.5, and the next value gets 5.
- Reordering one list only (sorting x without its y) destroys the pairs.
- Reading r² as r: r = 0.955 but r² = 0.913.
- Interpreting: r close to 1 means a strong positive linear relationship, not that x causes y.
- Accuracy: unless the question says otherwise, IB markschemes want answers exact or to 3 significant figures. Keep the full calculator value for later parts and round only the answer you write down (x = 2.094551… is written 2.09, not 2.1 or 2.0946).
If you get an error
fx-CG50: Ma ERROR
Ma ERROR Casio's Math ERROR: the result is outside the allowable calculation range, or you are trying to do an illegal mathematical operation, such as dividing by zero. Check: Look for a zero denominator, sin⁻¹ or cos⁻¹ of a number bigger than 1 (often a wrong side or angle in the sine or cosine rule), the log of 0 or of a negative number, and a value stored in a variable earlier that you forgot about. Fix: Casio's advice: check your input values and change them so the result is within the allowable range.
TI-84 Plus CE: ERR:DOMAIN, ERR:DIM MISMATCH, ERR:INVALID DIM, ERR:SYNTAX, ERR:STAT
ERR:DOMAIN A value given to a function or instruction is outside the values it accepts. In a regression, TI says it means the data do not suit the model you chose. Check: Is every input allowed? σ must be positive, p between 0 and 1, and sin⁻¹ or cos⁻¹ needs a number from −1 to 1. Exponential and power models need positive data. Fix: Change the value that is out of range, or choose a model that suits the data.
ERR:DIM MISMATCH Lists or matrices in the same operation have different sizes (TI's example: multiplying two lists with different numbers of elements). Check: L1 and L2 with different numbers of values (one value missed or typed twice), a frequency list of the wrong length, or matrices whose sizes cannot be multiplied. Fix: Make the lists the same length, or check the size of each matrix.
ERR:INVALID DIM TI's knowledge base: one or more stat plots are turned on, but the lists they use are empty. Check: A stat plot left on from a statistics question, so the error appears when you graph a function. Fix: Turn off the stat plots you are not using, or put the data back in the lists.
ERR:SYNTAX The command contains a syntax error: a misplaced function, argument, bracket or comma. Check: TI points out that subtract − and negative (−) are different keys, and using the wrong one causes this error. Then check the brackets and commas. Fix: Find the misplaced function, argument, bracket or comma and correct it.
ERR:STAT A statistics calculation was tried on lists that are not suitable. A statistical analysis needs at least two data points. Check: An empty or one-value list, or the wrong list named in the command. Fix: Check the lists named in the command and the data in them.
TI-Nspire CX II: Domain error, Dimension mismatch, Syntax error
Domain error An argument must be in a specified domain, and this one is not (TI's example: rand(0)). Check: Is every input allowed? σ must be positive, p between 0 and 1, and sin⁻¹ or cos⁻¹ needs a number from −1 to 1. Fix: Change the value that is out of range.
Dimension mismatch Two or more arguments must have the same dimension and do not (TI's example: [1,2]+[1,2,3]). Check: Lists of different lengths in a statistics command, or vectors or matrices of different sizes. Fix: Make the lists, vectors or matrices the sizes the operation needs.
Syntax error The syntax checker found a problem. Check: A missing bracket or comma. Fix: Correct the expression and try again.
Do it in Desmos
Not in the exam. Desmos is not an approved calculator for IB exams, so never rely on it for Paper 2. It is excellent for learning, checking a GDC answer and building graphs for your Internal Assessment (IA).
- Make lists X = [12, 15, …] and Y = [40, 44, …].
- corr(X, Y) gives Pearson's r; spearman(X, Y) gives Spearman's rs directly (Desmos ranks and handles ties for you).
- Plot (X, Y) to see the scatter diagram.
Open desmos.com/calculator (free, in any browser) and type:
X=[12,15,17,20,23,25,28,30]Y=[40,44,43,52,55,51,60,63](X,Y)corr(X,Y)spearman(X,Y)
Questions
Can I use a calculator for correlation r and Spearman's rank in the exam?
In IB Maths you can use one approved GDC on every AI paper and on AA Papers 2 and 3, in exam mode. AA Paper 1 is calculator-free, so learn the method by hand as well.
What are the fx-CG50 keystrokes for correlation r and Spearman's rank?
MENU 2 (STATISTICS). Type the x values into List 1 and the y values into List 2, pressing EXE after each. (Clear an old list first: highlight the list, F6 (▷) F4 (DELETE-ALL) F1 (Yes).). Then Pearson's r: F2 (CALC) F3 (REG) F1 (X) F1 (ax+b). Read r. Then Spearman: type the ranks of x into List 3 and the ranks of y into List 4 (rank each list separately, smallest = 1; tied values share the mean rank). The full steps and the other calculators are in the keystrokes section above.
Does this work on other calculators?
Yes. This page has keystrokes for the Casio fx-CG50, TI-84 Plus CE and TI-Nspire CX II. The worked example has the same answers on every model, so use it to check.
What should I write as working?
Write the maths, not the key presses: say what you are finding in normal notation (the equation, the probability statement or the integral), then the calculator's answer exact or to 3 significant figures unless the question says otherwise. Keep full accuracy in later parts.
More calculator skills
Sources
- Casio fx-CG50 Software User's Guide, OS 3.70 (PDF) : Casio fx-CG50, OS 3.80 (menus unchanged from OS 3.60 onwards as far as we can tell).
- TI-84 Plus CE guidebook (Texas Instruments) : TI-84 Plus CE, OS 5.8.x.
- TI-Nspire CX II guidebooks (Texas Instruments) : TI-Nspire CX II, OS 6.x.
- Desmos Help Center for the Desmos functions.
Menu names are taken from each manufacturer's manual for the models shown. Menus can move slightly between OS updates: if a screen looks different on yours, the manual for your version is the reference, and please tell us so we can update this page. A calculator with no tab here has no checked steps for this skill yet. Worked-example answers were recomputed independently in Python.