# Interaction effect – chi-square test

There are 3 types of interaction effect:

- In one sub-table there is a significant effect and in the other sub-table there is no effect.
- In one sub-table the effect is positive, in the other one the effect is negative-> the direction of the effect changes.
- In both the subtables there is an effect but the size of the effect differs.

When **we think that one independent variable can moderate the effect of the other independent variable on the dependent variable** then we have to use interaction effect. We talk about interaction effect when the effect of one independent variable changes depending on the effect of another independent variable. The effect of the two independent variables together is different than would be expected from them alone. In real life, countless factors act on our behavior all the time. The interaction effect allows us to uncover the main effects plus interactions.

One hypothesis could be: A higher proportion of women smoke than men. Ok, gender might have an effect on this, but what if living in a city decreases this effect? In this case, we have to check whether there is an interaction effect.

So, in an interaction effect we have 3 variables: smoking, gender, domicile.

**Hypothesis: **The effect of gender on smoking is different in urban and in rural areas.

weight by pspwght.

fre cgtsmke.

RECODE cgtsmke (1 2=0) (3 thru 5=1) INTO cgtsmke_dummy.

VARIABLE LABELS cgtsmke_dummy ‘Smoking?’.

VALUE LABELS cgtsmke_dummy 1’No’ 0’Yes’.

fre cgtsmke cgtsmke_dummy.

fre gndr.

RECODE gndr (1=0)(2=1) INTO gndr_dummy.

VARIABLE LABELS gndr_dummy ‘Gender dummy’.

VALUE LABELS gndr_dummy 0’Male’ 1’Female’.

fre gndr gndr_dummy.

fre domicil.

RECODE domicil (1 2=1)(3 thru 5=2) into domicil_dummy.

VARIABLE LABELS domicil_dummy ‘Big city or outskirts vs not big city’.

VALUE LABELS domicil_dummy 1’Big city or outskirts’ 2’Not big city’.

fre domicil domicil_dummy.

CROSSTABS cgtsmke_dummy BY gndr_dummy BY domicil_dummy /CELLS=COLUMN /STATISTICS=CHISQ RISK.

**The epsilon** for big city: 33,5-20,3 =13,2 percentage points**The epsilon** for not big city: 40,3 – 23,2= 17,1 percentage points.

In urban areas the proportion of those who smoke is 13,2 percentage points higher among men than among women. In rural areas the proportion of those who smoke is 17,1 percentage points higher among men than among women.

**Comparing epsilons**:

The difference of epsilons: 17,1 -13,2= 3,9

So, the difference between men and women is 3,9 percentage points

lower in cities than in other areas (not big cities). The difference between the proportion of smokers among men and women is 3,9 percentage points

lower in cities than in other areas (not big cities).

**Second-order odds ratio **(Comparing odds ratios):

It shows: How many times is the effect of the independent variable

larger/smaller by different values of the new variable (small/big city)?

1,979: In big cities, the odds of smoking for males are 1,979 times as high as

for females.

2,230: In small cities, the odds of smoking for males are 2,230 times as high as for females.

1,979/2,230=0,887

The effect of gender on smoking in big cities is 0,887 times as low as in other areas (small cities). In other words: gender has a stronger effect on smoking in small cities than in big cities.

->see the big cities is in the numerator,

so in the interpretation, we compare big cities to small cities. You can also double-check this in the contingency table by looking at the epsilons.

**Conclusion:** We see that in both the sub-tables the p-value is significant and the size of the epsilons is different. (**The epsilon** for big city: 13,2 percentage points and **the epsilon** for not big city: 17,1 percentage points.) So, here we see the third type of interaction effect: in both the subtables there is an effect but the size of the effect differs.

So, the results support the hypothesis stating that “the effect of gender on smoking is different in urban and in rural areas”.

**Other examples (interaction effect with chi-square)**

1. helping family gender domicil

2. satisfaction-economy ever-having-paid-job domicile