Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In an article I found recently they were able to compute the difference in means of two groups (presumably with a t-test) while adjusting for confounders; they called this the aDiff (adjusted difference).

Now I understand that you can use linear regression for continuous variables when you want to adjust for confounders, but with linear regression you are not comparing means.

share|improve this question
No reason to label this as to do with SPSS. It's a general statistical question. And to give a concise comment, linear regression is precisely about comparing means and at its simplest the t test just is a special case of regression. So it's not clear quite what you are asking. – Nick Cox Jan 28 at 13:13
In that case you just answered my question, now I know what I am looking for on the internet. Thanks! – Boudewijn Jan 28 at 13:23

Independent t-test is just a special case of linear regression. Given an outcome y and a binary indicator d, where d=0 for group A and d=1 for group B:

$y = \beta_0 + \beta_1 d$

The intercept $\beta_0$ is the mean of group A, the combined term $\beta_0 + \beta_1$ is the mean of group B. The p-value for $\beta_1$ then tests if the difference is different from zero. You'll see the p-value of this regression is identical to the p-value of the t-test variant.

Now, to adjust the mean for another covariate, x, the model simply becomes:

$y = \beta_0 + \beta_1 d + \beta_2x$

Now, $\beta_1$ is the so-called adjusted difference between groups A and B.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.