One easy way to get the age-adjusted group means on some variable is to regress that variable on the group factor,
suppressing the intercept, and adding age to the model. That would look something like this:
Code:
lm(glucose ~ 0 + group + age)
This model will have one coefficient for each group, plus a coefficient for the age predictor. The coefficient for each group is that group's age-adjusted mean on glucose.
Make sure that "group" is stored as a
factor object, rather than as a numeric or character vector. This is important!