[R-sig-ME] convert into ORs

David Duffy David.Duffy at qimr.edu.au
Sat Nov 14 23:11:56 CET 2009


On Fri, 13 Nov 2009, raphaëlle métras wrote:

> I run a GLMM binomial, using glmer function. Please see the command and
> the ouputs at the end of my message.
>
> I wanted to know if there is a command that would convert my estimates
> into odds ratios, e.g. similar to the command logistic.display() that is
> working for 'glm'.
>
>> k8b <- glmer(status  ~ no_tradcat + dayscat + (1|fm_id) ,
> family=binomial, data=basket)

The default contrasts used by glmer (and glm etc) make the 
coefficients the log(OR) with respect to base category of each 
predictor variable.

so

my.logistic.display <- function(glmer.model) {
   coefs <- summary(glmer.model)@coefs
   data.frame(OR=exp(coefs[,1]),
              Lower=exp(coefs[,1]-1.96*coefs[,2]),
              Upper=exp(coefs[,1]+1.96*coefs[,2]))
}


-- 
| David Duffy (MBBS PhD)                                         ,-_|\
| email: davidD at qimr.edu.au  ph: INT+61+7+3362-0217 fax: -0101  /     *
| Epidemiology Unit, Queensland Institute of Medical Research   \_,-._/
| 300 Herston Rd, Brisbane, Queensland 4029, Australia  GPG 4D0B994A v


More information about the R-sig-mixed-models mailing list