Even after controlling for many variables such as BMI, smoking, vegetable intake, and other variables researchers were able to determine that being a vegetarian and avoiding meat leads to a lower risk of cancer. They compared vegetarians and meat eaters who were as similar as possible except for the fact that the vegetarians don't eat meat. For example, they found meat eaters and veggies that had similar BMI's, activity levels, smoking frequencies, vegetable intake, etc. so that they could control for all variables besides the experimental variable of either meat-eater or vegetarian.
Just one more reason why I *love* being a plant-eater!