As the American author John Steinbeck once said, “You can only understand people if you feel them in yourself.” That appears to hold true for the many Americans who feel discriminated against, according to a new study. It found that black Americans are far more likely to perceive the prejudice experienced by the LGBT community than are their white compatriots.

Nearly three-quarters of black Americans believe gay and transgender people in the US face a lot of discrimination, according to the study by the Public Religion Research Institute, a nonprofit that tracks trends in public opinion. Researchers surveyed 40,000 people across all 50 states on their perceptions of discrimination in the US.

By comparison, nearly three-quarters of Hispanics believe gay and lesbian (66%) and transgender people (67%) experience discrimination.

White Americans were more divided on the discrimination the LGBT community faces, with roughly half agreeing that gay, lesbian, and transgender people face a lot of discrimination. Just under half of Asian-Pacific Islander (49%) believed gay and lesbian Americans faced a lot of discrimination in the US, while 55% said the same of transgender people.

Americans’ perception of discrimination differed with age and gender. Women were more likely than men to believe that immigrants, blacks, and lesbian and gay Americans experience a lot of discrimination (47% of women, compared with 36% of men). The report notes that more than six in ten (62%) young women (18-29 years old) said all three groups experience a lot of discrimination, compared to 46% of young men. Overall, younger men and women were significantly more likely to hold these views then their older counterparts.

While black Americans sympathize the most with bias against the LGBT community, the pattern didn’t hold when asked about marriage equality. In this case, white Americans were the more sympathetic group. A majority of white (59%), Hispanic (60%), and mixed-race Americans (59%) favored same-sex marriage. Fewer then half (48%) of black Americans supported same-sex marriage (41% were opposed to it)—though the report noted a five percentage-point increase in support for same-sex marriage among black Americans from 2015. Though less than half of Asian-Pacific Islander Americans perceived gay and lesbians to experience a lot of discrimination, a strong majority (69%) supported same-sex marriage.

Views about gay marriage split along political lines as expected, though age made a big difference. While 71% of Democrats and 62% independents favored same-sex marriage, just 38% of Republicans agreed. But views among Republicans differed along generational lines. A majority (54%) of young Republicans favored allowing gay and lesbian couples to marry, but fewer than 27% Republican seniors did.