So we know if there are 5 groups/dozens of Monarch butterflies, there are 2 groups/dozens of Queen butterflies. In other words, there are 5 Monarch butterflies for every 2 Queen butterflies.
Then we can turn that into an equation.

From the last equation we wrote we can see that the total number of butterflies in the farm is

.
When we compare the Queen butterflies to total butterflies, we get

The ratio of Queen butterflies to total butterflies is 2:7.