[R] log-log link function

Achim Zeileis Achim.Zeileis at uibk.ac.at
Fri Sep 13 12:24:05 CEST 2013


On Fri, 13 Sep 2013, Endy BlackEndy wrote:

> Hi to every body. I would like assistance on how to implement the 
> log-log link function for binary response. Is there any package that 
> implements it?

One way is to use the cloglog link and just flip the response categories.

To use the log-log link directly you can also use the "link-glm" object 
provided below. It's what we use internally in the "betareg" package to 
provide the log-log link.

loglog <- structure(list(
   linkfun = function(mu) -log(-log(mu)),
   linkinv = function(eta)
     pmax(pmin(exp(-exp(-eta)), 1 - .Machine$double.eps), .Machine$double.eps),
   mu.eta = function(eta) {
     eta <- pmin(eta, 700)
     pmax(exp(-eta - exp(-eta)), .Machine$double.eps)
   },
   dmu.deta = function(eta)
     pmax(exp(-exp(-eta) - eta) * expm1(-eta), .Machine$double.eps),
   valideta = function(eta) TRUE,
   name = "loglog"
), class = "link-glm")


> Many thanks
> Endy
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list