Optimism doesn't just boost your mood. According to new research, a glass-half-full attitude also strengthens the immune system.

The study, which tracked changes in optimism and immune response among first-year law students, found that as students became more optimistic, they showed stronger cell-mediated immunity, the flood of immune cells that respond to an invasion by foreign viruses or bacteria. When optimism dropped, so did cell-mediated immunity.

Previous studies have established the connection between the psychological and the physical. Everything from marital spats to job stress can delay healing and promote disease. But previous research on optimism and the immune system has mostly compared optimists with pessimists, leaving open the possibility that other factors, like genetics and personality, could affect immune function.

"To show that a single person — with the same personality and genes — has different immune function when he or she feels more or less optimistic provides a stronger link between the two," said study co-author and University of Kentucky psychology professor Suzanne Segerstrom.

To investigate the connection, Segerstrom recruited 124 incoming law students and had them complete five questionnaires and immunity checks over the course of a year. The questionnaires measured students' optimism by asking how closely they identified with statements like "I will be less successful than most of my classmates."

To test immunity, the students had a dose of dead mumps virus or candida yeast injected under the skin of the forearm. These harmless cocktails trigger a cellular immune response, resulting in a small bump at the injection site. By measuring the bump, researchers can estimate the strength of the immune response.

As the students experienced classes, exams and internship interviews, their optimism levels rose and fell. So did their cell-mediated immunity. When optimism went up, so did the cell-mediated immune response. When optimism dropped, the immune system weakened.

To measure the strength of the relationship, Segerstrom and her team used a statistical calculation called effect size and found that the effect size of a rosy outlook was a modest but significant 0.19.

"By way of comparison, the effect size when you take calcium on your bone mass is 0.08, and the effect size when you take blood pressure medicine on your risk for stroke is 0.03," said Segerstrom. "So by the light of these other biomedical relationships that we think of as large and important, this effect certainly would match up."

The results also suggested that optimism affects immunity in part by increasing positive emotions, Segerstrom said. The next step, she said, is to look for similar effects in older people whose immune systems might already be vulnerable to infection.

The results could have implications for how mental health professionals approach counseling and treatment, said Margaret Kemeny, a health psychologist at UC San Francisco who was not involved in the research. Many psychological treatments focus on reducing negative emotions and stress, Kemeny said, but Segerstrom's research suggests that bolstering the positive could be fruitful as well.

"It may not be optimum to only focus on the negative," Kemeny said.