Between 2011 and 2013, more than 40,000 people in 40 countries were asked to answer this question. Here's what the world looks like, according to what people think about the connection between faith and ethics:

Some of the results aren't surprising: Almost everyone surveyed in Pakistan, Ghana, and Indonesia said that belief in God is necessary to be a moral person, which matches the high levels of religious affiliation in those countries. Meanwhile, less than a fifth of people in France, Spain, and Great Britain agreed.

But some trends stick out. In China, only 14 percent of people agreed that faith is essential for good values. Greece was more fervent than the rest of Europe, with almost half of respondents agreeing that God is necessary for morality. And the United States continued its tradition of defying religious patterns in the rest of the West and developed world: Compared to people in other countries with a similar per-capita GDP, U.S. respondents were much more likely to say that belief in God is necessary to be a good person.

In fact, when Pew mapped these views on morality again national wealth, it found that people in rich countries are less likely to equate faith with ethics than people in poorer countries, with two exceptions: America and China.

Pew Research Center

The data also reveals subtle cultural divides among countries that are often lumped together. Take the variation among Middle Eastern nations, for example. Pew found similar results in Egypt and Jordan, where roughly 95 percent of people agreed that belief is a necessary element of morality. But the response in Lebanon, which is roughly 150 miles north of Egypt and 50 miles northwest of Jordan, was wildly different: 30 percent of people said God doesn't have to be part of morality. This contrast would be masked in a straightforward comparison of religious affiliation among these countries. Although Lebanon has a significantly larger population of Christians than either Egypt or Jordan does, all three have roughly the same percentage of non-religious people: less than 1 percent. The graph below shows religious affiliation in these three countries; the big chunks of baby blue represents Islam, red refers to Christianity, and the green (barely visible) captures those who are unaffiliated.