[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: creating interaction variables
At 01:38 PM 6/11/2004 +0900, Joseph Coveney wrote:
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.
-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.
As an alternative, I think -anova- might do the trick, e.g. you can have
anova y x1 x2 x1*x2, continuous(x1 x2)
As a possibly unnecessary sidelight, going back to the original requested
regress y x1*x2 x3 x4
However the problem gets solved, you'd probably want to have the lower
order terms included, e.g. it should expand to
regress y x1 x2 x1*x2 x3 x4
* For searches and help try: