Depends on how you've coded X1 and X2, on whether you did or did not
include an interaction term, and on how that interaction term was
constructed. Your description is not very clear; see comments embedded
in the copy of your post, below.
Suppose X1 = {1 (experience) or 0 (no experience) },
X2 = {1 (program group) or 0 (control group),
X3 = X1*X2 (where "*" denotes multiplication)
= {1 (person with experience in program group)
or 0 (all other persons) }.
(X3 is the interaction variable.)
(I don't know if this corresponds to your situation, due to certain
ambiguities in your post. But for the sake of argument, let's suppose
it does.)
Now suppose you have fitted a model y = b0 + b1*X1 + b2*X2 + b3*X3
where y is your dependent or response variable, and the b's are the
several regression coefficients. In your data you have four groups:
A: those in the program group who have experience;
B: those in the program group without experience;
C: those in the control group who have experience;
D: those in the control group without experience.
On your three predictors (X1, X2, X3), the values in each group are:
A: X1 = 1, X2 = 1, X3 = 1.
B: X1 = 0, X2 = 1, X3 = 0.
C: X1 = 1, X2 = 0, X3 = 0.
D: X1 = 0, X2 = 0, X3 = 0.
For each group, the adjusted mean is b0 + b1*X1 + b2*X2 + b3*X3:
hence the adjusted mean for A = b0 + b1 + b2 + b3,
the adjusted mean for B = b0 + 0 + b2 + 0,
the adjusted mean for C = b0 + b1 + 0 + 0,
the adjusted mean for D = b0 + 0 + 0 + 0.
If you had chosen different codings for X1 and X2, the arithmetic is
slightly different (and the regression coefficients are different) but
the adjusted means are the same.
On 12 Jun 2003, MCP wrote:
> I've had troubles calculating adjusted means by hand. My model: y =
> f(X1,X2) where X1 and X2 are dummy variables. If I ran a linear
> model with an interaction term, how do I calculate the adjusted
> means by hand?
This question was answered above.
> Should I plug in the "mean" of the dummy variable, which would be a
> proportion, in order to get the overall mean across groups?
No. That "mean" is the mean for all persons in the data set. The mean
of X1 for a particular cell is the value of X1 in that cell (since X1 is
an indicator variable): 1 or 0 (using the coding illustrated above).
> That is, if X1 is experience (1 = yes) and X2 is group belonging (X1
> = 0 control),
I do not understand the hypothesis. You seem to be defining X2 in terms
of X1, which cannot make any reasonable sense. Try stating your
question as explicitly as possible, to indicate what "adjusted mean(s)"
you actually want; unless, perhaps, the exposition above has made
things clear enough for you to follow through on your own.
> how do I get the adjusted mean for people whose experience is 1,
> independently of being program or control?
What do you want to mean by "independently of being program or control"?
There are three means I can imagine your asking for, and this is a
remarkably ambiguous way of specifying any of them:
(1) the adjusted mean for those whose experience = 1, ignoring their
membership in the program or control groups; for this value, fit the
model y = b0 + b1*X1, and the adjusted mean is b0 + b1. (The
coefficients b0 and b1 here do not necessarily have the same values as
the coefficients b0 and b1 in the more complex model fitted in the
fourth paragraph of this post.)
(2) the adjusted mean for those whose experience = 1 and who are in
the program group. This is case A above.
(3) the adjusted mean for those whose experience = 1 and who are in
the control group. This is case C above.
-----------------------------------------------------------------------
Donald F. Burrill [EMAIL PROTECTED]
56 Sebbins Pond Drive, Bedford, NH 03110 (603) 626-0816
.
.
=================================================================
Instructions for joining and leaving this list, remarks about the
problem of INAPPROPRIATE MESSAGES, and archives are available at:
. http://jse.stat.ncsu.edu/ .
=================================================================