A scatter plot shows the association between two variables. A scatter plot matrix shows all pairwise scatter plots for many variables.

If the variables tend to increase and decrease together, the association is positive. If one variable tends to increase as the other decreases, the association is negative. If there is no pattern, the association is zero.
When a straight line describes the relationship between the variables, the association is linear. When a constantly increasing or decreasing nonlinear function describes the relationship, the association is monotonic. Other relationships may be nonlinear or non-monotonic.
The type of relationship determines the statistical measures and tests of association that are appropriate.
If the association is a linear relationship, a bivariate normal density ellipse summarizes the correlation between variables. The narrower the ellipse, the greater the correlation between the variables. The wider and more round it is, the more the variables are uncorrelated. If the association is nonlinear, it is often worth trying to transform the data to make the relationship linear as there are more statistics for analyzing linear relationships and their interpretation is easier than nonlinear relationships.
An observation that appears detached from the bulk of observations may be an outlier requiring further investigation. An individual observation on each of the variables may be perfectly reasonable on its own but appear as an outlier when plotted on a scatter plot. Outliers can badly affect the product-moment correlation coefficient, whereas other correlation coefficients are more robust to them.
Visualize the relationships between two or more variables.
Covariance is a measure of how much two variables change together. A covariance matrix measures the covariance between many pairs of variables.
When the variables tend to show similar behavior, the covariance is positive. That is when greater values of one variable mainly correspond with the greater values of the other variable, or lesser values of one variable correspond with lesser values of the other variable. When the variables tend to show opposite behavior, the covariance is negative. That is when the greater values of one variable mainly correspond to the lesser values of the other and vice-versa.
The magnitude of the covariance is not meaningful to interpret. However, the standardized version of the covariance, the correlation coefficient, indicates by its magnitude the strength of the relationship.
A covariance matrix measures the covariance between many variables. Because the covariance of a variable with itself is that variable's variance, the diagonal of the covariance matrix is simply the variance of each variable.
A correlation coefficient measures the association between two variables. A correlation matrix measures the correlation between many pairs of variables.
The type of relationship between the variables determines the best measure of association:
The correlation coefficient ranges from -1 to +1. +1 indicates a perfect positive linear relationship, and -1 indicates a perfect negative linear relationship. Zero indicates the variables are uncorrelated and there is no linear relationship. Normally the correlation coefficient lies somewhere between these values.
Rank correlation coefficients range from -1 to +1. A positive rank correlation coefficient describes the extent to which as one variable increases the other variable also tends to increase, without requiring that increase to be linear. If one variable increases, as the other tends to decrease, the rank correlation coefficient is negative.
It is best to use a scatter plot to identify the type of association between the variables and then use an appropriate measure of association for the relationship. Do not be tempted just to look for the highest correlation coefficient.
A correlation matrix measures the correlation between many variables. It is equivalent to a covariance matrix of the standardized variables.
A color map highlights the sign and magnitude of coefficients in a patterned matrix.

Red indicate negative values, blue indicates positive values. Intensity of the color represents the magnitude of the value, the darker more extreme.
Measure the correlation / association between 2 or more variables.
Measure the covariance between 2 or more variables.
Inferences about the strength of association between variables are made using a random bivariate sample of data drawn from the population of interest.
Do not be fooled into thinking a significant correlation implies you to make statements about causation.
Correlation does not imply causation is a reminder that although a statistically significant correlation might exist between two variables, it does not imply that one causes the other.
There are many reasons why correlation does not imply causation: reverse causation where causation is actually in the opposite direction; bidirectional causation where a change in one variable causes a change in the other and vice-versa; a third unobserved variable that is the actual cause of the correlation; or simply a coincidence.
Correlation is a hint to investigate further, where possible using a controlled experiment. In some fields controlled experiments are impossible. Instead, cause and effect can be established only by observing the same thing in a wide variety of scenarios until all but the suspected cause can be ruled out. Even then the causal relationship can only be confirmed when you discover the underlying mechanism of the cause and effect.
A parameter estimate is either a point or interval estimate of the unknown population correlation coefficient.
A point estimate is a single value that is the best estimate of the true unknown population correlation coefficient; a confidence interval is a range of values and indicates the uncertainty of the estimate.
Estimators for correlation/association and their properties and assumptions.
| Estimator | Purpose |
|---|---|
| Pearson r | Estimate the Pearson rho correlation coefficient using the sample Pearson correlation coefficient r. Use when a linear function best describes the relationship between the variables. Susceptible to outliers. Assumes a bivariate normal distribution. |
| Spearman rs | Estimate the Spearman rho rank correlation coefficient using the sample Spearman rs correlation coefficient. Use when a monotonic function best describes the relationship between variables. |
| Kendall tau | Estimate the Kendall tau rank correlation coefficient. Use when a monotonic function best describes the relationship between the variables. Preferred instead of Spearman correlation because Kendall's tau is the difference between the probability that the two variables are in the same order, versus the probability that the two variables are in different orders. Robust to outliers. |
Estimate the correlation/association between pairs of variables.
A hypothesis test formally tests if there is correlation/association between two variables in a population.
The hypotheses to test depends on the type of association:
When the test p-value is small, you can reject the null hypothesis and conclude that the population correlation coefficient is not equal to the hypothesized value, or for rank correlation that the variables are not independent. It is important to remember that a statistically significant test may not have any practical importance if the correlation coefficient is very small.
Pearson's and Kendall's tests are preferred as both have associated estimators of the population correlation coefficient (rho and tau respectively). Although the Spearman test is popular due to the ease of computation, the Spearman correlation coefficient is a measure of the linear association between the ranks of the variables and not the measure of association linked with the Spearman test.
Test if the correlation between 2 variables is equal to a hypothesized value, or test for independence.
Multivariate analysis study requirements and dataset layout.
Use a a column for each variable (Height, Weight); each row has the values of the variables for a case (Subject).
| Subject (optional) | Height | Weight |
|---|---|---|
| 1 | 175 | 65 |
| 2 | 180 | 70 |
| 3 | 160 | 90 |
| 4 | 190 | 55 |
| 5 | 180 | 100 |
| 6 | 150 | 55 |
| 7 | 140 | 75 |
| 8 | 160 | 80 |
| 9 | 165 | 80 |
| 10 | 180 | 95 |
| … | … | … |