Skip to content
Prev 11848 / 20628 Next

Mixed-effects conditional logistic regression in lme4 v. 1.0-4 and above

Javan Bauder <javanvonherp at ...> writes:
[snip]
lmer(1 ~ ?1+diff100+?(-1+diff100+?|Individual), 
   data=data, family=?binomial?)

Do you *really* have a 1 on the left-hand side of the formula?
It's hard for me to even understand what this mean/what kind of
sensible results this would produce ...
[snip lmer example -- no real reason to even try that at this point]
mod1 <- glmer(status~-1+Density+(-1+Density|Name),
   data=input,family='binomial',weights=Weight)
I guess I don't understand your example sufficiently well.
This error should only be triggered when there is only a single
unique value of the response variable, and I can't figure out
why that should happen in your case.  Can you provide a reproducible
example?  The following trivial example works, but I guess it doesn't
look like your data ...

set.seed(101)
input <- expand.grid(Density=1:20,Name=factor(1:20))
input$status <- rbinom(nrow(input),size=1,prob=0.5)

library(lme4)
mod1 <- glmer(status~-1+Density+(-1+Density|Name),
   data=input,family='binomial')
Can you point me to a reference for this type of model?
If I can convince myself that it ever makes sense to allow a model
with a constant response value, we could allow an option to glmerControl
to override/ignore the test for unique values

  Also note that conditional logits are _not_ quite the same thing
as a regular logit model -- see

https://stat.ethz.ch/pipermail/r-sig-mixed-models/2011q2/016030.html
http://data.princeton.edu/wws509/notes/c6s3.html

  There is probably a way to set this up with the machinery of
lme4, but I haven't thought it through -- add it to the ridiculously
long list of things I think are possible but haven't had the time
to work out.

  Ben Bolker