[R] lm - interaction factors - same number of items per level in factors?

2011-03-08 Thread agent dunham
Dear community, Apologies for my questions, I´m pretty newbie. The thing is, I was trying this lm: mod.lm - lm(df$res ~ df$var1+ df$var2 + df$var3 +fact1:fact2) And factors are like this: table(fact1) a b c 3 90 83 table(fact2) a b c 4 87 85 Because of the interaction, i

Re: [R] lm - interaction factors - same number of items per level in factors?

2011-03-08 Thread Ista Zahn
Hi, You should avoid entering interaction terms without also including the lower-order terms involved in the interaction. Also, you are mixing variables from the workspace with those in (the data.frame?) df, which is a very bad idea. Try something like mod.lm - lm(res ~ var1+ var2 + var3 +