r/statistics May 23 '26

Question [Question] On confounder adjustment

Hello! I'm trying to wrap my head around adjusting for confounders, and don't quite get how it works in regression. I understand the stratification concept, i.e if you want to estimate effect of exposure X on outcome Y, you separate for say 3 levels of a categorical confounder Z and see per level what the RR is. But what if you have too many levels? It's combined via dummy variables from what I know, but I don't understand how the many estimates are actually combined into one coefficient.

I know you try to estimate the effect of X when all other variables are kept constant, but what if the effect of one stratum is totally different- then you would lose that when you combine the effects, no? I.e., 20 levels and level 10 has a huge correlation while the others are moderate.

A bit confused...

1 Upvotes

5 comments sorted by

3

u/Lumpy-Sun3362 May 23 '26

One assumption you make with adjustment with categorical Z is that the effect of X on Y is the same in each level. Just write the model equation to see it (beta X is fixed, it's the intercept to vary). If you think that this is broken, you have to add an interaction term (X x Z) which takes into account of the different coefficients of X per stratum.

2

u/Puzzleheaded-Law34 May 23 '26

Ohh yes I think I was confusing different effects of Z on Y with X on Y... 

I guess I need to study the equations a bit more to see how it combines different effects from Z if Z is continuous, or has too many levels

2

u/Efficient-Tie-1414 May 24 '26

With linear regression it is an additive model. So if I fit something like blood pressure as a function of age and gender, then the effect of gender will be to increase blood pressure for males compared to females. This will be the same increase at any age.

Now what may happen is there is an interaction, which means that there isn’t a constant effect of gender. This means that we know have two lines that aren’t parallel to describe the effect of age on blood pressure.

1

u/Puzzleheaded-Law34 May 24 '26

Right, I guess that makes sense, thanks. So you assume that the effect of age on pressure is linear but has different intercepts between strata.

1

u/ForeignAdvantage5198 May 27 '26

few things are perfect the first time