How to do a t-test and a χ² test on the Casio fx-CG50, TI-84 Plus CE and TI-Nspire CX II
On the fx-CG50: MENU → 2 → F3 (TEST) → F2 (t) → F2 (2-SAMPLE).On the TI-84 Plus CE: stat → TESTS → 4: 2-SampTTest.On the TI-Nspire CX II: menu → Statistics → Stat Tests → 2-Sample t Test → Data.
Two-sample t-test (pooled), χ² test for independence from a contingency table and χ² goodness of fit. 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
AI SL: χ² test for independence and goodness of fit, and the two-sample t-test (pooled, from data). AI HL adds one-sample tests and more. You must state H₀ and H₁, give the p-value (or the test statistic and critical value) and conclude in context.
Practise it: SL AI statistical testing · SL AI two-sample t-test · SL AI χ² tests · HL AI χ² and error types.
Which IB course and paper
| Course | GDC papers | What you use it for |
|---|---|---|
| AA SL | Not in the syllabus | — |
| AA HL | Not in the syllabus | — |
| AI SL | Papers 1 and 2 | χ² tests for independence and goodness of fit, and the two-sample t-test. |
| AI HL | Papers 1, 2 and 3 | As SL, plus the further tests in the HL syllabus. |
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: Chi-squared test (AI SL) · Chi-squared test and confidence intervals (AI HL) · Hypothesis testing (AI HL).
Keystrokes on your calculator
Pick your calculator: the page remembers it next time.
t-tests and χ² tests 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-CG5013 presses, one at a time
The walkthrough needs JavaScript. The same key presses are in the numbered steps below.
- t-test: MENU 2, sample A in List 1 and sample B in List 2. F3 (TEST) F2 (t) F2 (2-SAMPLE).
- Data: List, μ1: ≠ μ2, List(1): List1, List(2): List2, Freq 1 and 1, Pooled: On. Execute: read t, p and df.
- χ² independence: F3 (TEST) F3 (CHI) F2 (2WAY). Observed: Mat A. Press F2 (►MAT) to type the table into Mat A (set its size, e.g. 2 × 3), EXIT, then Execute. Read χ², p and df; the expected values are stored in Mat B.
- Goodness of fit: observed in List 1, expected in List 2 (expected frequencies, not proportions), then F3 (TEST) F3 (CHI) F1 (GOF). df = number of classes − 1 (minus any estimated parameters). Execute.
- p = 4.2056E−03 means 0.0042056: read the E−03.
- To see the expected frequencies: MENU 1, F3 (MAT/VCT), open Mat B.
t-tests and χ² tests 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 CE12 presses, one at a time
The walkthrough needs JavaScript. The same key presses are in the numbered steps below.
- t-test: data in L1 and L2. stat → TESTS → 4: 2-SampTTest. Inpt: Data, List1 L1, List2 L2, μ1: ≠μ2, Pooled: Yes. Calculate.
- χ² independence: 2nd x⁻¹ (MATRIX) → EDIT → 1: [A], size 2 × 3, type the table. Then stat → TESTS → C: χ²-Test, Observed [A], Expected [B]. Calculate.
- Goodness of fit: observed in L1, expected in L2. stat → TESTS → D: χ²GOF-Test, Observed L1, Expected L2, df 3. Calculate.
- The expected table is written to [B]: view it in the MATRIX menu.
t-tests and χ² tests 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).
- t-test: data in two named columns. menu → Statistics → Stat Tests → 2-Sample t Test → Data. Choose the lists, Alternate Hyp μ1 ≠ μ2, Pooled: Yes. OK.
- χ² independence: store the table as a matrix (e.g. obs := 18,22,20][32,18,10 on a Calculator page), then menu → Statistics → Stat Tests → χ² 2-way Test, Observed Matrix: obs.
- Goodness of fit: menu → Statistics → Stat Tests → χ² GOF with the observed and expected lists and df.
- stat.expmatrix holds the expected frequencies after a 2-way test.
For teachers: Show on the board Print a keystroke card Teaching GDC skills
Worked example
(a) Sample A: 23.1, 25.4, 22.8, 26.0, 24.7, 25.9, 23.5, 24.2. Sample B: 21.9, 23.0, 22.4, 24.1, 21.5, 22.8, 23.3, 22.0. Test at 5% whether the means differ (pooled). (b) Observed table 18, 22, 20], [32, 18, 10: test for independence at 5%. (c) Observed 28, 35, 22, 15 against a uniform distribution.
Answers (checked with Python)
(a) t = 3.41266, p = 0.00420561 < 0.05: reject H₀, the means differ. (b) χ² = 7.65333, df = 2, p = 0.0217821 < 0.05: reject H₀ (not independent). The first expected frequency is 25. (c) χ² = 8.72, df = 3, p = 0.0332549 < 0.05: the data do not fit a uniform distribution.
Now try it on an exam-style question
Use the keystrokes above on IB-style statistical testing questions. Free to try, no sign-up.
Common calculator mistakes
- Pooled: the IB's two-sample t-test uses the pooled variance (Pooled: On/Yes). Leaving it off gives a slightly different p.
- Goodness of fit with proportions or percentages in the expected list: expected values must be frequencies that add up to the total.
- Wrong degrees of freedom: (rows − 1)(columns − 1) for independence; classes − 1 − (number of estimated parameters) for goodness of fit.
- Expected frequencies too small (in IB exams every one is greater than 5): combine classes first (the calculator will not warn you).
- Concluding "H₀ is true": say there is insufficient evidence to reject H₀, and answer in the context of the question.
- Giving the p-value to 3 s.f. but comparing a rounded value with the significance level: compare the full p-value.
- 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:DATA TYPE
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.
ERR:DATA TYPE An argument is the wrong type, such as a complex number where a real number is needed, or a matrix stored to a list. Check: A complex result used in a real-only command, or a list and a matrix mixed up. Fix: Use the type the command expects.
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 A and B of the two samples.
- ittest(A, B) runs a two-sample t-test and shows t and p; choose the alternative hypothesis in its menu. Check whether it is pooled: if its p differs slightly from your GDC's pooled test, that is why.
- Desmos has no built-in χ² test: work out Σ(O − E)² ÷ E with lists (O and E) to check the statistic.
Open desmos.com/calculator (free, in any browser) and type:
A=[23.1,25.4,22.8,26,24.7,25.9,23.5,24.2]B=[21.9,23,22.4,24.1,21.5,22.8,23.3,22]ittest(A,B)O=[28,35,22,15]E=[25,25,25,25]total(frac{(O-E)^{2}}{E})
Questions
Can I use a calculator for t-tests and χ² tests 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 t-tests and χ² tests?
t-test: MENU 2, sample A in List 1 and sample B in List 2. F3 (TEST) F2 (t) F2 (2-SAMPLE). Then Data: List, μ1: ≠ μ2, List(1): List1, List(2): List2, Freq 1 and 1, Pooled: On. Execute: read t, p and df. Then χ² independence: F3 (TEST) F3 (CHI) F2 (2WAY). Observed: Mat A. Press F2 (►MAT) to type the table into Mat A (set its size, e.g. 2 × 3), EXIT, then Execute. Read χ², p and df; the expected values are stored in Mat B. 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.