A man walks into a bar. He thinks the attractive woman smiling at him from across the room wants to have sex with him. True? Or is it all in his head?

Research has shown that in general, men have a tendency to misjudge a woman’s sexual intent, often based on individual or situational factors such as alcohol intoxication.

But a new study goes further, suggesting that a man’s attachment style – a personality trait reflecting his romantic relationship tendencies – may actually influence his perceptions of whether a woman is interested in him sexually.

Researchers asked nearly 500 men to imagine a scenario in which an attractive woman at a nightclub catches their eye. The woman notices she is being stared at and smiles back.

Participants were asked to gauge the level of interest they believed the woman in the scenario was showing, ranging from “not at all interested” to “extremely interested.”

The men were also asked to assess the extent to which they exhibited either of two tendencies – toward attachment anxiety and toward attachment avoidance.

Those higher in attachment anxiety have a need for love and reassurance and a fear of rejection. People higher in attachment avoidance typically are reluctant to trust and rely on others, and fear intimacy.

The study found that men on the higher end of the attachment anxiety spectrum were most likely to imagine a woman being sexually interested in them.

This is due in part to the men’s strong desire for intimacy, said Joshua Hart, associate professor of psychology and the lead author of the study to be published in the April issue of the journal Personality and Individual Differences. His co-author is Rhea Howard ’15, a former student now at Harvard University.

Further, men higher in attachment anxiety project their own flirtatiousness and sexual interest onto the woman, based on their hopes that she will reciprocate.

“If you view yourself as being flirtatious, that biases you to seeing others as behaving similarly,” Hart said.

Conversely, men higher in attachment avoidance felt the opposite.

“Their lower interest in intimacy led them to be less interested in the fictional woman, thus seeing themselves as being less flirty, and in turn, imagining the woman as less sexually interested in them,” Hart said.

The study’s results are an example of how wishful thinking pervades human social interactions.

“We see in reality what we wish to see, not necessarily what’s there,” Hart said.