I would like to test two hypotheses, but I am a little bit confused. I have a binary dependent variable z
, my key variable a
is also binary and three control variables b, c and d
.
Now I want to test the following hypotheses.
1: If a
is 1, then its more likely for z
to be 1.
2: The effect of a
on z
decreases for smaller d
I have created two different model, m1 without interaction and m2 with interaction
m1 <- glm(z ~ a + b + c + d,
data = data,
family = binomial(link = logit))
summary(m1)
Deviance Residuals:
Min 1Q Median 3Q Max
-2.3588 -0.7265 -0.5430 0.8308 2.2636
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -2.59652 0.20205 -12.851 < 2e-16 ***
a 0.45391 0.15227 2.981 0.00287 **
b 2.05067 0.19366 10.589 < 2e-16 ***
c 2.65482 0.22666 11.713 < 2e-16 ***
d 0.14768 0.07242 2.039 0.04142 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Null deviance: 1485.9 on 1243 degrees of freedom
Residual deviance: 1251.1 on 1239 degrees of freedom
m2 <- glm(dep ~ a + b + c + d + a:d,
data = data,
family = binomial(link = logit))
summary(m2)
Deviance Residuals:
Min 1Q Median 3Q Max
-2.3600 -0.7276 -0.5455 0.8237 2.2400
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -2.30656 0.24002 -9.610 <2e-16 ***
a -0.10448 0.30518 -0.342 0.7321
b 2.05082 0.19391 10.576 <2e-16 ***
c 2.66973 0.22683 11.770 <2e-16 ***
d -0.04204 0.11547 -0.364 0.7158
a:d 0.31179 0.14809 2.105 0.0353 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Null deviance: 1485.9 on 1243 degrees of freedom
Residual deviance: 1246.7 on 1238 degrees of freedom
Analysis of Deviance Table
Model 1: z ~ a + b + c +
d
Model 2: z ~ a + b + c +
d + a:d
Resid. Df Resid. Dev Df Deviance Pr(>Chi)
1 1239 1251.1
2 1238 1232.5 1 18.688 1.54e-05 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Model 1 shows that the first hypothesis is true and a
is significant. However, in model 2 the coefficient a
is no longer significant and we can see negative sign.
Can I say that hypothesis 1 is true, although other models show a different result? Or does hypothesis 1 to be true among all models?