Emmanuel D’Souza, a nurse practitioner in Dayton, Ohio, who emigrated from India in 2004, said he has noticed a growing and thriving Indian population in his area.

“Now when you go to the grocery store at 5 or 6 in the evening, you see a lot of Indian people, buying vegetables after work,” said Mr. D’Souza.

He said he saw fewer Indian people when he bought his house in 2009 than he does today. Now he counted at least four temples and two mosques, and said there are two Indian specialty grocery stores. Mr. D’Souza, 41, who is Catholic, also sees Indians in church on Sundays.

The data also suggests a political pattern among states with large percentages of foreign-born residents. Of the 15 states with the highest concentration of immigrants, all but three — Florida, Texas and Arizona — voted for Hillary Clinton in the 2016 presidential race. Many of the states with low and moderate concentrations of foreign-born people voted for Mr. Trump, Mr. Frey found.

In those low-concentration states, foreign-born populations tended to be more educated than the native-born. In Ohio, for example, 43 percent of the foreign-born population is college educated, compared with just 27 percent of American-born Ohioans. About 43 percent of the foreign-born population is from Asia, far more than the 20 percent from Latin America.

The same can be true in states with large immigrant populations. About 15 percent of the population of Maryland last year was foreign-born. Of those people, 42 percent had college degrees, compared with 39 percent of American-born Marylanders.

Chao Wu, a data scientist in Columbia, Maryland, who came from China in 2003, said he had long known about Asian graduate students in the United States, because he had been one. But it wasn’t until he started running for a seat on his county’s board of education that he noticed the richness and variation in the population.