Perhaps unexpectedly, the beautiful northern European country of Denmark emerged as a topic of conversation during last night’s Democratic Party presidential debate. The small Scandinavian monarchy plays an important role in progressive mythology. It is a place that many liberals want America to become, and both Senator Sanders and Secretary Clinton sung its praises last night. A closer look at Denmark’s public policies is, therefore, warranted. It yields some surprising results.

First, in terms of national well-being, the United States performs slightly better than Denmark. The United Nation’s Human Development Index, which is a composite measure of human well-being based on educational attainment, life expectancy and income, ranked the United States in 5th place and Denmark in 8th place in 2013. On a scale from 0 (worst) to 1 (best), the United States scored 0.91, while Denmark scored 0.9.

Second, in some important ways, Denmark is not a socialist paradise that Senator Sanders imagines it to be. The World Bank’s Doing Business report measures the ease of doing business around the world on a scale from 0 (worst) to 100 (best). In 2015, Denmark scored 84.2, while the United States scored 81.98. As such, Denmark had the 4th most welcoming business environment in the world and the United States 7th. Put differently, Denmark is embracing the private sector with greater gusto than the land of the free and the home of the brave.

Similarly, the Fraser Institute’s 2015 “Economic Freedom of the World” report found that the overall level of economic freedom in the United States and Denmark is almost identical. The United States came in the fourteenth place, while Denmark was seventeenth. On a scale from 0 (worst) to 10 (best), the United States received 7.73, while Denmark received 7.63. If Denmark is socialist, then surely the United States is socialist, too.

Crucially for both Senator Sanders, long an unabashed protectionist, and Secretary Clinton, who has recently backpedaled in her support for trade liberalization, Danish trade with the rest of the world is much freer than America’s. Again turning to Canada’s Fraser Institute, Denmark had the world’s 14th most liberal trade regime in 2013. The United States came in a miserable 41st place out of 115 countries surveyed.

Of course, there are other important differences between the United States and Denmark. And none more relevant than the “size of government,” which is a proxy measure for taxation and redistribution. Of the 123 countries surveyed by the Fraser Institute, Denmark came in 119th place, while the United States came in 55th place.

If this is what Senator Sanders means by wanting America to resemble Denmark, he needs to be careful about the unintended consequences of a large increase in taxation and welfare spending.

As people grow more reliant on the state, they tend to see the arrival of newcomers as threatening. Immigration, for example, is thus increasingly seen as a zero-sum game. Not surprisingly, the Danes have grown more hostile to immigration as the number of immigrants to Denmark increased.

The Danish response to immigration is consistent with the research by Professor Alberto Alesina of Harvard University who pointed out the correlation between relatively high levels of taxation and redistribution, and homogeneity of the local population.

Denmark is a perfect example of a homogeneous polity with a large welfare state. Of the 5.7 million people who live in Denmark, 88 percent are of Danish (Nordic) descent and 78 percent belong to the Danish Lutheran Church.

Creation of a large welfare state, in other words, can heighten animosities between indigenous population and immigrants, or distinct religious and ethnic groups. Senator Sanders ought to appreciate that the Danish level of taxation and redistribution would likely result in greater hostility toward immigrants and greater social strife in the United States as well.

In many ways, Denmark is a magnificent country and the Danes rank among the happiest people on the planet. But Denmark is neither the socialist paradise that Senator Sanders makes it out to be, nor is its size of government a good role model for the United States.

The first appeared in Cato at Liberty.