# Contradicting interaction significance with graphical visualisation in glmer

I'm investigating environmental effects (wind) on acoustic receiver detection probability for two types of transmitters using a binomial glmer. While my model analysis indicates that there's a significant effect between wind speed and transmitter type, graphical visualisation does not confirm this. If I'm correct, an interaction should demonstrate different regression slopes.

m1 <- glmer(cbind(df$Valid.detections, df$False.Detections) ~ Transmitter.depth +
Receiver.depth + Water.temperature + Wind.speed + Transmitter +
Distance + Habitat + Replicate + (1 | Day) + (Distance | SUR.ID) + Transmitter:Distance + Transmitter.depth:Habitat +


The model summary is as follows:

Generalized linear mixed model fit by maximum likelihood (Laplace Approximation) ['glmerMod']
Family: binomial  ( logit )
Formula: cbind(df$Valid.detections, df$False.Detections) ~ Transmitter.depth +
Receiver.depth + Water.temperature + Wind.speed + Transmitter +
Distance + Habitat + Replicate + (1 | Day) + (Distance |
SUR.ID) + Transmitter:Distance + Transmitter.depth:Habitat +      Receiver.depth:Habitat + Wind.speed:Transmitter
Data: df

AIC      BIC   logLik deviance df.resid
3941.9   4043.8  -1953.9   3907.9     2943

Scaled residuals:
Min      1Q  Median      3Q     Max
-9.4911  0.0000  0.0000  0.5666  1.9143

Random effects:
Groups Name        Variance Std.Dev. Corr
SUR.ID (Intercept)  0.33414 0.5781
Distance     0.09469 0.3077   1.00
Day    (Intercept) 15.96629 3.9958
Number of obs: 2960, groups:  SUR.ID, 20 Day, 6

Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept)                      3.20222    2.84984   1.124  0.26116
Transmitter.depth               -0.35015    0.11794  -2.969  0.00299 **
Water.temperature               -0.26595    0.11861  -2.242  0.02495 *
Wind.speed                       1.31735    1.50457   0.876  0.38127
TransmitterPT-04                -0.68854    0.08016  -8.590  < 2e-16 ***
Distance                        -0.39547    0.09228  -4.286 1.82e-05 ***
HabitatFinger                   -0.23746    3.57783  -0.066  0.94708
Replicate2                      -0.21559    0.08009  -2.692  0.00710 **
TransmitterPT-04:Distance       -0.27874    0.08426  -3.308  0.00094 ***
Transmitter.depth:HabitatFinger  0.73965    0.28612   2.585  0.00973 **
Receiver.depth:HabitatFinger     3.02083    0.74546   4.052 5.07e-05 ***
Wind.speed:TransmitterPT-04     -0.15540    0.06572  -2.364  0.01806 *
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Correlation of Fixed Effects:
(Intr) Trnsm. Rcvr.d Wtr.tm Wnd.sp TrPT-04 Distnc HbttFn Rplct2 TPT-04: Tr.:HF Rc.:HF
Trnsmttr.dp -0.024
Recevr.dpth -0.120 -0.267
Watr.tmprtr  0.019 -0.159  0.007
Wind.speed   0.130  0.073 -0.974  0.040
TrnsmtPT-04 -0.015  0.027  0.020 -0.018 -0.024
Distance     0.022 -0.080  0.151 -0.052 -0.141 -0.164
HabitatFngr -0.813  0.010  0.241 -0.025 -0.253  0.009   0.029
Replicate2  -0.067  0.033  0.377 -0.293 -0.394  0.010   0.085  0.103
TrnsPT-04:D -0.006  0.043 -0.007 -0.050 -0.003  0.516  -0.373  0.004  0.006
Trnsmtt.:HF  0.017 -0.352  0.021  0.055  0.049  0.026  -0.142  0.031 -0.088  0.025
Rcvr.dpt:HF  0.103  0.189 -0.830  0.051  0.817 -0.036  -0.143 -0.224 -0.385 -0.003  -0.229
Wnd.:TPT-04 -0.002  0.026 -0.015  0.003 -0.009  0.176  -0.114 -0.002  0.016  0.306  -0.008  0.014


A side question: I noticed a strong negative correlation between the intercept and a dichotome categorical predictor. I wonder if this causes any problems for my data analysis. All the covariates are centered and scaled for numerical stability during modelling.

• Interactions in nonlinear models are messier than in linear models. See Karaca-Mandic et al. (2012) for an overview. Basically the problem can be boiled down to all terms (not just interactions) have differing effects at different points on the original untransformed probability metric. This naturally makes life difficult for us sometimes. Commented Jul 14, 2014 at 13:57
• Hm. I will have a look at the paper. Thanks for your reply. Commented Jul 14, 2014 at 15:40
• The p-values you're seeing in the table are (1) Wald tests [based on curvature] and (2) not corrected for finite-size effects. Guessing appropriate degrees of freedom is hard, but your number of groups is small, so I would definitely worry about this. If you have time, I would try confint(.,method="boot",which="beta_") to see how these CIs compare with the implicit Wald/Normal CIs you would get from the summary (or from confint(.,method="Wald")). (PS: good for you for sanity-checking your results graphically!) Commented Jul 14, 2014 at 16:53
• Hi Ben, I will def check the CI with bootstrapping methods. I will come back to your suggestion. Actually, I did stepwise backwards regression using the drop1(,test="Chi") test to test significance of parameter values. Although the coefficient value is different, it too is significant. Commented Jul 14, 2014 at 20:25
• I tried to calculate bootstrap CIs, however, after 3 hours it was still computing. So I cancelled it, and then I saw an accumulation of warning messages "In optwrap(optimizer, par = start, fn = function(x) dd(mkpar(npar1, ... : convergence code 1 from bobyqa: bobyqa -- maximum number of function evaluations exceeded". This looks like the problem why it's taking so long. Can I do anything to get rid of this warning message? Commented Jul 15, 2014 at 12:48