Hello,
I am running a multiple linear regression analysis to examine associations between blood glucose (continuous) and saturated fats (meeting recommendations: yes/no [binary]). As shown in the code below, we are adjusting for a number of variables (condensed for the purposes here).
We would like to stratify by age (continuous) and sex (binary). I tried using egen mystrata = group(age sex), however get an error that the option mystrata is not allowed when I run the command.
I was hoping to receiving guidance on:
1. the code to correctly stratify for age and sex, and
2. whether I would need to remove "age i.sex" from the above code when doing so
Thank you!
I am running a multiple linear regression analysis to examine associations between blood glucose (continuous) and saturated fats (meeting recommendations: yes/no [binary]). As shown in the code below, we are adjusting for a number of variables (condensed for the purposes here).
We would like to stratify by age (continuous) and sex (binary). I tried using egen mystrata = group(age sex), however get an error that the option mystrata is not allowed when I run the command.
Code:
regress blood_glucose i.SF_energy age i.sex i.ethnicity i.education_group i.smoke i.bmi_gp, mystrata cap drop myResiduals predict myResiduals, r sktest myResiduals
1. the code to correctly stratify for age and sex, and
2. whether I would need to remove "age i.sex" from the above code when doing so
Thank you!
Comment