[R] Aranda-Ornaz links for binary data

BXC (Bendix Carstensen) bxc at novonordisk.com
Tue Dec 18 11:54:31 CET 2001


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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list