Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# Re: st: difference between interaction created with # and created with xi3

 From "Michael N. Mitchell" To statalist@hsphsun2.harvard.edu Subject Re: st: difference between interaction created with # and created with xi3 Date Mon, 23 Aug 2010 15:14:13 -0700

```Dear Uso

The short answer to your question is that this xi3: command...

xi3: regress y i.a*i.b*i.c

is the equivalent of

regress y i.a##i.b##i.c

which is the equivalent of

regress y i.a i.b i.c ///
i.a#i.b i.a#i.c i.b#i.c ///
i.a#i.b#i.c

On the other hand, specifying

regress y i.a#i.b#i.c

```
yields a model that only specifies the interactions (no main effects, no two way interactions), which is not what we generally desire. I hope it suffices to say that this is not a particularly interesting model, and is complicated to explain via email.
```
I hope that helps,

Best regards,

Michael N. Mitchell
Data Management Using Stata      - http://www.stata.com/bookstore/dmus.html
A Visual Guide to Stata Graphics - http://www.stata.com/bookstore/vgsg.html
Stata tidbit of the week         - http://www.MichaelNormanMitchell.com

On 2010-08-23 12.49 PM, uso stata wrote:
```
```Hello statlist,
I am currently using a linear model specification and I am fiddling
with interactions.

I have three BINARY regressors a b c

When I use the command a#b#c stata spits out 7 interactions:

a b c
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1

when I use xi3: and a*b*c I get:
a
b
c
_Iaxb
_Iaxc
_Ibxc
_axbxc

While the main effects are identical, i.e. the coefficient of "0 0 1"
is the same as the coefficient of "c", the interaction terms are all
different.

P

The xi3 methods generates the same coefficient as the a##b##c method,
that is equivalent to i.a i.b i.c a#b#c

So my question is what is the specification that stata creates for
a#b#c? How do I interpret for example "0 1 1", I thought it was the
same as the interaction of b and c, but it seems not.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```
```*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```