I have two independent variables, distance
and light intensity
(continuous variables) that I want to understand their relationship on a human response (response or no response)
. Here, light intensity
represents the stimulus and distance
represents how far people are from it.
Initially, I carried out a t-test of independent means, which indicated a difference in distance and light intensity between response (group 1) and no response (group 2).
I then performed a bivariate logistic regression, to better understand the effect size of distance
and light intensity
on the response
(0 = no response, 1 = response). Note, I performed a linear correlation prior which indicated a weak negative correlation between distance
and light intensity
(r = -0.18, p = 0.000059).
Bivariate logistic regression results indicate that distance
has a larger effect compared to light intensity
(see below). So, for every 1-unit increase in distance
(meters), the likelihood of a response decreases by 66.9% (exp(-1.1065) - 1 x 100) (or, the closer in distance
a person is, the likelihood of a response
increases by 33.1%). In contrast, for every 1-unit increase in light intensity
(lux), the likelihood of a response
increases only by 0.045% (exp(0.0004569)- 1 x 100).
Bivariate logistic regression (light intensity)
Call:
glm(formula = response ~ light.intensity, family = binomial(link = "logit"),
data = df)
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -2.7016713 0.2497537 -10.817 < 0.0000000000000002 ***
light.intensity 0.0004569 0.0001209 3.779 0.000158 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 350.35 on 481 degrees of freedom
Residual deviance: 336.97 on 480 degrees of freedom
AIC: 340.97
Number of Fisher Scoring iterations: 5
Bivariate logistic regression (distance)
Call:
glm(formula = response ~ mean.distance, family = binomial(link = "logit"),
data = df)
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 3.5397 0.5853 6.048 0.000000001469798 ***
mean.distance -1.1065 0.1491 -7.423 0.000000000000114 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 350.35 on 481 degrees of freedom
Residual deviance: 161.36 on 480 degrees of freedom
AIC: 165.36
Number of Fisher Scoring iterations: 8
In order to explain the relationship between distance
and light intensity
on the response
, I performed a multiple logistic regression with an interaction term to specify a joint effect (see below). After reading, including responses by @Marrtin Buis and @Dave regarding interaction terms, my interpretation of the result is that:
- The likelihood of a response increases by 46.3% for every 1-unit decrease in
distance
, whenlight intensity
is 0. - While the effect size of
light intensity
is small, it does not contribute significantly to this model (p-value = 0.14) - However, as an interaction term, the interaction effect of
light intensity
ondistance
approaches significance (p-value = 0.093162) but the effect is very small. So, for every unit increase inlight intensity
, the effect ofdistance
decreases only by 0.03% (exp(-0.03) - 1 x 100).
Call:
glm(formula = response ~ distance + light.intensity + distance:light.intensity,
family = binomial(link = "logit"), data = df)
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 2.4744393 0.9502004 2.604 0.009211 **
distance -0.7698838 0.2295094 -3.354 0.000795 ***
light.intensity 0.0008299 0.0005656 1.467 0.142285
distance:light.intensity -0.0002745 0.0001635 -1.679 0.093162 .
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 350.35 on 481 degrees of freedom
Residual deviance: 157.99 on 478 degrees of freedom
AIC: 165.99
Number of Fisher Scoring iterations: 8
Is the interpretation of the logistic regression results correct?