Any study on longevity has to account for this fact. This is called a confounder, which is easy to remember because it can confound the results of a study. For instance, when studying the longevity of smokers, it's important to adjust for the gender difference, and adjust for the percentage of men and women in the study. It gets worse. Poor people die sooner than rich people.
Black people die sooner than white people, even when adjusting for the income confounder.
People in some countries live longer than people in others. A study that does not account for all of these factors is likely to be very inaccurate, and is probably worthless.