Generating relative valuations
One of the most interesting things that you can do with stock market data is come up with a valuation model. The ultimate goal is to arrive at a decision about whether the stock might be overvalued or undervalued. There are two main ways to do this. Intrinsic valuation is generally more time consuming because it involves digging into the financial statements of a company to arrive at a valuation decision. The alternative method is relative valuation which will quickly provide a sense of how the stock is valued, but does not take into account a comprehensive set of factors. The basic idea is that it compares a stock's price and valuation ratios to similar stocks to arrive at a conclusion. In this section, we will value stocks using the simpler relative valuation method.
Getting ready
This recipe requires the data downloaded and cleaned in the previous recipes.
How to do
We will essentially do three major things in this section. First, we calculate sector averages...