If your neighbor wins the lottery, are you more likely to go bankrupt? New research suggests — surprisingly — yes.

Why? Because if you're like other folks whose neighbors have cashed in big, you're likely to try to keep up.

The 2016 paper, "Does Inequality Cause Financial Distress? Evidence from Lottery Winners and Neighboring Bankruptcies," found that the neighbors of winners bought cars, motorcycles, even houses. Worse, the higher the lottery prize, the higher the value of flashy assets purchased by neighbors who in some cases then had to file for bankruptcy themselves.

The $2.2 million LaFerrari Aperta.

They say comparison is the thief of joy, but it’s something that plagues almost all of us at some point or another. Here’s how to take back control of your feelings about your financial life.

Acknowledge your assumptions

“We create a story about people’s financial situation based on what we see, but there are really important things that we don’t see,” says behavioral economist Sarah Newcomb, author of the book Loaded. “We don’t see their debt, and we don’t see their savings.” In other words: You’re getting a small amount of information, and your brain is automatically filling in the details.

So ask yourself: What’s the story I’m telling myself about that other person? Then check your assumptions. Maybe you live in the smallest house in the neighborhood with the least flashy car, but what’s equally possible is that you win for the least mortgage and credit card debt. Focus in on your financial security — and think about the complexity of your own financial picture. Now, realize that your next door neighbor's is just as complex.

“We compare our realness with someone else’s advertisement,” says Newcomb. “We compare them as if they were both [equally] true.”

Dig deep

“It’s never going to hurt to get a little more self-aware,” says Newcomb, and a lot of this boils down to why we think we don’t measure up.

Ask yourself: What am I afraid of? Rejection? That people won’t like me if I don’t have certain items or an expensive lifestyle? That people may think I’m not successful? Then, once you’ve come face to face with your fears (and I’m not saying it’s easy), start digging deeper. Where do these ideas come from? Why do I think that? Was there a certain experience with someone specific that put that in my head? How’s that working out for that person? Is he or she happy?

Have a firm grip on your own dreams

Knowing what you value the most is a great antidote to comparison and the urge to keep up with the Joneses. And if you’re not sure? Take some time to figure it out. Think about what makes you happy, how you want your life to feel and what you care about the most.

“I am saving up to buy a little cottage with a big yard so that I can have a dog, and I’m probably going to be surrounded by huge houses, and I don’t care... I want cozy. I want small,” says Newcomb. “I aspire to a little house and a big bank account.” For Yale Economics Professor Dean Karlan, the dividing line is even simpler: "Don’t cry over things that can’t cry over you.”

So whether it’s retiring in a beach cottage or traveling the world, focus on that goal the next time you feel tempted to compare. Your neighbor with the nice car? Look at it as $50,000 he doesn’t have anymore, says Newcomb. You’re on the way to achieving your own dream.

With Hayden Field