Skip to content
Prev 16057 / 20628 Next

Continuous vs. categorical correlated group effects

The first thing I would try is rescaling your abundance value.  The
second is to tell us *exactly* what error messages
you get when you run glmer.  Also, how many species do you have?

===
fake_data <- data.frame(
   species_id = rep(outer(LETTERS,LETTERS,paste,sep="/"),40),
   stringsAsFactors=FALSE)
nn <- nrow(fake_data)
set.seed(101)
fake_data$resp <- rbinom(nn,prob=0.06,size=1)
fake_data$abund <- rlnorm(nn,meanlog=log(2500),
                          sdlog=0.75)

library(lme4)
g1 <- glmer(resp ~ abund +(1|species_id),data=fake_data,
      family=binomial(link='logit'))

## produces a fit, but lots of warnings.

fake_data$sc_abund <- scale(fake_data$abund)

update(g1, . ~ . - abund + sc_abund)

## The glm works on the first 1000 rows, but is very slow for the
whole data set (I may have invented too many species)


On Tue, Jan 2, 2018 at 5:21 PM, Drager, Andrea Pilar
<andrea.p.drager at rice.edu> wrote: