[R-sig-ME] Interpreting interaction terms

Rolf Turner r.turner at auckland.ac.nz
Thu Jul 15 23:09:06 CEST 2010


In situations like this it helps to think about *simple* examples.  You can do this
just in terms of ordinary garden-variety fixed effects only anova; no need to get
into mixed models and lmer, etc.

Suppose that you have a 2 x 2 design with cell means

	2 3
	3 2

If you were to fit a linear model with no interaction to a y-vector exactly equal to the cell means
(no noise at all) you would find that the A and B effect estimates were exactly 0 (since the row
means and column means are all equal to the grand mean).  However there ***is*** of course interaction
here, the values of the (alpha beta)_ij being +/- 0.5.

If you fit a model *with* interaction you get an error sum of squares equal to 0 and get a non-zero
interaction sum of squares.  The ``main effect'' sums of squares will still of course be 0.

So how can we concoct an example where the main effects appear to be 0 when an additive model is fitted,
but all effects (main and interaction) appear *not* to be 0 when a model with interaction is fitted?

Perturb the basic example a little bit so that the row and column means are not *exactly* equal to
the grand mean, but are close enough so that they will show up as being ``non-significant'' when
their sums of squares are compared with the interaction sum of squares (which becomes the error
sum of squares when you fit an additive model).

When you fit a model with interaction, the error sum of squares gets reduced since the interaction
sum of squares is no longer absorbed into it, and the ``little differences'' between the row and
column means and the grand mean show up as significant.

To do a numerical example in R, replicate the design twice and add a tiny bit of noise so that the
error sum of squares for the model with interaction is not exactly zero (which makes anova() complain
a bit):

mu <- rep(c(2.1,3.2,3,2.1),2)
a  <- rep(factor(c(1,1,2,2)),2)
b  <- rep(factor(c(1,2,1,2)),2)
set.seed(42)
y  <- mu + rnorm(8,0,0.0001)

anova(lm(y ~ a + b)) # Neither a nor b significant.
anova(lm(y ~ a * b)) # All effects significant.

Notice that ``significance'' --- or meaning --- of main effects when there is interaction
in the model is of dubious import.  A significant main effect when there is interaction can be
interpreted as saying that there are differences between the levels of this effect when these
levels are *averaged* over the levels of the *other* factor.  In other words there are differences
between the row means, or column means, in the cell means model. There are those who will fulminate
vehemently about the folly of giving *any* consideration at all to such an interpretation.  And
indeed it is not likely to be of much interest in any practical application.

HTH.

	cheers,

		Rolf Turner



On 16/07/2010, at 6:50 AM, Chris Mcowen wrote:

> Dear List -
> 
> I am fitting some models and have a question regarding the interpretation.
> 
> When i fit the model with no interaction term   only one significant term - pollen dispersal - is significant
> 
> However when i introduce an interaction term ( based on a priori knowledge) not only do the interaction terms become significant ( A*B) but also the terms A + B become significant on there own. Furthermore, new factors become slightly significant.
> 
> Please see below for models ( sorry for formatting).
> 
> My question is, how do i interpret this? Is factor A or B significant on their own? Furthermore, what about the factor that appears significant when the interaction term is added?
> 
> Thanks for your help
> 
> Chris
> 
> 
> NO INTERACTION TERMS
> 
> Starting model - model31 <- lmer(netf~1+(1|order/family) + endosperm + geophyte + breedingsystem + woodyness + seasonality + geophyte + fruit + pollendispersal, family=binomial)
> 
> MAM -  (by removing the factor with the highest pvalue) - model31 <- lmer(netf~1+(1|order/family) + pollendispersal, family=binomial)
> 
> Generalized linear mixed model fit by the Laplace approximation 
> Formula: netf ~ 1 + (1 | order/family) + pollendispersal 
>  AIC  BIC logLik deviance
> 1245 1266 -618.6     1237
> Random effects:
> Groups       Name        Variance Std.Dev.
> family:order (Intercept) 5.3978   2.3233  
> order        (Intercept) 0.0000   0.0000  
> Number of obs: 1242, groups: family:order, 43; order, 9
> 
> Fixed effects:
>                Estimate Std. Error z value Pr(>|z|)  
> (Intercept)       0.9065     0.9071   0.999   0.3177  
> pollendispersal  -1.7225     0.6782  -2.540   0.0111 *
> 
> INTERACTION TERM INCLUDED
> 
> Starting model - model32 <- lmer(netf~1+(1|order/family) + endosperm + geophyte + breedingsystem* woodyness + seasonality + geophyte + fruit + pollendispersal, family=binomial)
> 
> MAM- model33 <- lmer(netf~1+(1|order/family) + breedingsystem*fruit + seasonality + fruit + pollendispersal, family=binomial)
> Generalized linear mixed model fit by the Laplace approximation 
> Formula: netf ~ 1 + (1 | order/family) + breedingsystem * fruit + seasonality +      fruit + pollendispersal 
>  AIC  BIC logLik deviance
> 1246 1287 -614.8     1230
> Random effects:
> Groups       Name        Variance   Std.Dev.  
> family:order (Intercept) 4.8431e+00 2.2007e+00
> order        (Intercept) 4.2899e-11 6.5497e-06
> Number of obs: 1242, groups: family:order, 43; order, 9
> 
> Fixed effects:
>                     Estimate Std. Error z value Pr(>|z|)  
> (Intercept)            2.9283     2.0712   1.414   0.1574  
> breedingsystem        -1.4739     0.7695  -1.915   0.0554 .
> fruit                 -2.4174     1.1130  -2.172   0.0299 *
> seasonality            0.7199     0.4367   1.648   0.0993 .
> pollendispersal       -1.6574     0.6686  -2.479   0.0132 *
> breedingsystem:fruit   1.0401     0.5029   2.068   0.0386 *
> 
> 
> Chris Mcowen
> PhD Student
> 
> Room 15
> Sir Harold Mitchell Building
> University of St Andrews
> St Andrews
> Fife
> KY16 9TH
> UK
> Phone 01334 463381 
> 
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

######################################################################
Attention: 
This e-mail message is privileged and confidential. If you are not the 
intended recipient please delete the message and notify the sender. 
Any views or opinions presented are solely those of the author.

This e-mail has been scanned and cleared by MailMarshal 
www.marshalsoftware.com
######################################################################




More information about the R-sig-mixed-models mailing list