# Regression Analysis in Finance

## Correlation Analysis


### Learning Outcomes

By the end of this section, you will be able to:
1. Calculate a correlation coefficient.
2. Interpret a correlation coefficient.
3. Test for the significance of a correlation coefficient.

### Calculate a Correlation Coefficient

In correlation analysis, we study the relationship between bivariate data, which is data collected on two variables where the data values are paired with one another.
Correlation is the measure of association between two numeric variables. For example, we may be interested to know if there is a correlation between bond prices and interest rates or between the age of a car and the value of the car. To investigate the correlation between two numeric quantities, the first step is to create a scatter plot that will graph the (x, y) ordered pairs. The independent, or explanatory, quantity is labeled as the x-variable, and the dependent, or response, quantity is labeled as the y-variable.
For example, we may be interested to know if the price of Nike stock is correlated with the value of the S&P 500 (Standard & Poor’s 500 stock market index). To investigate this, monthly data can be collected for Nike stock prices and value of the S&P 500 for a period of time, and a scatter plot can be created and examined. A scatter plot, or scatter diagram, is a graphical display intended to show the relationship between two variables. The setup of the scatter plot is that one variable is plotted on the horizontal axis and the other variable is plotted on the vertical axis. Each pair of data values is considered as an (x, y) point, and the various points are plotted on the diagram. A visual inspection of the plot is then made to detect any patterns or trends on the scatter diagram.  shows the relationship between the Nike stock price and its S&P value over a one-year time period.
To assess linear correlation, the graphical trend of the data points is examined on the scatter plot to determine if a straight-line pattern exists. If a linear pattern exists, the correlation may indicate either a positive or a negative correlation. A positive correlation indicates that as the independent variable increases, the dependent variable tends to increase as well, or, as the independent variable decreases, the dependent variable tends to decrease (the two quantities move in the same direction). A negative correlation indicates that as the independent variable increases, the dependent variable decreases, or, as the independent variable decreases, the dependent variable increases (the two quantities move in opposite directions). If there is no relationship or association between the two quantities, where one quantity changing does not affect the other quantity, we conclude that there is no correlation between the two variables.
From the scatter plot in the Nike stock versus S&P 500 example (see ), we note that the trend reflects a positive correlation in that as the value of the S&P 500 increases, the price of Nike stock tends to increase as well.
When inspecting a scatter plot, it may be difficult to assess a correlation based on a visual inspection of the graph alone. A more precise assessment of the correlation between the two quantities can be obtained by calculating the numeric correlation coefficient (referred to using the symbol r).
The correlation coefficient, which was developed by statistician Karl Pearson in the early 1900s, is a measure of the strength and direction of the correlation between the independent variable x and the dependent variable y.
The formula for r is shown below; however, technology, such as Excel or the statistical analysis program R, is typically used to calculate the correlation coefficient.
where n refers to the number of data pairs and the symbol  indicates to sum the x-values.
 provides a step-by-step procedure on how to calculate the correlation coefficient r.
Note that since r is calculated using sample data, r is considered a sample statistic used to measure the strength of the correlation for the two population variables. Sample data indicates data based on a subset of the entire population.
Given the complexity of this calculation, Excel or other software is typically used to calculate the correlation coefficient.
The Excel command to calculate the correlation coefficient uses the following format:
where A1:A10 are the cells containing the x-values and B1:B10 are the cells containing the y-values.

### Interpret a Correlation Coefficient

Once the value of r is calculated, this measurement provides two indicators for the correlation:
1. the strength of the correlation based on the value of r
2. the direction of the correlation based on the sign of r
The value of r gives us this information:
1. The value of r is always between  and : .
2. The size of the correlation r indicates the strength of the linear relationship between the two variables. Values of r close to  or to  indicate a stronger linear relationship.
3. If , there is no linear relationship between the two variables (no linear correlation).
4. If , there is perfect positive correlation.
5. If  there is perfect negative correlation. In both of these cases, all the original data points lie on a straight line.
The sign of r gives us this information:
1. A positive value of r means that when x increases, y tends to increase, and when x decreases, y tends to decrease (positive correlation).
2. A negative value of r means that when x increases, y tends to decrease, and when x decreases, y tends to increase (negative correlation).
The Excel command used to find the value of the correlation coefficient for the Nike stock versus S&P 500 example (refer back to ) is
In this example, the value of  is calculated by Excel to be .
Since this is a positive value close to 1, we conclude that the relationship between Nike stock and the value of the S&P 500 over this time period represents a strong, positive correlation.
The correlation coefficient r can also be determined using the statistical capability on the financial calculator:
1. Step 1 is to enter the data in the calculator (using the [DATA] function that is located above the 7 key).
2. Step 2 is to access the statistical results provided by the calculator (using the [STAT] function that is located above the 8 key) and scroll to the correlation coefficient results.
Follow the steps in  for calculating the correlation data for the data set of Nike stock price and value of the S&P 500 shown previously.
From the statistical results shown on the calculator display, the correlation coefficient r is 0.93, which indicates that the relationship between Nike stock and the value of the S&P 500 over this time period represents a strong, positive correlation.
Note: A strong correlation does not suggest that x causes y or y causes x. We must remember that correlation does not imply causation.

### Test a Correlation Coefficient for Significance

The correlation coefficient, r, tells us about the strength and direction of the linear relationship between x and y. The sample data are used to compute r, the correlation coefficient for the sample. If we had data for the entire population (that is, all measurements of interest), we could find the population correlation coefficient, which is labeled as the Greek letter ρ (pronounced “rho”). But because we have only sample data, we cannot calculate the population correlation coefficient. The sample correlation coefficient, r, is our estimate of the unknown population correlation coefficient.
1. ρ = population correlation coefficient (unknown)
2. r = sample correlation coefficient (known; calculated from sample data)
An important step in the correlation analysis is to determine if the correlation is significant. By this, we are asking if the correlation is strong enough to allow meaningful predictions for y based on values of x. One method to test the significance of the correlation is to employ a hypothesis test. The hypothesis test lets us decide whether the value of the population correlation coefficient ρ is close to zero or significantly different from zero. We decide this based on the sample correlation coefficient r and the sample size n.
If the test concludes that the correlation coefficient is significantly different from zero, we say that the correlation coefficient is significant.
1. Conclusion: There is sufficient evidence to conclude that there is a significant linear relationship between x and y variables because the correlation coefficient is significantly different from zero.
2. What the conclusion means: There is a significant linear relationship between the x and y variables. If the test concludes that the correlation coefficient is not significantly different from zero (it is close to zero), we say that the correlation coefficient is not significant.
A hypothesis test can be performed to test if the correlation is significant. A hypothesis test is a statistical method that uses sample data to test a claim regarding the value of a population parameter. In this case, the hypothesis test will be used to test the claim that the population correlation coefficient ρ is equal to zero.
Use these hypotheses when performing the hypothesis test:
1. Null hypothesis: 
2. Alternate hypothesis: 
The hypotheses can be stated in words as follows:
1. Null hypothesis : The population correlation coefficient is not significantly different from zero. There is not a significant linear relationship (correlation) between x and y in the population.
2. Alternate hypothesis : The population correlation coefficient is significantly different from zero. There is a significant linear relationship (correlation) between x and y in the population.
A quick shorthand way to test correlations is the relationship between the sample size and the correlation. If  then this implies that the correlation between the two variables demonstrates that a linear relationship exists and is statistically significant at approximately the 0.05 level of significance. As the formula indicates, there is an inverse relationship between the sample size and the required correlation for significance of a linear relationship. With only 10 observations, the required correlation for significance is 0.6325; for 30 observations, the required correlation for significance decreases to 0.3651; and at 100 observations, the required level is only 0.2000.
NOTE:
1. If r is significant and the scatter plot shows a linear trend, the line can be used to predict the value of y for values of x that are within the domain of observed x-values.
2. If r is not significant OR if the scatter plot does not show a linear trend, the line should not be used for prediction.
3. If r is significant and the scatter plot shows a linear trend, the line may not be appropriate or reliable for prediction outside the domain of observed x-values in the data.
Correlations may be helpful in visualizing the data, but they are not appropriately used to explain a relationship between two variables. Perhaps no single statistic is more misused than the correlation coefficient. Citing correlations between health conditions and everything from place of residence to eye color have the effect of implying a cause-and-effect relationship. This simply cannot be accomplished with a correlation coefficient. The correlation coefficient is, of course, innocent of this misinterpretation. It is the duty of analysts to use a statistic that is designed to test for cause-and-effect relationships and to report only those results, if they are intending to make such a claim. The problem is that passing this more rigorous test is difficult, therefore lazy and/or unscrupulous researchers fall back on correlations when they cannot make their case legitimately.

### 

Correlation is the measure of association between two numeric variables. A correlation coefficient called r is used to assess the strength and direction of the correlation. The value of r is always between  and . The size of the correlation r indicates the strength of the linear relationship between the two variables. Values of r close to  or to  indicate a stronger linear relationship. A positive value of r means that when x increases, y tends to increase and when x decreases, y tends to decrease (positive correlation). A negative value of r means that when x increases, y tends to decrease and when x decreases, y tends to increase (negative correlation).