Skip to main content
Statistics LibreTexts

10.3: Hypothesis Test for Correlation Using r

  • Page ID
    52816
  • \( \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{\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}\)

     

    Learning Objectives
    • Explain the purpose of hypothesis testing for correlation using the correlation coefficient r.
    • Determine whether a significant linear relationship exists between two variables in a population through hypothesis testing.
    • Compare the sample correlation coefficient to critical values based on sample size.
    • Evaluate whether the observed correlation is likely due to chance or reflects a true association in the population.

    The correlation coefficient \(r\) measures the strength and direction of a linear relationship between two variables. A hypothesis test for \(r\) is conducted to determine whether an observed correlation is statistically significant. This test evaluates whether the observed relationship in the sample reflects a true relationship in the population or if it could have occurred due to random chance. The population correlation coefficient \(\rho\), spelled as rho and pronounced as row, will be used to write out the claim for the test. The process for the test is outlined below.

    Hypothesis Test for Correlation

    1. Write out the claim and the null and alternative hypotheses.

    \(H_0: \rho = 0\) Claim (There is no linear relationship between the variables)

    \(H_1: \rho \neq 0\) (There is a linear relationship between the variables)

    1. Look up the critical values using the Pearson's Correlation Matrix (PMC) table below using the given \(\alpha\). The degrees of freedom are \(n-2\). The PMC table can also be accessed in the book by clicking PMC Table.
    The correlation coefficient table.
    Figure \(\PageIndex{1}\): Correlation Coefficient Table
    1. Represent the range of correlation coefficient values on a spectrum of r values. The minimum value is \(-1\) and the maximum value is \(1\).
    The scale for the correlation values.
    Figure \(\PageIndex{2}\): The Scale for the Correlation Values
    1. Compute \(r\) (correlation coefficient) using the formula, a calculator, or another technology.

    \(r = \dfrac{n(\sum xy)-(\sum x)(\sum y)}{\sqrt{[n(\sum x^2)-(\sum x)^2][n(\sum y^2)-(\sum y)^2]}}\)

    1. Determine if the null hypothesis (\(H_0\)) is rejected or not, and write out a summary statement.
    • If \(r\) falls in the left critical region (shaded area to the left of the left critical value), then reject \(H_0\) and there is a negative linear relationship.
    • If \(r\) falls in the non-critical region (between the two critical values), then do not reject \(H_0\), and there is no linear relationship.
    • If \(r\) falls in the right critical region (shaded area to the right of the right critical value), then reject \(H_0\) and there is a positive linear relationship.

    Example of a Test for Correlation

    Example \(\PageIndex{1}\)

    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 \). Please click on the link PMC table to access the table in the book.

    Bivariate Data
    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 Scores

    Solution
    1. Write out the claim and the null and alternative hypotheses.

    \(H_0: \rho = 0\) Claim

    \(H_1: \rho \neq 0\)

    1. Look up the critical values using the table below, using the given \(\alpha=0.05\).

    Since \(n\) represents the number of pairs, which is 8, then \(d.f. = 8 - 2 = 6\). Using the table above, the critical values are \(\pm 0.707\).

    1. Represent the range of correlation coefficient values on a spectrum of r values.
    The scale of the correlation coefficient values with critical values negative and positive 0.707.
    Figure \(\PageIndex{3}\): The Scale of the Correlation Coefficient Values With Critical Values \(\pm 0.707\)
    1. Compute \(r\) (correlation coefficient) using the formula, a calculator, or another technology.

    This value was computed in 10.2. It is \(r = 0.976\).

    1. Determine if the null hypothesis (\(H_0\)) is rejected or not, and write out a summary statement.
    The correlation coefficient value of r = 0.976 falls into the right critical region.
    Figure \(\PageIndex{4}\): The Correlation Coefficient Value of r = 0.976 Falls into the Right Critical Region

    Since \(r\) falls in the right critical region, reject \(H_0\) and there is a positive linear relationship.

    Example \(\PageIndex{2}\)

    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\). Please click on the link PMC table to access the table in the book.

    Bivariate Data
    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
    1. Write out the claim and the null and alternative hypotheses.

    \(H_0: \rho = 0\) Claim

    \(H_1: \rho \neq 0\)

    1. Look up the critical values using the table below using the given \(\alpha = 0.01\).

    Since \(n\) represents the number of pairs, which is 8, then \(d.f. = 7 - 2 = 5\). Using the table above, the critical values are \(\pm 0.875\).

    1. Represent the range of correlation coefficient values on a spectrum of r values.
    The scale of the correlation coefficient values with critical values positive and negative 0.875.
    Figure \(\PageIndex{5}\): The Scale of the Correlation Coefficient Values With Critical Values \(\pm 0.875\)
    1. Compute \(r\) (correlation coefficient) using the formula, a calculator, or another technology.

    A Ti-84+ was used to compute the value. It is \(r = -0.964\).

    1. Determine if the null hypothesis (\(H_0\)) is rejected or not, and write out a summary statement.
    The correlation coefficient value of r = -0.964 falls into the left critical region.
    Figure \(\PageIndex{6}\): The Correlation Coefficient Value of r = -0.964 Falls into the Left Critical Region

    Since \(r\) falls in the left critical region, reject \(H_0\), and there is a negative linear relationship.

    Example \(\PageIndex{3}\)

    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\). Please click on the link PMC table to access the table in the book.

    Bivariate Data
    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
    1. Write out the claim and the null and alternative hypotheses.

    \(H_0: \rho = 0\) Claim

    \(H_1: \rho \neq 0\)

    1. Look up the critical values using the table below, using the given \(\alpha=0.05\).

    Since \(n\) represents the number of pairs, which is 10, then \(d.f. = 10 - 2 = 8\). Using the table above, the critical values are \(\pm 0.632\).

    1. Represent the range of correlation coefficient values on a spectrum of r values.
    The scale of the correlation coefficient values with critical values positive and negative 0.632.
    Figure \(\PageIndex{7}\): The Scale of the Correlation Coefficient Values With Critical Values \(\pm 0.632\)
    1. Compute \(r\) (correlation coefficient) using the formula, a calculator, or another technology.

    A Ti-84+ was used to compute the value. It is \(r = -0.256\).

    1. Determine if the null hypothesis (\(H_0\)) is rejected or not, and write out a summary statement.
    The correlation coefficient value of r = -0.256 falls into the non-critical region.
    Figure \(\PageIndex{8}\): The Correlation Coefficient Value of r = -0.256 Falls into the Non-Critical Region

    Since \(r\) falls in the non-critical region, do not reject \(H_0\), and there is no linear relationship.


    This page titled 10.3: Hypothesis Test for Correlation Using r is shared under a CC BY 4.0 license and was authored, remixed, and/or curated by Toros Berberyan, Tracy Nguyen, and Alfie Swan.

    • Was this article helpful?