I'm attempting to run a regression analysis on a continuous outcome variable y, using a primary predictor variable that represents a treatment (x1, dummy coded with the control group=0, treatment group=1), as well as some other categorical and continuous variables that, for various reasons, I am including in the model as control variables. What I want to do is to be able to take the coefficient result for x1/the treatment group and and interpret it as the mean difference in y between the treatment group and the control group, holding all of the confounding variables constant, using the intercept to represent the mean for the control group.

I understand that the intercept is the mean of y when all X = 0, and thus it represents the mean of y at the reference category for all categorical variables. I want to be able to take the difference for the treatment effect and calculate that difference as a percentage from Y. Here is my code and output:

> model <- lm(y ~ x1 + x2 + x3 + x4 + x6 + x7, data=df)
> summary(model)

lm(formula = y ~ x1 + x2 + x3 + x4 + x6 + x7, data = df)

    Min      1Q  Median      3Q     Max 
-111.58  -33.77   -8.21   19.02  447.32 

            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  90.2631    10.8291   8.335 1.50e-14 ***
x1Group 2   -31.0268    10.0981  -3.073 0.002433 ** 
x2Graduate  -16.3094    13.3664  -1.220 0.223901    
x2HS         11.6441    10.7229   1.086 0.278887    
x3yes        -2.1632     9.8294  -0.220 0.826047    
x4           -1.3587     0.4511  -3.012 0.002944 ** 
x6yes        43.9864    11.2346   3.915 0.000126 ***
x7           14.8018     2.8292   5.232 4.39e-07 ***
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 60.73 on 191 degrees of freedom
  (1 observation deleted due to missingness)
Multiple R-squared:  0.3439,    Adjusted R-squared:  0.3199 
F-statistic:  14.3 on 7 and 191 DF,  p-value: 6.751e-15

In this case, I would want to be able to say that, given the mean of y = 90.26 and the mean difference for x1 = -31.03 (resulting in an estimated mean of x1 at 58.23) the treatment is associated with a 36% difference in y between the treatment and control groups (58.23/90.26=0.64; 1-0.64=36).

My concern is that the intercept coefficient changes based on which reference category I have chosen for the confounding categorical variables. Assuming that the reference category is college for x2/education category, would my 36% reduction only apply to patients with a college education and "no" responses for x3 and x6? For my purposes, the categories are arbitrary. I just need to include them in the model because they're associated with y, and are imbalanced between the treatment and control groups due to some issues with randomization.

Any advice would be greatly appreciated. Thanks in advance.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.