Hi, I would like apply different link functions from Aranda-Ordaz (1981) family to large binary dataset (n = 2000). The existing links in glm for binomial data (logit, probit, cloglog) are not adequate for my data, and I need to test some other transformations. Is it possible to do this in R? And how? Thank you for your help, /Sharon +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ SHARON K?HLMANN-BERENZON Tel. +46-31-772 53 60 Dept. Mathematical Statistics Fax. +46-31-772 35 08 Chalmers University of Tech. e-mail: sharon at math.chalmers.se Eklandagatan 86 412 96 G?teborg, Sweden -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
You need to do two things: 1) in binomial, add to if (any(linktemp == c("logit", "probit", "cloglog", "log"))) stats <- make.link(linktemp) 2) in make.link, add code for the links you want. (Not tested recently, mark you.) On Tue, 18 Dec 2001, Sharon Kuhlmann-Berenzon wrote:> I would like apply different link functions from Aranda-Ordaz (1981) > family to large binary dataset (n = 2000). The existing links in glm for > binomial data (logit, probit, cloglog) are not adequate for my data, and I > need to test some other transformations. > > Is it possible to do this in R? And how? > > Thank you for your help, > > /Sharon-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Here is a dirty trick I once learned from Peter Dalgaard: Take a copy of the binomial family and then change the relevant bits. Clumsy, because you have to fiddle with the rho in a loop or something similar. But it works: boxcox <- binomial() boxcox$link <- "Box-Cox link family" boxcox$linkfun <- function(mu) log((1-mu)^(-rho)-1) - log(rho) boxcox$linkinv <- function(eta) 1-(1+rho*exp(eta))^(-1/rho) boxcox$mu.eta <- function(eta) exp(eta)*(1+rho*exp(eta))^(-1/rho-1) x1 <- rnorm(300) x2 <- rnorm(300) eta <- 0.2 + 0.5*x1 + 0.7*x2 + rnorm(300)/5 tigol <- function(x) exp(x)/(1+exp(x)) #inverse of logit y <- rbinom(300,1,tigol(eta)) rho <- 0.7 glm( y~x1+x2,family=boxcox) Good luck, Bendix Carstensen ---------------------- Bendix Carstensen Senior Statistician Steno Diabetes Centre Niels Steensens Vej 2 DK-2820 Gentofte Denmark tel: +45 44 43 87 38 mob: +45 28 25 87 38 fax: +45 44 43 73 13 bxc at novonordisk.com www.biostat.ku.dk/~bxc ----------------------> -----Original Message----- > From: Sharon Kuhlmann-Berenzon [mailto:sharon at math.chalmers.se] > Sent: 18. december 2001 10:24 > To: r-help at lists.R-project.org > Subject: [R] Aranda-Ornaz links for binary data > > > > Hi, > > I would like apply different link functions from Aranda-Ordaz > (1981) family to large binary dataset (n = 2000). The > existing links in glm for binomial data (logit, probit, > cloglog) are not adequate for my data, and I need to test > some other transformations. > > Is it possible to do this in R? And how? > > Thank you for your help, > > /Sharon > > > +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > SHARON K?HLMANN-BERENZON > > Tel. +46-31-772 53 60 Dept. Mathematical Statistics > Fax. +46-31-772 35 08 Chalmers University of Tech. > e-mail: sharon at math.chalmers.se Eklandagatan 86 > 412 96 G?teborg, Sweden > > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. > -.-.-.-.-.-.-.-.- > r-help mailing list -- Read > http://www.ci.tuwien.ac.at/~hornik/R/R-> FAQ.html > Send "info", > "help", or "[un]subscribe" > (in the > "body", not the subject !) To: > r-help-request at stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._. > _._._._._._._._._ >-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._