The beta coefficient is an indicator of the correlation of a stock (or a portfolio) compared to the overall market to which it belongs.
Using a statistical approach, we analyze the historical returns of a company and the overall market. Therefore, we can identify what happened with the stock when the market went up/down and consider it an indication for the future.
The formula to calculate the Beta of a stock is:
\[ \beta = \frac{\text{Covariance}(r_{\text{market}}, r_{\text{stock}})}{\text{Variance}(r_{\text{market}})} \]
Let's assume the following historical prices:
The returns for the stock and market are calculated, followed by the covariance and variance to find the Beta.