# Beta coefficients from stratified analysis when there are covariates?

Suppose I have a regression model shown below

Model 1: $$Y = \beta_0^\ + \beta_1SEX\ + \beta_2ALCOHOL\ + \beta_3SEX*ALCOHOL\$$

The predictors I am interested in are SEX (binary: 0 female, 1 male) and Alcohol consumption (binary: drinker, non-drinker). Suppose that I found a significant interaction between SEX and ALCOHOL and decided to stratify the data by sex. So I would have two new models:

Model 2a: $$\text{Female: } Y_F = \beta_0^\ + \beta_2ALCOHOL\$$

So for the female subset, the intercept is still $\beta_0$ and the slope for ALCOHOL is $\beta_2$

Model 2b: $$\text{Male: } Y_M = (\beta_0^\ + \beta_1) + (\beta_2\ +\beta_3) ALCOHOL$$

For the male subset, the intercept is now $\beta_0^\ + \beta_1$ and the slope for ALCOHOL is $\beta_2^\ + \beta_3$

This is pretty straightforward. If you fit a model like this in any statistical package, you would get this kind of result. However, if say, in the model, I actually included an additional variable AGE, which is a covariate (assuming that it does not interact with either SEX or ALCOHOL), the original model would be the one below:

Model 3: $$Y = \beta_0^\ + \beta_1SEX\ + \beta_2ALCOHOL\ + \beta_3SEX*ALCOHOL\ + \beta_4AGE\$$

Further suppose that we still have a significant interaction between SEX and ALCOHOL and I would like to stratify the data again. I would get two models below if I followed the logic above:

Model 4a: $$\text{Female: } Y_F = \beta_0^\ + \beta_2ALCOHOL\ + \beta_4AGE\$$

Model 4b: $$\text{Male: } Y_M = (\beta_0^\ + \beta_1) + (\beta_2\ +\beta_3)ALCOHOL + \beta_4AGE\$$

However, the actual beta coefficients obtained using a computer program can be very different from what you obtain using the updated equations above. The difference in $\beta_0$ makes sense, because the stratified models in 4a and 4b still assume the pooled mean for age; namely, it estimates $\bar{Y}$ at the mean of all subjects' age, whereas in the stratified analyses done by a computer program, the intercepts of the models estimate $\bar{Y}$ at the mean age of a sub-group.

However, I wonder why the slopes are different. In other words, why are the slopes in Models 4a and 4b different from those produced by a statistical package.

-

## 2 Answers

Here's an intuitive answer: When you stratify those last models, as you note, the intercept changes. However, the actual values do not change, so the mean predicted value should not change. But if you kept the coefficients the same, the mean predicted value would change - by just as much as the intercept changed.

-
I'm not sure this is what the OP is asking. I think s/he wants to know why $\beta_4$, $\beta_2$ and $\beta_3$ are different in models 4a, 4b and 3. –  Peter Ellis Dec 16 '12 at 19:50
I think that's what I answered.... but perhaps not. Your answer is also right. –  Peter Flom Dec 16 '12 at 22:08
Yes, now that I look again at your answer I see you are right too - we just took it from different ends (so to speak). –  Peter Ellis Dec 16 '12 at 22:27

When you fit models 4a and 4b you are allowing the estimates of $\beta_4$ to be different for the two different sex groups. In effect, you are not fitting model 3 in two steps, but a variant on model 3 that has an interaction between sex and age. So there is no real reason the coefficients in 4a and 4b should match those in 3.

Once $\beta_4$ is different, the other estimates are bound to be different in 4a and 4b from their estimates in 3, unless age is perfectly orthogonal to sex and alcohol (which is vanishingly unlikely).

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8529691100120544, "perplexity": 633.2843234959647}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": false}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2015-32/segments/1438043062635.98/warc/CC-MAIN-20150728002422-00283-ip-10-236-191-2.ec2.internal.warc.gz"}