[R-sig-ME] Logistic exposure glmer polynomial covariate issue

Kirsti Carr k|r@t|@|ynn @end|ng |rom gm@||@com
Sat May 15 15:21:23 CEST 2021


I am having issues with a glmer logistic regression with a logistic
exposure link function (method popularized in 2004 paper by Terry Shaffer),
to analyze juvenile survival data in respect to land cover data around
nest sites.

Had no issues with rescaling warnings when I ran data as glm, but when I
added the random effect I started getting these warnings for my polynomial
models. I attempted to rescale by log transforming the covariates. This
helped with some, but not all. I am also still getting an error message for
some models - both models included get the warning or error. I am using
lme4 version 1.1.25.

Any help would be much appreciated! Thanks in advance.

Example data here
<https://www.dropbox.com/s/0w3csm2vfcj47yq/data_email.csv?dl=0>

My code (logexp function used from posts by Ben Bolker online):

library(MASS)
library(lme4)
packages(bbmle)

logexp <- function(expos = 1)
{
  linkfun <- function(mu) qlogis(mu^(1/expos))
  ## FIXME: is there some trick we can play here to allow
  ##   evaluation in the context of the 'data' argument?
  linkinv <- function(eta)  plogis(eta)^expos
  mu.eta <- function(eta) expos * plogis(eta)^(expos-1) *
    .Call(stats:::C_logit_mu_eta, eta, PACKAGE = "stats")
  valideta <- function(eta) TRUE
  link <- paste("logexp(", deparse(substitute(expos)), ")",
                sep="")
  structure(list(linkfun = linkfun, linkinv = linkinv,
                 mu.eta = mu.eta, valideta = valideta,
                 name = link),
            class = "link-glm")
}

FL1 <- read.csv("data_email.csv")

g250.3
<-glmer(fate~(1|brood)+log(I(1+G250))+(log(I(1+G250^2)))+(log(I(1+G250^3))),
family=binomial(link=logexp(FL1$Interval)), data=FL1, start=NULL)

#error I received:

# Error in (function (fr, X, reTrms, family, nAGQ = 1L, verbose = 0L, maxit
= 100L,  :
#(maxstephalfit) PIRLS step-halvings failed to reduce deviance in
pwrssUpdate

g500.2 <-glmer(fate~(1|brood)+log(I(1+G500))+(log(I(1+G500^2))),
family=binomial(link=logexp(FL1$Interval)), data=FL1, start=NULL)

# Warning for g500.2:

# Warning message:
  # In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
                # Model is nearly unidentifiable: large eigenvalue ratio
               # Rescale variables?

	[[alternative HTML version deleted]]



More information about the R-sig-mixed-models mailing list