This is a cohort study because the patients were observed for a long period of time (10 years).
The response variable is whether or not the individuals had heart disease. The explanatory varibale is weather or not the individuals were happy.
There could be a confounding because of the lurking variables such as genetics or lifestyle. Some individuals might eat healthier than others, for example, affecting their chances of having heart disease.
This is a case-control study because it is retrospective. The researchers asked the women their habits after-the-fact. They are looking at existing habits.
The response variable is whether or not the women have nonmelanoma skin cancer. The explanatory variable is how much coffee the individuals consumed daily.
This is importance because the researchers must take into account confounding factors when, for instance lifestyle, age or other variables affect the results of the study. By adjusting for outside factors, the results better reflect the effects of the variable in question i.e. Coffee