An interaction occurs when the relationship between one independent variable and the dependent variable depends on another independent variable. You have to imagine this as dividing our sample into two different subtables. So, interaction means that one variable modifies the effect on another variable.

When you are curious about an interaction effect then you must use the command “COMPUTE” and create a new variable, called “inter”, which we only use for calculation.

Note: In the interpretation you have to add “everything else held constant”, since you have more than 1 independent variables.

Research question: Does the effect of gender on smoking differ in small and big cities?

weight by pspwght.
fre cgtsmke.
RECODE cgtsmke (1 2=1) (3 thru 5=0) INTO cgtsmke_dummy.
VARIABLE LABELS cgtsmke_dummy ‘Smoking? (1=yes)’.
VALUE LABELS cgtsmke_dummy 1’yes’ 0’no’.
fre cgtsmke cgtsmke_dummy.

fre gndr.
RECODE gndr (1=1)(2=0) into gndr_2cat.
VARIABLE LABELS gndr_2cat ‘gender=male’.
VALUE LABELS gndr_2cat 1’male’ 0’female’.
fre gndr gndr_2cat.

fre domicil.
RECODE domicil (1 2=1)(3 thru 5=0) into domicil_dummy.
VARIABLE LABELS domicil_dummy ‘Big city or outskirts vs not big city’.
VALUE LABELS domicil_dummy 1’Big city or outskirts’ 0’Not big city’.
fre domicil domicil_dummy.

COMPUTE inter_domicil_gndr=domicil_dummy*gndr_2cat.

LOGISTIC REGRESSION cgtsmke_dummy WITH gndr_2cat domicil_dummy inter_domicil_gndr.

GRAPH
/BAR(grouped)=PGT(0)(cgtsmke_dummy) BY domicil_dummy BY gndr_2cat.

b1: The log odds of smoking among men is higher by 0,803 than among
women, everything else held constant.
In small cities, the log odds of smoking among men is higher by 0,803 than among women. So, in this case, domicil=0. So, this shows us the gender difference in smoking.

Exp(b1): 2,231: The odds of smoking for men are 2,231 times as high as for
women, everything else held constant. So, we can say that men are more likely to smoke than women. So, this shows us the gender difference in smoking.

b2: The log odds of smoking among people living in big cities is lower
by 0,177 than among people living in small cities, everything else held constant.
Among women, the log odds of smoking among people living in big cities is lower by 0,177 than among people living in small cities, everything else held constant.
(Among women, because gender=0.)

Exp(b2): 0,838: The odds of smoking for big city residents are 0,838 times as low as for those not living in big cities, everything else held constant.
This is, however, not significant.

b3: This shows the size of the interaction effect and we
use this to calculate the difference between women and men
in terms of smoking in big cities
(because we already know the difference in small cities.)
Conclusion: b1+b3 = How much higher or smaller is the log odds of smoking for men than for women in big cities.
*(We already know the gender difference in smoking behaviour for small cities from b1).

So, in the interpretation we cannot use the coefficient of “inter” by itself, but we have to combine it somehow with b1 coefficient. The b1 shows the gender difference in smoking but only for not big city residents. (only for not big city residents, because everything else is held constant and everything else held constant means that everything else takes up the 0 value).

Note: This is an additive effect, so here you have to add b1 to b3.

Exp(b3): We use this for calculation only:
Similarly to b3, we must combine this with b1, but in this case, we multiply the two values by each other:
b1*b3 = 1,98 = This much times as high are the odds of smoking for men than for women in big cities.

Note: This is a multiplicative effect, so here you have to multiply b1 by b3.

How to check whether the interaction effect is significant? You have to see the significance level of the inter variable, this will show you. Here it is not significant (p=0,636). The effect of gender is not significantly different in big cities and in small cities. So, we don’t see a significant difference on how the gender influences smoking behaviour of the people in big cities and in small cities.

Other examples

  1. Interaction effect 2nd example
  2. Multiple interaction terms example 1
UP