A common situation in ecology is a survival model with a binary outcome (0=die, 1=survive) where individuals (for this example think of individual nesting attempts by birds)
You need to use a more recent version of the lme4
package, e.g. the 1.0-4 version that has just gone up on CRAN. Earlier versions did not allow user-specified link functions.
Also, note that the code you posted above is not what appears in recent versions of ?family
, where the (obsolete) .Call("logit_mu_eta", eta, PACKAGE = "stats")
is replaced by a pure-R implementation:
logexp <- function(days = 1)
{
linkfun <- function(mu) qlogis(mu^(1/days))
linkinv <- function(eta) plogis(eta)^days
mu.eta <- function(eta) days * plogis(eta)^(days-1) * binomial()$mu_eta
valideta <- function(eta) TRUE
link <- paste0("logexp(", days, ")")
structure(list(linkfun = linkfun, linkinv = linkinv,
mu.eta = mu.eta, valideta = valideta, name = link),
class = "link-glm")
}
The link you specified above, http://rpubs.com/bbolker/4082 , does in fact have an example of such a model (but it does require a recent version of lme4
).