This page offers structured overviews of one or more selected methods. Add additional methods for comparisons by clicking on the dropdown button in the righthand column. To practice with a specific method click the button at the bottom row of the table
One categorical with $J$ independent groups ($J \geqslant 2$)
Null hypothesis
Null hypothesis
H_{0}: $\rho = \rho_0$
Here $\rho$ is the Pearson correlation in the population, and $\rho_0$ is the Pearson 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.
H_{0}: for each category $j$ of the dependent variable, $\pi_j$ for the first paired group = $\pi_j$ for the second paired group.
Here $\pi_j$ is the population proportion in category $j.$
Alternative hypothesis
Alternative hypothesis
H_{1} two sided: $\rho \neq \rho_0$
H_{1} right sided: $\rho > \rho_0$
H_{1} left sided: $\rho < \rho_0$
H_{1}: for some categories of the dependent variable, $\pi_j$ for the first paired group $\neq$ $\pi_j$ for the second paired group.
Assumptions of test for correlation
Assumptions
In the population, the two variables are jointly normally distributed (this covers the normality, homoscedasticity, and linearity assumptions)
Sample of pairs is a simple random sample from the population of pairs. That is, pairs are independent of one another
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.
Sample of pairs is a simple random sample from the population of pairs. That is, pairs are independent of one another
Test statistic
Test statistic
Test statistic for testing H0: $\rho = 0$:
$t = \dfrac{r \times \sqrt{N  2}}{\sqrt{1  r^2}} $
where $r$ is the sample correlation $r = \frac{1}{N  1} \sum_{j}\Big(\frac{x_{j}  \bar{x}}{s_x} \Big) \Big(\frac{y_{j}  \bar{y}}{s_y} \Big)$ and $N$ is the sample size
Test statistic for testing values for $\rho$ other than $\rho = 0$:
$r_{Fisher} = \dfrac{1}{2} \times \log\Bigg(\dfrac{1 + r}{1  r} \Bigg )$, where $r$ is the sample correlation
$\rho_{0_{Fisher}} = \dfrac{1}{2} \times \log\Bigg( \dfrac{1 + \rho_0}{1  \rho_0} \Bigg )$, where $\rho_0$ is the population correlation according to H0
Computing the test statistic is a bit complicated and involves matrix algebra. Unless you are following a technical course, you probably won't need to calculate it by hand.
where $r_{Fisher} = \frac{1}{2} \times \log\Bigg(\dfrac{1 + r}{1  r} \Bigg )$ and the critical value $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 the approximate $C$% confidence interval for $\rho$:
The Pearson correlation coefficient is a measure for the linear relationship between two quantitative variables.
The Pearson correlation coefficient squared reflects the proportion of variance explained in one variable by the other variable.
The Pearson correlation coefficient can take on values between 1 (perfect negative relationship) and 1 (perfect positive relationship). A value of 0 means no linear relationship.
The absolute size of the Pearson correlation coefficient is not affected by any linear transformation of the variables. However, the sign of the Pearson correlation will flip when the scores on one of the two variables are multiplied by a negative number (reversing the direction of measurement of that variable). For example:
the correlation between $x$ and $y$ is equivalent to the correlation between $3x + 5$ and $2y  6$.
the absolute value of the correlation between $x$ and $y$ is equivalent to the absolute value of the correlation between $3x + 5$ and $2y  6$. However, the signs of the two correlation coefficients will be in opposite directions, due to the multiplication of $x$ by $3$.
The Pearson correlation coefficient does not say anything about causality.
The Pearson correlation coefficient is sensitive to outliers.
Results significance test ($t$ and $p$ value) testing $H_0$: $\beta_1 = 0$ are equivalent to results significance test testing $H_0$: $\rho = 0$

Example context
Example context
Is there a linear relationship between physical health and mental health?
Subjects are asked to taste three different types of mayonnaise, and to indicate which of the three types of mayonnaise they like best. They then have to drink a glass of beer, and taste and rate the three types of mayonnaise again. Does drinking a beer change which type of mayonnaise people like best?