# Re: st: Interaction term for dummy variables

 From "maartenbuis" To statalist@hsphsun2.harvard.edu Subject Re: st: Interaction term for dummy variables Date Thu, 24 Feb 2005 20:21:17 -0000

```--- anju parthan <aparthan@y...> wrote:
> However, I am concerned that if we calculate the
> interaction terms by multiplying the two dummy coded
> variables, in this case Male and BackPain,  we are
> combining some of the categories into the same group.
>
> For example,in the above sample
>
> ID=1 &  Male*BackPain=0 represents male without back
> pain, whereas
> ID=3 &  Male*BackPain=0 represents female with back
> pain, and
> ID=8 &  Male*BackPain=0 represents female without back
> pain.

Dear Anju,
An interaction term means that we think that the effect of one
variable is different for different types of individuals, e.g. Males
and Females. So if we think that Males react differently to backpain
than females we would estimate the following model:

Y = b0 + b1*backpain + b3*male*backpain + b2*male

which can be rewritten as:

Y = b0 + (b1 + b3*male)*backpain + b2*male

Now the effect of backpain for females (male==0) is b1 + b3*0 = b1.
The effect of backpain for males (male==1) is b1 + b3*1 = b1 + b3.

So it is the COMBINATION of the variables backpain and male*backpain
that ensures we are estimating both effects of backpain.

Hope this helps,
Maarten

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```