[R] Marginality rule between powers and interaction terms in lm()
JiHO
jo.lists at gmail.com
Fri Jan 21 19:41:50 CET 2011
Dear all,
I have a model with simple terms, quadratic effects, and interactions.
I am wondering what to do when a variable is involved in a significant
interaction and in a non-significant quadratic effect. Here is an
example
d = data.frame(a=runif(20), b=runif(20))
d$y = d$a + d$b^2
So I create both an simple effect of a and a quadratic effect of b.
m = lm(y ~ a + b + I(a^2) + I(b^2) + a:b, data=d)
drop1(m)
...
Df Sum of Sq RSS AIC
<none> 0.000000 -1487.56
I(a^2) 1 0.000000 0.000000 -1482.04
I(b^2) 1 0.098444 0.098444 -96.28
a:b 1 0.000000 0.000000 -1488.37
Here R cleverly shows that I can drop a:b or any quadratic term
(suggesting that they have equal marginality?) but not simple terms
since they are marginal to the quadratic or the interaction terms. At
this point the interaction is not significant so the situation is
simple: drop a:b, then drop a^2 and then stop.
Now let's add an interaction
d[d$b > 0.5, "y"] = d[d$b > 0.5, "y"] + 0.01*d[d$b > 0.5, "a"]
m = lm(y ~ a + b + I(a^2) + I(b^2) + a:b, data=d)
summary(m)
...
(Intercept) -3.275e-04 1.585e-03 -0.207 0.83932
a 9.988e-01 5.839e-03 171.070 < 2e-16 ***
b -1.613e-04 5.492e-03 -0.029 0.97698
I(a^2) -6.515e-05 5.159e-03 -0.013 0.99010
I(b^2) 1.001e+00 4.892e-03 204.593 < 2e-16 ***
a:b 1.191e-02 3.221e-03 3.698 0.00238 **
Now the interaction *is* significant, but a^2 still isn't. drop1()
still suggests that I can remove either the interaction or the
quadratic terms:
drop1(m)
...
Df Sum of Sq RSS AIC
<none> 0.000033 -254.306
I(a^2) 1 0.000000 0.000033 -256.306
I(b^2) 1 0.098611 0.098644 -96.239
a:b 1 0.000032 0.000065 -242.674
However, this: http://www.stats.ox.ac.uk/pub/MASS3/Exegeses.pdf
suggests that marginality rules between powers of variables might not
be implemented (although they might have been since 2000).
My question is: I am "allowed", according to marginality rules, to remove a^2?
I have found plenty of information on how the coefficients
corresponding to single terms change meaning when a quadratic term or
an interation is involved, and why they should not be removed in most
circumstances. I haven't found anything related to quadratic vs.
interactions.
Thanks in advance for your help. Sincerely,
JiHO
---
http://maururu.net
More information about the R-help
mailing list