Entrepreneurs, billionaires, and scientists all agree--the people you choose to spend your time with matters more than you might think. 

Barbara Corcoran, a Shark Tank star and an investor, recently tweeted this advice to her 700,000 followers:

Corcoran distilled mountains of science, evidence, and ancient wisdom in one 95-character tweet.

Corcoran is right. Success is contagious. Behaviors are contagious. If you understand the psychology behind a field of study called "emotional contagion"--and make a habit of spending more time with those whose behavior you want to catch--you'll be far more successful than your peers. 

"It's better to hang out with people better than you. If you're picking associates, pick out those whose behavior is somewhat better than yours, and you'll drift in that direction," said Warren Buffett in a 2004 meeting of Berskhire Hathaway shareholders. 

Buffett's and Corcoran's advice is backed by science. Researchers have found that emotions and behaviors--both good and bad--spread quickly, like a virus.

Dr. Sigal Barsade is a Wharton management professor who spent eight years studying emotional contagion. According to Barsade's research on the Ripple Effect, "People do not live on emotional islands." Moods at work "ripple out" and influence the emotions, dynamics, attitudes, and thinking processes of the others.

Optimists will lift you higher; pessimists will drag you lower. It's that simple.

We can't always choose the people we associate with, but there are ways to maximize the time we spend with people who'll lift us higher.

1. Set aside your ego.

Excellence comes in different forms. People who are "better" than you in some area might be younger, older, or even competitors. A reporter once implied that the pro golfer Phil Mickelson would have won a lot more tournaments had Tiger Woods not been in the picture. Mickelson reminded the journalist that competing with Woods made him a better player. Giving credit to a competitor for making you better requires that you set aside your ego.

Setting aside your ego also means keeping an open mind about whom you spend your time with. In an interview last year on CNBC, Bill Gates acknowledged that he was reluctant to meet Warren Buffett. Gates was hyperfocused on running Microsoft at the time. He just didn't see the point of meeting Buffett when he came to town. Gates's mother finally persuaded him to drop by for a visit. Hours later, Gates and Buffett had to be pulled away from each other because they found each other so fascinating. "My whole business education started the day I met Warren," Gates said.

You never know whom you'll learn from. Don't close any doors.

2. Cultivate a growth mindset.

Microsoft CEO Satya Nadella is credited with making the successful transition to becoming a leading cloud computing provider, bolstering the company's profits and stock. In his book Hit Refresh, Nadella talks about how he was influenced by the work of Stanford psychology professor Dr. Carol Dweck. Her "growth mindset" strategy changed his way of thinking. "She divides the world between learners and nonlearners, demonstrating that a fixed mindset will limit you and a growth mindset can move you forward," writes Nadella.

Nadella made it his mission to change the company culture, instilling an insatiable desire to learn and to seek outside opinions. Many of those leaders at the top of any field have a growth mindset--they're constantly seeking out opinions, advice, and tips from people inside and outside their field. 

You have a choice to be a know-it-all or a learn-it-all. Choose the latter.

3. Protect your time with the right people.

Barbara Corcoran not only associates with people who dream big, she quickly eliminates those who drag down the workplace. "Protect the optimism of your firm," she once told Fortune magazine. "The minute I spotted a chronic complainer, I'd fire them. I didn't care how much money they brought in, because negativity kills optimism and belief in the future."

We only have so many hours in a day. Associating with people who are better than you means that you have to spend less time with those who are--well, worse than you. Protect the relationships that will lift you to higher levels of achievement.

"Choosing your heroes is very important," says Buffett. "You are going to gravitate toward the behavior of those around you." 

Who are your heroes? Are you spending enough time in their presence? It's worth the time to take another look.