So I'm going to start.

I'm going to use a regression with two predictors only.

We will investigate confounding and effect modification using regression and

then show the results visually as well.

For this situation, technically speaking, with only two predictors,

the two approach either separating the data by age categories and

running separate outcome exposure relationships

over the effect modifier groups, will give the same results.

This would not be the in case if we included more predictors for adjustment.

So what we are going to look at is something we looked at earlier in this

lecture set on logistic regression was associations between obesity and

HDL levels.

And we're going to include also an age of a person as a potential predictor.

So we had shown more extensive models when we were adjusting but

I'm going to hone it in on one now where with only two predictors,

we're looking at ultimately in an adjustment

model are the cholesterol levels in milligrams per deciliter and the age.

And so we've showed, or I'm showing now,

that if we look at the unadjusted association between HDL and

obesity after adjusting for age, the results are almost identical.

The results are very similar numerically indicating that the relationship

between obesity and HDL was not confounded by age.

However, there are differences in the relative odds of obesity for

different age groups amongst persons, after adjusting for HDL.

So amongst persons with the same HDL.

So all the groups older than the reference, the youngest 18 to

32 had higher odds of being obese amongst younger persons of the same HDL level.

And this is what this looks like visually on the log odds scale.

And climbing the log odds of obesity because remember,

that's what's ultimately being modeled for logistic regression.

And the slopes we get are then exponentiated to get these adjusted and

unadjusted odds ratios.

But I'm going to plot on the log odd scale log because that's the scale

we work on to start with regression.

And what I have in the red line, here, this shows the unadjusted associations.

This is just a model that includes only HDL as a predictor and the slope for

HDL could be found by taking the natural log of 0.967 and then the subsequent

nearly parallel four blue lines showing relationship adjusted for age.

And, again, the results were almost identical in terms of the association

between obesity and HDL, regardless of age.

And that's why these four lines are parallel to the overall unadjusted line,

because their slopes are almost identical.

But the differences in these four lines visually on the log odds scale, these

are the shifts up and down, depending on which age group the subjects are in.

So the one with the lowest long odds, at any given HDL level,

is the reference group of 18 to 32.

And then, these other three lines shifted up respectively from that, at any given

HDL level by an amount related to the slope for the indicator of that age group.

So that's what we have visually here.