I am analyzing cardiac data and have interests in cardiac problems and exercise. I just want to focus on the exercise effect and found AGE is significant variable. I'd like to control AGE variable because it was not my interest.
All the variables were AGE, GENDER, blood pressure, smoke, BMI, drink, stress, exercise and the dependent variable is cardiac problem(the sum of cases of cardiomyopathy, heart failure, myocardial infarction), and the sample size is 2200.
After simple linear regression, I found the AGE, GENDER, blood pressure (measurement), BMI, exercise(time per week), stress (PWI-SF score) were significant. I separated the data by GENDER and made models by adding variables in order. The problem is I just want to focus on the association among the variables without AGE effect. Although AGE is important variable in the disease data, I'd like to deal with it as confounder.
I found this page explaining how to controlling AGE factor in the analysis.
http://rstudio-pubs-static.s3.amazonaws.com/310471_2dbd42091bab4771af1d39f687b2ac20.html
I understood this is an example of the subtracting the regression effect of the non-interesting variable from the dependent variable. i.e.
new_Y = Y - predict(lm(Y ~ AGE)).
model = lm(data, Y ~ AGE + excercise + ...)
new_model = lm(data, new_Y ~ AGE + exercise + ...)
This looks different from ANCOVA, subtracting covariates from the variable.
Actually, I failed ANCOVA in r depending on the order of the variables (I couldn't control the AGE effect) and succeeded by this method.
So, I'd like to know whether my understanding is right and hopefully the reference. Thank you.