Tuesday, June 18, 2013

Interaction terms in lm() in R

lm0 <- lm(y ~ r*s, data=d)
lm1 <- lm(y ~ r + s + r:s, data=d)
Reference:
http://stats.stackexchange.com/questions/19271/different-ways-to-write-interaction-terms-in-lm

No comments:

Post a Comment