How Do I Calculate Correlation Between Market Indicators and Specific Stocks?

You can calculate the correlation coefficient to find the correlation between any two variables, whether they are market indicators, stocks, or anything else that can be tracked numerically.

In statistics, correlation is the scaled version of covariance, which measures whether variables are positively or inversely related. Correlation is a very important concept in technical stock market analysis, as it makes it possible to guess at the mechanics of price patterns.

Key Takeaways

  • In statistics, correlation is the scaled version of covariance, which measures whether variables are positively or inversely related. 
  • Correlation is a very important concept in technical stock market analysis, as it makes it possible to guess at the mechanics of price patterns.
  • If a market indicator tends to rise at the same time that a specific stock rises in price and both variables tend to move in the same direction over time, then they are said to be positively correlated. 
  • Correlation is measured through the correlation coefficient, which always returns a value between +1.0 (perfectly positively correlated) and -1.0 (perfectly negatively correlated).
  • Most calculators and some software, like Excel, can perform these functions much more easily than calculation by hand.

Understanding Correlation

Suppose a market indicator, such as total consumer spending, tends to rise at the same time that a specific stock rises in price. Since both variables tend to move in the same direction over time, they are said to be positively correlated. If the stock's price tended to decline when total consumer spending rose, the two variables would be inversely correlated. However, correlation is never synonymous with causation.

Correlation is measured through the correlation coefficient. The correlation coefficient always returns a value between +1.0 (perfectly positively correlated) and -1.0 (perfectly negatively correlated); a correlation coefficient of zero has no predictive power and is of little use to the technical analyst.

Calculating the Correlation Coefficient

There are several different methods for finding the correlation coefficient. Every correlation coefficient formula requires time series data for the variables being considered. Get the right data for the market indicator and the specific stock's prices.

The easiest way to calculate correlation is to use some kind of software, such as the =CORREL() function in Excel. You can perform the calculation without these tools, however. The most mathematically sound method is to find the covariance for the two variables and the standard deviations of each variable, then use the following formula:

Correlation Coefficient = C O V S D M I   ×   S D S P where: C O V = Market indicator, stock price S D M I = Standard deviation for market indicator S D S P = Standard deviation for stock price \begin{aligned} &\text{Correlation Coefficient}=\frac{COV}{SDMI\ \times\ SDSP}\\ &\textbf{where:}\\ &COV=\text{Market indicator, stock price}\\ &SDMI=\text{Standard deviation for market indicator}\\ &SDSP=\text{Standard deviation for stock price} \end{aligned} Correlation Coefficient=SDMI × SDSPCOVwhere:COV=Market indicator, stock priceSDMI=Standard deviation for market indicatorSDSP=Standard deviation for stock price

Finding the covariance and standard deviation for each variable can be a lengthy, involved process. However, most calculators and some software can perform these functions as well.

Investopedia does not provide tax, investment, or financial services and advice. The information is presented without consideration of the investment objectives, risk tolerance, or financial circumstances of any specific investor and might not be suitable for all investors. Investing involves risk, including the possible loss of principal.

Compare Mortgage Lenders
×
The offers that appear in this table are from partnerships from which Investopedia receives compensation. This compensation may impact how and where listings appear. Investopedia does not include all offers available in the marketplace.