[R] glm: quasi models with logit link function and binary data

Björn Stollenwerk bjoern.stollenwerk at uk-koeln.de
Mon Nov 28 12:18:00 CET 2005


# Hello R Users,
#
# I would like to fit a glm model with quasi family and
# logistical link function, but this does not seam to work
# with binary data.
#
# Please don't suggest to use the quasibinomial family. This
# works out, but when applied to the true data, the
# variance function does not seams to be
# appropriate.
#
# I couldn't see in the
# theory why this does not work.
# Is this a bug, or are there theoretical reasons?
# One problem might be, that logit(0)=-Inf and logit(1)=Inf.
# But I can't see how this disturbes the calculation of quasi-Likelihood.
#
# Thank you very much,
# best,
#
# Björn

set.seed(0)
y <- sample(c(0,1), size=100, replace=T)

# the following models work:
glm(y ~ 1)
glm(y ~ 1, family=binomial(link=logit))
glm(y ~ 1, family=quasibinomial(link=logit))

# the next model doesn't work:
glm(y ~ 1, family=quasi(link=logit))




More information about the R-help mailing list