Hypothesis test for correlation
Test the hypothesis that the population product moment correlation coefficient is zero, using the linear regression t-test, with the exact key presses for the TI-84 Plus CE, Casio fx-CG50, Casio fx-CG100 and TI-Nspire CX, plus what to write in the exam.
Enter the paired data in two lists and run the linear regression t-test, choosing the sign that matches your alternative hypothesis. The calculator gives the test statistic , the p-value, the degrees of freedom and the correlation coefficient . Compare the p-value with the significance level: if it is smaller, reject and conclude there is evidence of correlation. Otherwise there is not enough evidence.
Example
A teacher records the number of hours, , that 8 students spent revising and their test marks, .
: 2, 3, 4, 5, 6, 7, 8, 9
: 52, 47, 60, 55, 68, 61, 66, 64
The data come from a bivariate normal distribution. Test, at the 5% significance level, whether there is evidence of correlation between hours of revision and test mark.
State the hypotheses: and , where is the population correlation coefficient. The linear regression t-test gives on degrees of freedom and , with . Since , reject . There is evidence at the 5% level of a positive linear correlation between hours of revision and test mark.
Choose your calculator
How to test for correlation on a TI-84 Plus CE
LinRegTTest | |
Press stat and choose 1:Edit.... Type the -values into L1, pressing enter after each: 2, 3, 4, 5, 6, 7, 8, 9. Type the -values into L2: 52, 47, 60, 55, 68, 61, 66, 64. Both lists must have the same number of values. |
L1 L2 2 52 3 47 4 60 5 55 ... |
Press stat, then ▶ ▶ to move past CALC to TESTS, and choose F:LinRegTTest. With the Stat Wizards on, set Xlist to L1 with 2nd 1, Ylist to L2 with 2nd 2 and Freq to 1. For β & ρ choose the sign that matches your alternative hypothesis, ≠ 0 for a two-tailed test, and leave RegEQ empty. |
LinRegTTest Xlist:L1 Ylist:L2 Freq:1 β & ρ:≠0 Calculate |
Choose Calculate and press enter. The screen shows t, p, df, then a and b for the line of best fit, the standard error s, and r² and r. Use ▼ to scroll to the last two. , , and . |
LinRegTTest y=a+bx β≠0 and ρ≠0 t=3.086695206 p=.02147836376 df=6 a=46.35714286 b=2.321428571 s=4.874007836 r²=.613593455 r=.7833220634 |
A p-value is in the output, so you do not need a table of critical values. For a one-tailed test choose < 0 or > 0 for the sign, and the p-value is then for that one tail.
How to test for correlation on a Casio fx-CG50
LinearReg t Test | |
Press MENU and choose Statistics. Type the -values into List 1, pressing EXE after each: 2, 3, 4, 5, 6, 7, 8, 9. Type the -values into List 2: 52, 47, 60, 55, 68, 61, 66, 64. |
List 1 List 2 2 52 3 47 4 60 5 55 ... |
With the List Editor on screen, press F3 (TEST), then F2 (t), then F3 (REG). For β & ρ choose the direction that matches your alternative hypothesis, ≠0 for a two-tailed test. Set XList to List 1, YList to List 2 and Freq to 1. |
LinearReg t Test β & ρ:≠0 XList:List1 YList:List2 Freq:1 |
Move down to Execute and press F1 (CALC). The screen shows t, p and df, then a and b for the line of best fit, the standard error s, and r and r²: scroll down with ▼. , , and . |
β≠0 & ρ≠0 t=3.0866952 p=0.0214784 df=6 a=46.3571429 b=2.3214286 s=4.8740078 r=0.7833221 r²=0.6135935 |
This test has no graph. If you want the line of best fit as well, the steps are in the linear regression guide.
How to test for correlation on a Casio fx-CG100
Linear Regression t Test | |
Press HOME and choose Statistics. In the List Editor type the -values into List 1, pressing EXE after each: 2, 3, 4, 5, 6, 7, 8, 9. Type the -values into List 2: 52, 47, 60, 55, 68, 61, 66, 64. |
List 1 List 2 2 52 3 47 4 60 5 55 ... |
Press the next-tab key to reach the Setup tab. Highlight the first line, press OK and choose Hypothesis Test. Highlight line 2, press OK, choose t Test and then Linear Regression t Test. |
Hypothesis Test LinearReg t Test |
The screen shows β & ρ, XList, YList and Freq. For β & ρ choose the direction that matches your alternative hypothesis, ≠0 for a two-tailed test, and check that XList is List 1 and YList is List 2. Press the next-tab key to run the test. |
β & ρ:≠0 XList:List1 YList:List2 Freq:1 |
The Results tab shows t, p and df, then a and b for the line of best fit, the standard error se, and r and r²: scroll down with ▼. , , and . |
LinearReg t Test β≠0 & ρ≠0 t=3.08669521 p=0.02147836 df=6 a=46.3571429 b=2.32142857 se=4.87400784 r=0.78332206 r²=0.61359346 |
The test uses the whole of both lists, so clear any old values out of List 1 and List 2 first, and make sure the two lists are the same length.
How to test for correlation on a TI-Nspire CX
Linear Reg t Test | |
Press home and choose Lists & Spreadsheet. In the top cell of column A type the name x and press enter, then type the -values below it, pressing enter after each: 2, 3, 4, 5, 6, 7, 8, 9. In column B use the name y and type the -values: 52, 47, 60, 55, 68, 61, 66, 64. |
A: x B: y 2 52 3 47 4 60 5 55 ... |
Press menu → Statistics → Stat Tests → Linear Reg t Test. Set X List to x, Y List to y and Freq List to 1. For Alternate Hyp choose β & ρ ≠ 0 for a two-tailed test, then choose OK. |
X List:x Y List:y Freq List:1 Alternate Hyp:β & ρ ≠ 0 |
The results fill the spreadsheet: look for t, PVal, df, then a and b for the line of best fit, s, r² and r. , , and . |
Linear Reg t Test t 3.0867 PVal 0.0214784 df 6 a 46.3571 b 2.32143 s 4.87401 r² 0.613593 r 0.783322 |
The p-value is called PVal on the results screen. Check the Alternate Hyp line matches the test you were asked to do before you read it.
Sources. Key presses follow the manufacturers' documentation: the TI-84 Plus CE eGuide, the TI-Nspire eGuide, the Casio fx-CG50 Software User's Guide (version 3.30) and the Casio fx-CG100 online manual.
What to write in the exam
- Write the hypotheses first. and for a test for any correlation, or or when the question names a direction. is the population correlation coefficient.
- Quote the p-value and the significance level. Write and compare it with the level, for example . Do not write the key presses.
- Conclude in context, in two parts. First the decision: reject or do not reject . Then the meaning: there is, or is not, sufficient evidence of correlation between the two named quantities. Say "evidence", not "proof".
- Do not say the correlation causes the effect. A significant correlation shows a linear association, not that one variable causes the other.
- The data will be given. In an examination you are given the data, and the question tells you the data come from a bivariate normal distribution. You do not have to test that assumption.
One-tailed tests and no evidence of correlation
- One-tailed. If the alternative is , choose the greater-than sign on the calculator. The p-value is then for one tail: here it is , half of the two-tailed value, because the correlation is positive.
- Large p-value. If is greater than the significance level, do not reject : there is not sufficient evidence of correlation. Do not say there is no correlation, only that the data do not show it at this level.
- Large with a small sample. A fairly large can be non-significant with few data points, because the test uses degrees of freedom. Use the p-value, not the size of alone.
How this differs from other correlation work
The test is about the population correlation , using the sample correlation from the linear regression guide: line of best fit and r. For ranked data use Spearman's rank correlation coefficient. The ideas of p-values and significance levels are in p-values, significance levels and errors.
Error messages and what to do
| Calculator | Message | Usual cause | What to try |
|---|---|---|---|
| TI-84 Plus CE | ERR:DIMENSION MISMATCH | The x list and the y list do not have the same number of values. | Make the two lists the same length. |
| Casio fx-CG50 | Dimension ERROR | The x list and the y list do not have the same number of values. | Check the dimension of the lists and make them the same length. |
| Casio fx-CG100 | Dimension ERROR | The x list and the y list do not have the same number of values. | Check the dimension of the lists and make them the same length. |
| TI-Nspire CX | Dimension mismatch | The x list and the y list have a different number of values. | Make the two lists the same length. |
Common mistakes
- Reading instead of the p-value. The decision comes from comparing the p-value with the significance level, not from how big looks.
- Using the wrong sign. Choose the sign that matches the alternative hypothesis before you run the test: a one-tailed test has a different p-value from a two-tailed test.
- Writing the conclusion as proof. Say there is evidence of correlation at the stated level, not that the variables are correlated for certain.
- Treating the result as cause and effect. A significant correlation does not mean one variable causes the other.
- Unequal lists. The and lists must have the same number of values, or the calculator gives a dimension error.
Practise with your calculator
Choose your course to see the practice sets that use this skill. You can also try practice mode or browse every GDC guide.
Quick questions
How do I test whether a correlation is significant on a calculator?
Enter the paired data in two lists and run the linear regression t-test: LinRegTTest on the TI-84 Plus CE, the REG test in the t tests on the fx-CG50, Linear Regression t Test under Hypothesis Test on the fx-CG100, or Linear Reg t Test under Stat Tests on the TI-Nspire. Choose the sign that matches your alternative hypothesis, then read the p-value and compare it with the significance level.
What are the hypotheses for a test for correlation?
The null hypothesis is that the population product moment correlation coefficient is zero, H0: rho = 0. The alternative hypothesis is rho not equal to 0 for a two-tailed test, or rho greater than 0 or rho less than 0 for a one-tailed test.
How many degrees of freedom does the test use?
The test uses n - 2 degrees of freedom, where n is the number of pairs of data. The calculator shows this as df.
What do I write as the conclusion?
If p is less than the significance level, reject H0 and write that there is sufficient evidence of correlation between the two named quantities at that level. If p is greater, do not reject H0 and write that there is not sufficient evidence of correlation.