ArticleslgStudy

mathematics

Correlation

Correlation is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Correlation rather than just read about it. In short: In statistics, correlation is a type of statistical relationship between two random variables or bivariate data. It usually refers to the extent to which a pair of quantities are linearly related.

Correlation — main illustration
Correlation — illustration

Key takeaways

  • Correlation belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Correlation to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Correlation from memory before moving on to harder problems.

Reference excerpt

In statistics, correlation is a type of statistical relationship between two random variables or bivariate data. It usually refers to the extent to which a pair of quantities are linearly related. More generally, an arbitrary relationship between variables is called an association, meaning the degree to which the variability in one can be accounted for by the other. The presence of a correlation is not sufficient to infer the presence of a causal relationship, and this is often stated as "correlation does not imply causation". Furthermore, the concept of correlation is not the same as dependence: if two variables are independent, then they are uncorrelated, but the opposite is not necessarily true – even if two variables are uncorrelated, they might be dependent on each other. Correlations are useful because they can indicate a predictive relationship that can be exploited in practice. For example, an electrical utility may produce less power on a mild day based on the correlation between electricity demand and weather. In this example, there is a causal relationship because extreme weather causes people to use more electricity for heating or cooling. There are several correlation coefficients that may be used to measure correlation, often denoted ρ or r. The most common of these is the Pearson correlation coefficient, which is sensitive only to a linear relationship between two variables (which in turn may be present even when one variable is a nonlinear function of the other). Other correlation coefficients, such as Spearman's rank correlation coefficient, have been developed to be more robust than Pearson's and to detect less structured relationships between variables. The concept has been generalized to other forms of association between two variables, such as mutual information and distance covariance.

Coefficients

Pearson's product-moment coefficient

The most familiar measure of dependence between two quantities is the Pearson product-moment correlation coefficient, most commonly called "Pearson's correlation coefficient" or simply "the correlation coefficient" (as it is the most common variant). It is obtained by taking the ratio of the covariance between two variables of a numerical dataset normalized to the square root of their variances. Equivalently, Pearson's correlation coefficient can be calculated by dividing the covariance of the two variables by the product of their standard deviations. Karl Pearson developed the coefficient from a similar idea by Francis Galton. A Pearson product-moment correlation coefficient attempts to establish a line of best fit through a dataset of two variables by essentially laying out the expected values and the resulting Pearson's correlation coefficient indicates how far away the actual dataset is from the expected values. Depending on the sign of the Pearson's correlation coefficient, the result can be either a negative or positive correlation if there is any sort of relationship between the variables in the dataset. The population correlation coefficient ρX,Y between two random variables X and Y with expected values μX and μY and standard deviations σX and σY is defined as: ρX,Y=corr⁡(X,Y)=cov⁡(X,Y)σXσY=E⁡[(X−μX)(Y−μY)]σXσY,if σXσY>0. where E is the expected value operator, cov means covariance, and corr is a widely used alternative notation for the correlation coefficient. The Pearson correlation is defined only if both standard deviations are finite and positive. An alternative formula purely in terms of moments is: ρX,Y=E⁡(XY)−E⁡(X)E⁡(Y)E⁡(X2)−E⁡(X)2⋅E⁡(Y2)−E⁡(Y)2

Correlation and independence It is a corollary of the Cauchy–Schwarz inequality that the absolute value of the Pearson correlation coefficient is not bigger than 1. Therefore, the value of a correlation coefficient ranges between −1 and +1. The correlation coefficient is +1 in the case of a perfect direct (increasing) linear relationship (correlation), −1 in the case of a perfect inverse (decreasing) linear relationship (anti-correlation), and some value in the open interval (−1,1) in all other cases, indicating the degree of linear dependence between the variables. As it approaches zero there is less of a relationship (closer to uncorrelated). The closer the coefficient is to either −1 or 1, the stronger the correlation between the variables. If the variables are independent, Pearson's correlation coefficient is 0. However, because the correlation coefficient detects only linear dependencies between two variables, the converse is not necessarily true. A correlation coefficient of 0 does not imply that the variables are independent. X,Y independent⇒ρX,Y=0(X,Y uncorrelated)ρX,Y=0(X,Y uncorrelated)⇏X,Y independent For example, suppose the random variable X is symmetrically distributed about zero, and Y=X2. Then Y is completely determined by X, so that X and Y are perfectly dependent, but their correlation is zero; they are uncorrelated. However, in the special case when X and Y are jointly normal, uncorrelatedness is equivalent to independence. Even though uncorrelated data do not necessarily imply independence, one can check if random variables are independent if their mutual information is 0.

Sample correlation coefficient Given a series of n measurements of the pair (Xi,Yi) indexed by i=1,…,n, the sample correlation coefficient can be used to estimate the population Pearson correlation ρX,Y between X and Y. The sample correlation coefficient is defined as

rxy=def∑i=1n(xi−x¯)(yi−y¯)(n−1)sxsy=∑i=1n(xi−x¯)(yi−y¯)∑i=1n(xi−x¯)2∑i=1n(yi−y¯)2, where x‾ and y‾ are the sample means of X and Y, and sx and sy are the corrected sample standard deviations of X and Y. Equivalent expressions for rxy are

rxy=∑xiyi−nx¯y¯ns'xs'y=n∑xiyi−∑xi∑yin∑xi2−(∑xi)2 n∑yi2−(∑yi)2. where s'x and s'y are the uncorrected sample standard deviations of X and Y. If x and y are results of measurements that contain measurement error, the realistic limits on the correlation coefficient are not −1 to +1 but a smaller range. For the case of a linear model with a single independent variable, the coefficient of determination (R squared) is the square of rxy, Pearson's product-moment coefficient.

Example Consider the joint probability distribution of X and Y given in the table below.

For this joint distribution, the marginal distributions are:

P(X=x)={13for x=023for x=1 P(Y=y)={13for y=−113for y=013for y=1 This yields the following expectations and variances:

μX=23 μY=0 σX2=29 σY2=23 Therefore:

… excerpt ends here. Continue reading the full article.

Illustrations

Correlation: Several sets of (x, y) points, with the Pearson correlation coefficient of x and y for each set. The correlation reflects the noisiness and direction of a linear relationship (top row), but not the slope of that relationship (middle), nor many aspects of nonlinear relationships (bottom). N.B.: the figure in the center has a slope of 0 but in that case, the correlation coefficient is undefined because the variance of Y is zero.
Several sets of (x, y) points, with the Pearson correlation coefficient of x and y for each set. The correlation reflects the noisiness and direction of a linear relationship (top row), but not the slope of that relationship (middle), nor many aspects of nonlinear relationships (bottom). N.B.: the figure in the center has a slope of 0 but in that case, the correlation coefficient is undefined because the variance of Y is zero.
Correlation: Example scatterplots of various datasets with various correlation coefficients
Example scatterplots of various datasets with various correlation coefficients
Correlation: Anscombe's quartet: four sets of data with the same correlation of 0.816
Anscombe's quartet: four sets of data with the same correlation of 0.816
Correlation: Correlations among 4 variables visualized by the 50% and 95% confidence ellipses.
Correlations among 4 variables visualized by the 50% and 95% confidence ellipses.
Correlation: Pearson/Spearman correlation coefficients between X and Y are shown when the two variables' ranges are unrestricted, and when the range of X is restricted to the interval (0,1).
Pearson/Spearman correlation coefficients between X and Y are shown when the two variables' ranges are unrestricted, and when the range of X is restricted to the interval (0,1).

Worked examples

Example 1 — a first encounter with Correlation

Start with the simplest possible case. Write down what Correlation claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Correlation before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Correlation ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Correlation

In research
Correlation appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Correlation in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Correlation is common in secondary-school and first-year university syllabi. It links to neighbouring topics Covariance and correlation, Dimensionless numbers, so understanding it makes those chapters shorter.
In everyday life
Look for Correlation outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Correlation” →

How to study Correlation in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Correlation means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Correlation out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Correlation in simple terms?

In statistics, correlation is a type of statistical relationship between two random variables or bivariate data. It usually refers to the extent to which a pair of quantities are linearly related.

Why does Correlation matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Correlation?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Correlation.

Tags

  • Covariance and correlation
  • Dimensionless numbers

Keep exploring