Skip to content
Prev 243980 / 398506 Next

lm() and interactions in model formula for x passed as matrix

Thanks for the replies.

I was just thinking that, for a two variable example, doing
X<-cbind(x1,x2,x1*x2)
lm(y~X)
would work. So maybe that's what I'll do. This also allows me to pick
and choose which interactions to include.

Cheers
Bill

On Sun, Dec 5, 2010 at 8:19 PM, William Simpson
<william.a.simpson at gmail.com> wrote: