Dear mixed-effects modelers-

Please excuse my follow-up posting but I noticed that my first posting was
"scrubbed".  I am using a "customized" link function, popularly known as the
logistic exposure link-function, developed by Terry Shaffer, to model daily
survival probabilities for birds based on exposure intervals.  I want to
include one or two random-effect variables, such as ordinal or Julian day to
account for (e.g.) variation in plant/habitat structure across the breeding
season, but I've been unable to use the logexp link function with glmer.
This is the link function I'm using:*

### logistic-exposure link function
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) *
      .Call("logit_mu_eta", eta, PACKAGE = "stats")
    valideta <- function(eta) TRUE
    link <- paste("logexp(", days, ")", sep="")
    structure(list(linkfun = linkfun, linkinv = linkinv,
                   mu.eta = mu.eta, valideta = valideta, name = link),
              class = "link-glm")}

model=glmer(fate~AGE+(1|ORDDAY),**data=sdata,family=binomial(**logexp))*

I get the following error returned when trying to fit models:

*Error in binomial(logexp) : link "logexp" not available for binomial
family; available links are ‘logit’, ‘probit’, ‘cloglog’, ‘cauchit’, ‘log’*

I edited the lmer source code, starting on line 42, in an attempt to
"bypass" this restriction but I still receive the same error:

*famNms <- c("binomial", "gaussian", "Gamma", "inverse.gaussian",
            "poisson")
linkNms <- c("logit", "probit", "cauchit", "cloglog", "identity",
         "log", "sqrt", "1/mu^2", "inverse","logexp")
varNms <- c("constant", "mu(1-mu)", "mu", "mu^2", "mu^3")

#famType <- function(family)
#{
    #if (!(fTyp <- match(family$family, famNms, nomatch = 0)))
        ##stop(gettextf("unknown GLM family: %s",
                      #sQuote(family$family), domain = "R-lme4"))
    #if (!(lTyp <- match(family$link, linkNms, nomatch = 0)))
        #stop(gettextf("unknown link: %s",
                      #sQuote(family$link), domain = "R-lme4"))
    #vNam <- switch(fTyp,
                   #"mu(1-mu)",          # binomial
                   #"constant",          # gaussian
                   #"mu^2",              # Gamma
                   #"mu^3",              # inverse.gaussian
                   #"mu")                # poisson
    #if (!(vTyp <- match(vNam, varNms, nomatch = 0)))
        #stop(gettextf("unknown GLM family: %s",
                      #sQuote(family$family), domain = "R-lme4"))
    #c(fTyp = fTyp, lTyp = lTyp, vTyp = vTyp)
#}*

I have minimal experience in editing source code, and I didn't think a
self-contained example with data was necessary in this case but please let
me know if otherwise.  I would be grateful for any suggestions on how to
make this link function compatible with glmer.  Thanks for your expertise.
Best,

Matt
*                                                                 *___
Matt Giovanni, Ph.D.
Research Wildlife Ecologist
402-617-3764 mobile
Research website:
http://sites.google.com/site/matthewgiovanni/
* <http://sites.google.com/site/matthewgiovanni/>*

	[[alternative HTML version deleted]]


