# How to calculate Age-adjusted means?

#### klo

##### New Member
Hi,

Im interested to know how to calculate age adjusted means. I know that i have to build a regression model which is adjusted by age, but after i dont have anu clue.

Appreciate if someone gives an idea.

#### noetsi

##### No cake for spunky
You are going to have to provide more details including what you mean by age adjusted means. Do you mean using age as a predictor so that it controls for the impact of age in your model?

#### klo

##### New Member
Sorry for not explained it clearly.

Here is the example: i have 5 groups (ie. quantiles), and I want to know the mean of each variable (i.e. glucose, cholesterol etc.). Is easy to calculate means of each variable, but I want to be age-adjusted since want to compare the groups.

What I did is created a regression model: fit <- lm(glucose ~ age)

Now I dont know what to do to get age-adjusted mean for glucose.

Thank you.

#### noetsi

##### No cake for spunky
I am not sure what you mean exactly, but if you want to know what is the impact of say glucose controlling for age, the regression does that automatically in generating the slopes. If you want to know for descriptive purposes what is the mean age of a given level of a specific predictor, then the software likely allows you to calculate this by using average age BY the levels of that predictor. That should be in the descriptive section of your software.

#### Jake

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!

#### Dason

That will cause the "age-adjusted mean" to be the predicted value for the group when age=0. If you mean center age first then the group coefficients are the predicted values for the group at the average age.

#### Jake

Yes, of course, thank you Dason. My assumption is that the latter is what the OP wants to obtain.

#### klo

##### New Member
Thank Jake,

Do you have any idea for proportions adjusted by age?

should this works:
Code:
glm(diabetes ~ 0 + group + age)
Exp(group) should be the propotion adjusted by age?

Thanks

#### klo

##### New Member
Update

I noticed for some variables the adjusted means are far away from crude mean. Also confidence interval doesnt include the crude mean. Does this make sense?

#### Jake

Did you mean-center the age variable as Dason suggested?

#### Dason

Did you mean-center age first? How different are the groups in terms of age? Because if they do differ quite a bit then the adjusted means won't necessarily be close to the raw group means *if* age actually does have an influence.

#### klo

##### New Member
When i say adjusted by age, i want to remove the effect of age when comparing groups. So if group 2 has mean greater than group 1, this not because of age of participants in group 1.

#### Dason

Yeah - and that's what the code Jake gives you. If you're just comparing the groups it doesn't really matter if you mean center age or not - but mean centering does provide a more interpretable value for the adjusted group means though.

#### klo

##### New Member
Ok, i agree. But when i used formula above for systolic blood pressure, adjusted age mean was 100 mmHg, and crude mean 143 mmHg. This should not be correct.

#### Jake

klo, did you or did you not mean-center age?

#### GretaGarbo

##### Human
@klo!

It is time that you supply an example (that run on R). It is enough with 5 - 10 values.

You could have misunderstood something.

#### Dason

Ok, i agree. But when i used formula above for systolic blood pressure, adjusted age mean was 100 mmHg, and crude mean 143 mmHg. This should not be correct.
And what's the issue? You want to age-adjust the means. If your problem is that it changes the means... why are you age-adjusting?

Typically these age-adjusted means are mainly to provide a way to compare the groups at a common level - what you should be doing with them is comparing these numbers between groups. If the groups differ a lot in terms of age AND age does have a decent effect on the response then yes the age-adjusted means will be quite different from the raw means. If this is an issue for you then you really need to put more thought into what you actually want.

#### klo

##### New Member
Thanks Jake,

I just did with mean-center age, works perfectly.

BTW, what about proportions age-adjusted? Should I do glm, and exp(coef) should be the proportion?