10.4: Hypothesis Test for a Correlation Using t-Test
- Page ID
- 58309
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\( \newcommand{\dsum}{\displaystyle\sum\limits} \)
\( \newcommand{\dint}{\displaystyle\int\limits} \)
\( \newcommand{\dlim}{\displaystyle\lim\limits} \)
\( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)
( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\id}{\mathrm{id}}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\kernel}{\mathrm{null}\,}\)
\( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\)
\( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\)
\( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)
\( \newcommand{\vectorA}[1]{\vec{#1}} % arrow\)
\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow\)
\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vectorC}[1]{\textbf{#1}} \)
\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)
\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)
\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\(\newcommand{\longvect}{\overrightarrow}\)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)- Describe the purpose of hypothesis testing for correlation using the t-value method.
- Convert a sample correlation coefficient r to a corresponding t-value.
- Identify the critical t-value using the appropriate degrees of freedom.
- Determine whether the observed correlation provides evidence of a real linear relationship in the population.
A t-test is another hypothesis test used to determine if there is a statistically significant relationship between the independent and dependent variables. The population correlation coefficient \(\rho\) (this is the Greek letter rho, which sounds like “row” and is not a \(p\)) is the correlation among all possible pairs of data values \((x, y)\) taken from a population.
We will only be using the two-tailed test for a population correlation coefficient \(\rho\). The hypotheses are:
\(H_{0}: \rho = 0\)
\(H_{1}: \rho \neq 0\)
The null hypothesis of a two-tailed test states that there is no correlation (there is no linear relation) between \(x\) and \(y\). The alternative hypothesis states that there is a significant correlation (there is a linear relation) between \(x\) and \(y\).
The t-test is a statistical test for the correlation coefficient. It can be used when \(x\) and \(y\) are linearly related, the variables are random variables, and when the population of the variable \(y\) is normally distributed.
The formula for the t-test statistic is \(t = r \sqrt{\left( \dfrac{n-2}{1-r^{2}} \right)}\).
Use the t-distribution with degrees of freedom equal to \(df = n - 2\).
Where,
- \(r\) = correlation coefficient
- \(n\) = sample size (number of pairs)
Note the \(df = n - 2\) since we have two variables, \(x\) and \(y\).
Examples
Professor Martinez is conducting a study to understand the relationship between the number of hours students study per week and their performance on the midterm exam in Math 400, an advanced calculus course at the university. She collects data from 8 randomly selected students in her class. The exam is out of 100 points, and time is measured in hours per week. Test for correlation using an \(\alpha = 0.05\).
Click on this link for the t-distribution table to locate the critical values.
| x: Hours Studied Per Week | y: Midterm Exam Score (out of 100 points) |
|---|---|
| 10 | 51 |
| 10 | 53 |
| 12 | 64 |
| 13 | 68 |
| 14 | 71 |
| 15 | 79 |
| 16 | 84 |
| 20 | 92 |
Table \(\PageIndex{1}\): Hours Studied Per Week and Midterm Exam Score
Solution
- Write out the claim and the null and alternative hypotheses.
\(H_0: \rho = 0\) Claim
\(H_1: \rho \neq 0\)
- Look up the critical values using the t-table and the given \(\alpha\ = 0.05).
Since \(n\) represents the number of pairs, which is 8, then \(d.f. = 8 - 2 = 6\). Using the table for t-values and two tails, the critical values are \(\pm 2.447\).
- Compute the test point using the formula, a calculator, or another technology.
The value of \(r = 0.976\) can be calculated using a calculator or a formula. Also, \(n\) = 8. Plug this information into the formula.
\(t = r \sqrt{\left( \dfrac{n-2}{1-r^{2}} \right)}\) = \(0.9765 \sqrt{\left( \dfrac{8-2}{1-0.9765^{2}} \right)}\) = 11.09
- Determine if the null hypothesis (\(H_0\)) is rejected or not and write out a summary statement.
Since the test point is in the critical region, reject (\(H_0\)) and there is a linear relationship.
A TI-84+ can also be used to compute the test point more efficiently. The next example will demonstrate the process for this type of computation.
A health researcher at the Health Department at a large university is conducting a study to explore the relationship between physical activity and health outcomes among college students aged 18–25 years old. The researcher is specifically interested in determining whether there is a correlation between the number of hours students work out per week and the number of days they spend being ill in a year. The researcher collected data provided in the table below. Test for correlation using an \(\alpha = 0.01\).
Click on this link for the t-distribution table to locate the critical values.
| X: Hours Worked Out per Week | Y: Days Spent Ill in a Year |
|---|---|
| 0 | 14 |
| 2 | 10 |
| 4 | 8 |
| 5 | 6 |
| 7 | 5 |
| 10 | 3 |
| 12 | 2 |
Table \(\PageIndex{2}\): Hours Worked Out Per Week and Days Spent Ill in a Year
Solution
- Write out the claim and the null and alternative hypotheses.
\(H_0: \rho = 0\) Claim
\(H_1: \rho \neq 0\)
- Look up the critical values using the t-table and the given \(\alpha\ = 0.05).
Since \(n\) represents the number of pairs, which is 7, then \(d.f. = 7 - 2 = 5\). Using the table for t-values and two tails, the critical values are \(\pm 4.032\).
- Compute the test point using the formula, a calculator, or another technology.
In this example, the value will be computed using the calculator.
- Press [STAT] and make sure [EDIT] and [1:Edit] are highlighted, then press [ENTER]. Enter the x-values into \(L_1\) and they-values into \(L_2\).
- Press the [STAT] key, arrow over to the [TESTS] menu, arrow down to the option F [LinRegTTest], and press the [ENTER] key. The default is Xlist: L1, Ylist: L1, Freq:1, \(\beta\) and \(\rho: \neq 0\). Arrow down to Calculate and press the [ENTER] key.
- The output screen on the calculator returns the t-test statistic and the p-value.
The test statistic is \(t = -8.13\).
- Determine if the null hypothesis (\(H_0\)) is rejected or not, and write out a summary statement.
Since the test point is in the critical region, reject (\(H_0\)) and there is a linear relationship.
A researcher is exploring if there is any correlation between the amount of money students spend on lunch and their GPA in a college setting. Hypothetically, we are testing if students who spend more money on lunch tend to have higher or lower GPAs.
The researcher collected 10 pairs of data representing the amount of money students spend on lunch and their corresponding GPA. The data is presented below. Test for correlation using \(\alpha = 0.05\).
Click on this link for the t-distribution table to locate the critical values.
| Amount Spent on Lunch ($) | GPA |
|---|---|
| $ 10.00 | 1.95 |
| $ 7.50 | 3.20 |
| $ 4.00 | 3.60 |
| $ 8.45 | 2.80 |
| $ 6.95 | 3.40 |
| $ 9.00 | 2.70 |
| $ 8.90 | 2.56 |
| $ 12.50 | 3.30 |
| $ 19.80 | 3.00 |
| $ 6.90 | 3.49 |
Table \(\PageIndex{3}\): Amount Spent on Lunch and GPA
Solution
- Write out the claim and the null and alternative hypotheses.
\(H_0: \rho = 0\) Claim
\(H_1: \rho \neq 0\)
- Look up the critical values using the t-table and the given \(\alpha\ = 0.05).
Since \(n\) represents the number of pairs, which is 10, then \(d.f. = 10 - 2 = 8\). Using the table for t-values and two tails, the critical values are \(\pm 2.036\).
- Compute the test point using the formula, a calculator, or another technology.
In this example, the value will be computed using the calculator. The output of the calculator is presented in the image below.
The test statistic is \(t = -0.75\).
- Determine if the null hypothesis (\(H_0\)) is rejected or not, and write out a summary statement.
Since the test point is in the non-critical region, do not reject (\(H_0\)), and there is no linear relationship.
Authors
"10.4: Hypothesis Test for a Correlation Using t-Test" by Toros Berberyan, Tracy Nguyen, and Alfie Swan is licensed under CC BY-SA 4.0
Attributions
"12.1.2: Hypothesis Test for a Correlation" by Rachel Webb is licensed under CC BY-SA 4.0
Exercises
- A café owner wants to determine if there is a significant correlation between the daily temperature and the number of iced coffee drinks sold. The owner records the temperature and the number of iced coffees sold for five randomly selected days. Test for correlation using the t-test with α=0.05. Use the traditional method. Click on this link for the t-distribution table to locate the critical values.
| Temperature (⁰F) | # of Iced Coffees Sold |
|---|---|
| 72 | 35 |
| 78 | 42 |
| 85 | 53 |
| 88 | 56 |
| 91 | 60 |
Scan the QR code or click on it to open the MyOpenMath version of the above question with step-by-step guidance.
MyOpenMath is a free online learning platform designed to support math instruction through automated homework, quizzes, and assessments. You must register for MyOpenMath and sign in to view the question.
- A café owner wants to determine if there is a significant correlation between the daily temperature and the number of iced coffee drinks sold. The owner records the temperature and the number of iced coffees sold for five randomly selected days. Test for correlation using the t-test with α=0.05. Use the p-value method.
| Temperature (⁰F) | # of Iced Coffees Sold |
|---|---|
| 72 | 35 |
| 78 | 42 |
| 85 | 53 |
| 88 | 56 |
| 91 | 60 |
Scan the QR code or click on it to open the MyOpenMath version of the above question with step-by-step guidance.
MyOpenMath is a free online learning platform designed to support math instruction through automated homework, quizzes, and assessments. You must register for MyOpenMath and sign in to view the question.
- A researcher wants to investigate whether there is a significant linear relationship between gas prices and average household income in different cities. The data below shows average gas prices and corresponding household income (in thousands of dollars) for seven cities. Test for correlation using the t-test with α=0.01. Use the traditional method. Click on this link for the t-distribution table to locate the critical values.
| Gas Price ($) | Household Income (in $1,000s) |
|---|---|
| 3.10 | 45 |
| 3.25 | 52 |
| 3.40 | 60 |
| 3.55 | 66 |
| 3.70 | 72 |
| 3.85 | 78 |
| 4.00 | 85 |
Scan the QR code or click on it to open the MyOpenMath version of the above question with step-by-step guidance.
MyOpenMath is a free online learning platform designed to support math instruction through automated homework, quizzes, and assessments. You must register for MyOpenMath and sign in to view the question.
- A researcher wants to investigate whether there is a significant linear relationship between gas prices and average household income in different cities. The data below shows average gas prices and corresponding household income (in thousands of dollars) for seven cities. Test for correlation using the t-test with α=0.01. Use the p-value method.
| Gas Price ($) | Household Income (in $1,000s) |
|---|---|
| 3.10 | 45 |
| 3.25 | 52 |
| 3.40 | 60 |
| 3.55 | 66 |
| 3.70 | 72 |
| 3.85 | 78 |
| 4.00 | 85 |
Scan the QR code or click on it to open the MyOpenMath version of the above question with step-by-step guidance.
MyOpenMath is a free online learning platform designed to support math instruction through automated homework, quizzes, and assessments. You must register for MyOpenMath and sign in to view the question.
- A researcher believes that students who study more hours per week might experience lower levels of stress. To test this, she surveys 6 college students and records how many hours they study per week and their self-reported stress level on a scale of 1 to 10 (10 = highest stress). Test for correlation using the t-test with α=0.05. Use the traditional method. Click on this link for the t-distribution table to locate the critical values.
| Study Hours | Stress Level |
| 4 | 10 |
| 6 | 8 |
| 8 | 9 |
| 10 | 10 |
| 12 | 4 |
| 14 | 3 |
Scan the QR code or click on it to open the MyOpenMath version of the above question with step-by-step guidance.
MyOpenMath is a free online learning platform designed to support math instruction through automated homework, quizzes, and assessments. You must register for MyOpenMath and sign in to view the question.
- A researcher believes that students who study more hours per week might experience lower levels of stress. To test this, she surveys 6 college students and records how many hours they study per week and their self-reported stress level on a scale of 1 to 10 (10 = highest stress). Test for correlation using the t-test with α=0.05. Use the p-value method.
| Study Hours | Stress Level |
| 4 | 10 |
| 6 | 8 |
| 8 | 9 |
| 10 | 10 |
| 12 | 4 |
| 14 | 3 |
Scan the QR code or click on it to open the MyOpenMath version of the above question with step-by-step guidance.
MyOpenMath is a free online learning platform designed to support math instruction through automated homework, quizzes, and assessments. You must register for MyOpenMath and sign in to view the question.
- Answers
-
If you are an instructor and want the solutions to all the exercise questions for each section, please email Toros Berberyan.








