On what basis are the countries grouped into regions?

The division of the world into 5 major areas which are subdivided into 22 regions follows the groupings of countries used by the United Nations Statistics Division in its reporting. See: http://unstats.un.org/unsd/methods/m49/m49regin.htm