Peer Comparison
Compare every company with its peers on valuation, profitability, growth and leverage. For each metric it shows the company’s latest value, the median and mean of its peers and the company’s percentile among them (the share of peers with a lower value), which tells at a glance whether a company is expensive or cheap, and better or worse run, than comparable companies.
The metrics are the Price-to-Earnings, EV-to-EBITDA, Price-to-Book and Price-to-Sales ratios, the Gross, Operating and Net Profit Margin, the Return on Equity and on Invested Capital, Revenue Growth, the Debt-to-Equity ratio and the Dividend Yield, all of the latest fiscal year.
The Peer Mean of the four valuation multiples is the harmonic mean of the positive values, the standard average of multiples: the arithmetic mean is dominated by peers with earnings (or book value, or sales) close to zero, and a negative multiple says nothing about the price paid. The other metrics use the arithmetic mean.
For more information, see the following papers:
- Baker, M. and Ruback, R.S. (1999). “Estimating Industry Multiples.” Working paper, Harvard University.
- Liu, J., Nissim, D. and Thomas, J. (2002). “Equity Valuation Using Multiples.” Journal of Accounting Research, 40(1), 135-172.
Also known as: comparable companies analysis, comps, relative valuation, peer group analysis.
Peer Comparison in Python or via the MCP
Install the Finance Toolkit with:
pip install financetoolkit -U
Then call get_peer_comparison as shown below.
from financetoolkit import Toolkit
toolkit = Toolkit(
["MSFT"],
api_key="FINANCIAL_MODELING_PREP_KEY",
start_date="2021-01-01",
end_date="2025-12-31",
)
toolkit.models.get_peer_comparison()
Or, after setting up the Finance Toolkit MCP, ask:
How does Microsoft compare with its peers on valuation, margins, returns, growth and leverage, based on 2021 to 2025?
Which returns:
| Company | Peer Median | Peer Mean | Percentile | Peers | |
|---|---|---|---|---|---|
| (‘MSFT’, ‘Price-to-Earnings’) | 29.2276 | 30.5776 | 27.5171 | 0.5 | 10 |
| (‘MSFT’, ‘EV-to-EBITDA’) | 20.7309 | 19.8087 | 17.9245 | 0.5 | 10 |
| (‘MSFT’, ‘Price-to-Book’) | 8.8365 | 7.2576 | 6.1536 | 0.6 | 10 |
| (‘MSFT’, ‘Price-to-Sales’) | 11.7803 | 6.1724 | 4.2807 | 0.9 | 10 |
| (‘MSFT’, ‘Gross Margin’) | 0.6794 | 0.6242 | 0.6164 | 0.6 | 10 |
| (‘MSFT’, ‘Operating Margin’) | 0.4678 | 0.1998 | 0.2226 | 1 | 10 |
| (‘MSFT’, ‘Net Profit Margin’) | 0.4031 | 0.1682 | 0.187 | 1 | 10 |
| (‘MSFT’, ‘Return on Equity’) | 0.3404 | 0.2392 | 0.287 | 0.6 | 10 |
| (‘MSFT’, ‘Return on Invested Capital’) | 0.209 | 0.1001 | 0.1434 | 0.8 | 10 |
| (‘MSFT’, ‘Revenue Growth’) | 0.1779 | 0.1146 | 0.128 | 0.8 | 10 |
| (‘MSFT’, ‘Debt-to-Equity’) | 0.2912 | 0.3313 | 0.7928 | 0.5 | 10 |
| (‘MSFT’, ‘Dividend Yield’) | 0.0052 | 0.0088 | 0.0096 | 0.4 | 10 |
Parameters
get_peer_comparison accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
peers | dict[str, list[str]] | None | The peers per ticker, e.g. {“AAPL”: [“MSFT”, “GOOGL”]}. Defaults to None, which uses the peers Financial Modeling Prep lists for each company (same sector and exchange, similar size). | None, which uses the peers Financial Modeling Prep lists for each company (same sector and exchange, similar size) |
rounding | int | None | The number of decimals to round the results to. Defaults to None, which uses the Toolkit’s rounding. | 2 |