An analysis by Forbes magazine of the “most livable” places in the nation puts three Massachusetts cities and their surrounding areas among the top 15 nationwide.

The Massachusetts cities identified by Forbes are Cambridge, Peabody and Worcester, but the rankings are based on surrounding “metropolitan statistical areas,” as defined by the U.S. Office of Management and Budget. In the case of Cambridge, the metropolitan area is defined as a swath of Middlesex County that includes Newton and Framingham; the Peabody metropolitan area includes much of Essex County.

Forbes based the rankings on five criteria: income growth per household; cost of living; crime data; a “leisure index”; and unemployment statistics.

Cambridge-Newton-Framingham ranked seventh on the list, Worcester ninth, and Peabody 14th. Portland, Maine, was ranked first, and Stamford, Conn., fourth. Nine of the fifteen metropolitan areas are in New England, Pennsylvania or Maryland.

+
+