Comparative advantage is an economic term that refers to an economy’s ability to produce goods and services at a lower opportunity cost than that of trade partners.
The law of comparative advantage describes how, under free trade, an agent will produce more of and consume less of a good for which they have a comparative advantage.
Formula to calculate comparative advantage.

Example:
Suppose Kenya produces 50,000 tonnes of soda ash and 30,000 tonnes of tea. Calculate Kenya’s the comparative advantage.

Therefore, Kenya’s comparative advantage is 166.67.