I would like to do an R glm() with family = binomial(link="loglog") Right now, the cloglog link exists, which is nice when the data have a heavy tail to the left. I have the opposite case and the loglog link is what I need. Can someone suggest how to add the loglog link onto glm()? It would be lovely to have it there by default, and it certainly makes sense to have the two opposite cases cloglog and loglog. Thanks for any help. Bill
William Simpson <william.a.simpson <at> gmail.com> writes:> I would like to do an R glm() with > family = binomial(link="loglog") > Right now, the cloglog link exists, which is nice when the data have a > heavy tail to the left. I have the opposite case and the loglog link > is what I need. Can someone suggest how to add the loglog link onto > glm()? It would be lovely to have it there by default, and it > certainly makes sense to have the two opposite cases cloglog and > loglog. > Thanks for any help. > > BillLook at the example under ?family for how to write a user-specified link and the source of the make.link function can be useful to. Ken -- Ken Knoblauch Inserm U846 Institut Cellule Souche et Cerveau D?partement Neurosciences Int?gratives 18 avenue du Doyen L?pine 69500 Bron France tel: +33 (0)4 72 91 34 77 fax: +33 (0)4 72 91 34 61 portable: +33 (0)6 84 10 64 10 http://www.sbri.fr
I wish to write a new link function for a GLM. R's glm routine does not supply the "loglog" link. I modified the make.link function adding the code: }, loglog = { linkfun <- function(mu) -log(-log(mu)) linkinv <- function(eta) exp(-exp(-eta)) mu.eta <- function(eta) exp(-exp(-eta)-eta) valideta <- function(eta) all(eta != 0) }, stop(sQuote(link), " link not recognised")) structure(list(linkfun = linkfun, linkinv = linkinv, mu.eta = mu.eta, valideta = valideta, name = link), class = "link-glm") } and then call glm with argument glm(y~x1+x2+x3,family=binomial(link=make.link("loglog")),data=X) and that seems to work.
Dear Bill, Perhaps the "cloglog" function in the "VGAM" package might be useful for you. HTH, Jorge On Fri, Jan 23, 2009 at 11:32 AM, William Simpson < william.a.simpson@gmail.com> wrote:> I would like to do an R glm() with > family = binomial(link="loglog") > > Right now, the cloglog link exists, which is nice when the data have a > heavy tail to the left. I have the opposite case and the loglog link > is what I need. Can someone suggest how to add the loglog link onto > glm()? It would be lovely to have it there by default, and it > certainly makes sense to have the two opposite cases cloglog and > loglog. > > Thanks for any help. > > Bill > > ______________________________________________ > R-help@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. >[[alternative HTML version deleted]]
can you please say specifically how to modify the make.link function -- View this message in context: http://r.789695.n4.nabble.com/glm-binomial-loglog-NOT-cloglog-link-tp849370p2135909.html Sent from the R help mailing list archive at Nabble.com.