Pearson correlation

This page offers all the basic information you need about the Pearson correlation coefficient and its significance test and confidence interval. It is part of Statkat’s wiki module, containing similarly structured info pages for many different statistical methods. The info pages give information about null and alternative hypotheses, assumptions, test statistics and confidence intervals, how to find p values, SPSS how-to’s and more.

To compare the Pearson correlation coefficient with other statistical methods, go to Statkat's or practice with the Pearson correlation coefficient at Statkat's

Contents

When to use?

Deciding which statistical method to use to analyze your data can be a challenging task. Whether a statistical method is appropriate for your data is partly determined by the measurement level of your variables. The Pearson correlation coefficient requires the following variable types:

Variable types required for the Pearson correlation coefficient :
Variable 1:
One quantitative of interval or ratio level
Variable 2:
One quantitative of interval or ratio level

Note that theoretically, it is always possible to 'downgrade' the measurement level of a variable. For instance, a test that can be performed on a variable of ordinal measurement level can also be performed on a variable of interval measurement level, in which case the interval variable is downgraded to an ordinal variable. However, downgrading the measurement level of variables is generally a bad idea since it means you are throwing away important information in your data (an exception is the downgrade from ratio to interval level, which is generally irrelevant in data analysis).

If you are not sure which method you should use, you might like the assistance of our method selection tool or our method selection table.

Null hypothesis

The test for the Pearson correlation coefficient tests the following null hypothesis (H0):

H0: $\rho = \rho_0$

$\rho$ is the unknown Pearson correlation in the population, $\rho_0$ is the correlation in the population according to the null hypothesis (usually 0). The Pearson correlation is a measure for the strength and direction of the linear relationship between two variables of at least interval measurement level.
Alternative hypothesis

The test for the Pearson correlation coefficient tests the above null hypothesis against the following alternative hypothesis (H1 or Ha):

H1 two sided: $\rho \neq \rho_0$
H1 right sided: $\rho > \rho_0$
H1 left sided: $\rho < \rho_0$
Assumptions of test for correlation

Statistical tests always make assumptions about the sampling procedure that's been used to obtain the sample data. So called parametric tests also make assumptions about how data are distributed in the population. Non-parametric tests are more 'robust' and make no or less strict assumptions about population distributions, but are generally less powerful. Violation of assumptions may render the outcome of statistical tests useless, although violation of some assumptions (e.g. independence assumptions) are generally more problematic than violation of other assumptions (e.g. normality assumptions in combination with large samples).

The test for the Pearson correlation coefficient makes the following assumptions:

Note: these assumptions are only important for the significance test and confidence interval, not for the correlation coefficient itself. The correlation coefficient just measures the strength of the linear relationship between two variables.
Test statistic

The test for the Pearson correlation coefficient is based on the following test statistic:

Test statistic for testing H0: $\rho = 0$: Test statistic for testing values for $\rho$ other than $\rho = 0$:
Sampling distribution

Sampling distribution of $t$ and of $z$ if H0 were true:

Sampling distribution of $t$: Sampling distribution of $z$:
Significant?

This is how you find out if your test result is significant:

$t$ Test two sided: $t$ Test right sided: $t$ Test left sided: $z$ Test two sided: $z$ Test right sided: $z$ Test left sided:
Approximate $C$% confidence interval for $\rho$

First compute approximate $C$% confidence interval for $\rho_{Fisher}$: where $r_{Fisher} = \frac{1}{2} \times \log\Bigg(\dfrac{1 + r}{1 - r} \Bigg )$ and $z^*$ is the value under the normal curve with the area $C / 100$ between $-z^*$ and $z^*$ (e.g. $z^*$ = 1.96 for a 95% confidence interval).
Then transform back to get approximate $C$% confidence interval for $\rho$:
Properties of the Pearson correlation coefficient

Equivalent to

The test for the Pearson correlation coefficient is equivalent to:

OLS regression with one independent variable:
Example context

The test for the Pearson correlation coefficient could for instance be used to answer the question:

Is there a linear relationship between physical health and mental health?
SPSS

How to compute thePearson correlation coefficient in SPSS:

Analyze > Correlate > Bivariate...
Jamovi

How to compute thePearson correlation coefficient in jamovi:

Regression > Correlation Matrix