Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: creating interaction variables


From   Joseph Coveney <jcoveney@bigplanet.com>
To   Statalist <statalist@hsphsun2.harvard.edu>
Subject   Re: st: creating interaction variables
Date   Sat, 12 Jun 2004 02:45:39 +0900

Richard is absolutely right and I stand corrected.  The interaction term 
command that allows for continuous-by-continuous interaction terms, in addition 
to those involving categorical-predictor variables, is -xi3- from Michael 
Mitchell and Phil Ender.  It's an extension of -xi- that is downloadable from 
SSC or from the ULCA site.  -help xi3- (after installing the package) will 
showTewodaj the way to the goal.

Joseph Coveney

--------------------------------------------------------------------------------

Richard Williams wrote:

At 01:38 PM 6/11/2004 +0900, Joseph Coveney wrote:
>-help xi- will show how to do you what you want.  You can probably automate
>the exercise, too, with a couple of -foreach- or -for- loops.
>
>You'll need to stay aware whether one or both the predictor variables are
>continuous in each instance of the many different interaction terms that
>you're exploring, since -xi-'s syntax will be slightly different from the
>case in which they are both categorical.

Doesn't -xi- require that one of the vars be categorical though?  How about 
if both x's are continuous?  If it doesn't exist already, it seems like it 
would be nice to have something like -xi- for continuous vars, e.g. if you 
have x1*x2 it expands to include the terms x1, x2 and x1*x2, so you don't 
have to bother computing the interactions beforehand.

[excerpted]

--------------------------------------------------------------------------------


*
*   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/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index