The dismal science is tapping big data to measure happiness.

A new benchmark out Thursday examines countries not on economic measures such as gross domestic product, but rather on the well-being of their population, in such areas as nutrition, basic medical care, shelter and environmental sustainability.

The U.S. ranked sixth overall in the...