The authors of a paper in The Journal of Nutrition set out to investigate links between diet and depression risk. There’s evidence that gut bacteria can affect mental health and they specifically focused on consumption of probiotics (foods like yogurt that contain bacteria) and prebiotics (foods high in fiber, which serve as fuel for the bacteria).
They looked at diet and health data collected from 14,539 healthy Spanish men and women, flagging their intake of full-fat yogurt, low-fat yogurt, and prebiotic fiber. During the follow-up period of 9.3 years, 727 people were diagnosed with depression. People who ate seven or more servings of full-fat yogurt each week were 22 percent less likely to be depressed than those who ate less than half a serving weekly. This finding was only statistically significant in women.
Consuming lots of low-fat yogurt (which is often higher in sugar than the regular kind) was associated with higher depression risk in the first two years of the study, but not after the full follow-up period. There was no link between intake of prebiotic fiber and depression.
These findings are preliminary and observational — it could be that people who eat full-fat yogurt have other habits that make them less likely to develop depression (the authors suggested a controlled trial where participants are randomly assigned to different yogurts).