Spending some time online could help ward off depression among the elderly, according to a recent study.

Researchers from Michigan State University found that Internet use among the elderly can reduce the chances of depression by more than 30 percent, according to a press release.

"That's a very strong effect," said Shelia Cotten, leader of the study and a professor of telecommunication, information studies and media, said in a statement. "And it all has to do with older persons being able to communicate, to stay in contact with their social networks, and just not feel lonely."

For the study, researchers analyzed data collected by the Health and Retirement Survey, survey collecting information from more than 22,000 older Americans every two years. Investigators collected information from more than 3,000 respondents. The study took into consideration the subjects' depression levels before they began using the Internet.

They found that for older people living alone, Internet use had a greater impact on their levels of depression. They also found that some people remain depressed despite Internet use, although it wasn't substantial.

"Internet use continues to reduce depression, even when controlling for that prior depressive state," Cotton said.

She added that it all comes down to how older people choose to use technology. As with most things in life, moderation is best.

"If you sit in front of a computer all day, ignoring the roles you have in life and the things you need to accomplish as part of your daily life, then it's going to have a negative impact on you," Cotten said. "But if you're using it in moderation and you're doing things that enhance your life, then the impacts are likely to be positive in terms of health and well-being."

The study was recently published in the Journal of Gerontology: Psychological Sciences and Social Sciences.