I would like to include pairwise interaction terms for lm(). For example, I
want to include the quadratic term of variable "V3".

> my.formula
y ~ 1 + V1 + V3 + V3:V3

> my.data
   y V1 V2  V3
1 31  1 42 140
2 32  0 43 120
3 33  0 57 150
4 34  0 55 132

> foo <- lm(my.formula, data = my.data)

> foo$coefficients
(Intercept)          V1          V3
29.47368421 -2.15789474  0.02631579

Why do the foo coefficients not include V3:V3 ?

I thought that the variable "V3:V3" has the values of squares of V3
elements, that is,
V3:V3
140*140
120*120
....
Am I wrong?

If I specify a fouth varaible "V4" with square values of V3, and the formula
is y ~ 1 + V1 + V3 + V4, it seems that the foo will give me different in and
out-sample predictions.

-Luke

	[[alternative HTML version deleted]]


