2

I had thought that if there is an interaction between 2 independent variables, then it is always the case that there will be main effect for both the independent variables.

However, I found out that this is not the case after reading this site.

Can I have some practical examples where there is interaction and:

  1. no main effects for both independent variables.

  2. no main effect for one of the independent variables only.

landroni
  • 1,003
  • 15
  • 30
mauna
  • 576
  • 1
  • 7
  • 14
  • 1
    possible duplicate of [Is it meaningful to identify interaction effect when a main effect in a model (main effects only, without interaction terms) is not significant?](http://stats.stackexchange.com/questions/85940/is-it-meaningful-to-identify-interaction-effect-when-a-main-effect-in-a-model-m) – Nick Stauner Jun 03 '14 at 18:34
  • To clarify, are you looking for an example where: $Y$ and $X_1$ are independent, $Y$ and $X_2$ are independent (dependent for 1.) but $Y$ and $X_1*X_2$ are dependent? – CloseToC Jun 03 '14 at 18:42

2 Answers2

2

The significance of the main effects are going to depend on how your data is coded.

One real example that I deal with regularly where there is potential for significant interactions and non-significant main effects is:

Predictor 1, group: 0-control 1-treatment

Predictor 2, time: 0-pre intervention 1-post intervention

So the main effect on group (predictor 1) is measuring the difference between the treatment and control groups before any intervention takes place. If subjects were randomly assigned to group then this should not be significant. Even in an observational study without randomization this could be non-significant if the groups were chosen to be similar.

The main effect on time measures the change in the response between the pre intervention time period and the post intervention time period. If the response is not changing over time (due to outside effects or contamination from treatment group) then this should be non-significant as well. When it is not 0 (it is significant) it is an indication of any time effect/drift.

The interaction is then what is of interest, it is the change in the treatment group after intervention adjusting out any effect of differences between the groups to begin with and any drift over time.

In an ideal situation both main effects will be 0 and the interaction will not be. But there are cases where either main effect could be non-0.

Note that in the ideal situation (both groups identical at baseline, no change in control group over time) if we code the control group as -1 instead of 0 and the pre time as -1 instead of 0, then the main effect definitions change and the expectation of them being 0 is no longer the case.

Greg Snow
  • 46,563
  • 2
  • 90
  • 159
2

Just in case my answer to this question doesn't answer your question clearly enough:

Here are two very simple examples constructed in . $$\huge\star\ \text{No main effects}\ \star$$ set.seed(8);x=rnorm(99);z=rnorm(99);y=x*z+rnorm(99);d8a=data.frame(x,y,z);summary(lm(y~x*z))

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept) -0.15526    0.08713  -1.782    0.078 .  
x           -0.02191    0.08041  -0.272    0.786    
z           -0.07664    0.08380  -0.915    0.363    
x:z          1.08504    0.08777  12.362   <2e-16 ***

$$\rm Plot$$

require(ggplot2);ggplot(data.frame(x,y,z),aes(x,y,color=cut(z,3)))+geom_point()+stat_smooth(method=lm)+scale_colour_discrete(name="z")

Here the slope of y(x) increases with z, but is flat for moderate values.


$$\huge\star\ \text{Only one main effect}\ \star$$ x1=rnorm(99,0,20);x2=1:99/x1+(1:99)*.1;y=1:99;summary(lm(y~x1*x2))

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept) -0.15526    0.08713  -1.782    0.078 .  
x            0.97809    0.08041  12.163   <2e-16 ***
z           -0.07664    0.08380  -0.915    0.363    
x:z          1.08504    0.08777  12.362   <2e-16 ***

$$\rm Plot$$ Here the slope of y(x) still increases with z, but is positive even for moderate values.


If you wish, you can remove color(cut(z,3) to see a plot of y~x, or you can swap x and z where they appear to change which independent variable defines the horizontal axis.

Nick Stauner
  • 11,558
  • 5
  • 47
  • 105