In one study, some foods boost your immune system. In another, they weaken it. What's going on? Apparently, we can't measure people's diet effectively and so the research is mostly irreproducible. This is a problem that plagues scientific research, too.
Gina Kolata writing for The Upshot:
Dozens of studies are publicized every week. But those studies hardly slake people’s thirst for answers to questions about how to eat or how much to exercise. Does exercise help you maintain your memory? What kind? Walking? Intense exercise? Does eating carbohydrates make you fat? Can you prevent breast cancer by exercising when you are young? Do vegetables protect you from heart disease?
The problem is one of signal to noise. You can’t discern the signal — a lower risk of dementia, or a longer life, or less obesity, or less cancer — because the noise, the enormous uncertainty in the measurement of such things as how much you exercise or what exactly you eat, is overwhelming. The signal is often weak, meaning if there is an effect of lifestyle it is minuscule, nothing like the link between smoking and lung cancer, for example.