Identifying Comparable Firms
The first step in relative valuation is to identify comparable companies. Suppose you determined that the subject firm is comparable to midcap pharmaceutical companies. One definition of midcap (or middle capitalization) firms is that these are firms with market capitalization between $2 and $10 billion. Suppose you have collected information on the components of the S&P 400 Midcap Index and have stored them in the midcap400
data object. You identified the companies classified as "Pharmaceuticals" in the gics_subindustry
column as the appropriate industry group for your analysis. In this exercise, you are asked to extract the firms classified as "Pharmaceuticals" from the data.
This exercise is part of the course
Equity Valuation in R
Exercise instructions
- Review the first six rows of
midcap400
. - Extract the Pharmaceutical firms from the data using the
subset()
command.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Review the first six rows of midcap400
___
# Subset Pharmaceuticals firms
pharma <- ___
pharma