I am attempting to run linear mixed effects models using the function lmer() in order to analyse the effect of the direction of change (single categorical fixed effect) in weather parameters over a fixed period of time (e.g. temperature) on the duration of different insect behaviours. My current model contains a single random effect - treatment (pertaining to conditions the insects were kept in during rearing in the lab). When I attempt to use the anova() function in order to determine the significance of the fixed effect (by comparing a model with and without it) I get the following error:
Warning message: In optwrap(optimizer, devfun, x@theta, lower = x@lower, calc.derivs = TRUE, : convergence code 3 from bobyqa: bobyqa -- a trust region step failed to reduce q
Would anyone be able to explain to me why this error occurs, how I would be able to fix it, and whether or not the p-value generated is only relevant once the error is fixed.
The two models I am comparing take the following forms:
model.7<-lmer(winsorized.Tot.time.fence.secs~Direction.12hrs + (1|Sex.ratio.line.male), data = charlotte.agg.2) model.8<-lmer(winsorized.Tot.time.fence.secs~(1|Sex.ratio.line.male), data = charlotte.agg.2)
Here is also the summary output of the first model:
Linear mixed model fit by REML. t-tests use Satterthwaite's method [ lmerModLmerTest] Formula: winsorized.Tot.time.fence.secs ~ Direction.12hrs + (1 | Sex.ratio.line.male) Data: charlotte.agg.2 REML criterion at convergence: 3425.4 Scaled residuals: Min 1Q Median 3Q Max -2.00084 -0.74868 -0.09043 0.68238 2.27442 Random effects: Groups Name Variance Std.Dev. Sex.ratio.line.male (Intercept) 820 28.64 Residual 25017 158.17 Number of obs: 265, groups: Sex.ratio.line.male, 11 Fixed effects: Estimate Std. Error df t value Pr(>|t|) (Intercept) 297.79 15.63 20.44 19.06 1.72e-14 Direction.12hrsIncrease 10.60 19.64 257.28 0.54 0.59 (Intercept) *** Direction.12hrsIncrease --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Correlation of Fixed Effects: (Intr) Drctn.12hrI -0.555