From p.dalgaard at biostat.ku.dk  Sun Oct 16 09:36:55 2005
From: p.dalgaard at biostat.ku.dk (Peter Dalgaard)
Date: 16 Oct 2005 09:36:55 +0200
Subject: [Rd] BIC doesn't work for glm(family=binomial()) (PR#8208)
In-Reply-To: <20051016040753.8F9F7868A@slim.kubism.ku.dk>
References: <20051016040753.8F9F7868A@slim.kubism.ku.dk>
Message-ID: <x2y84tj4ko.fsf@turmalin.kubism.ku.dk>

jusung at andrew.cmu.edu writes:

> Full_Name: Ju-Sung Lee
> Version: 2.2.0
> OS: Windows XP
> Submission from: (NULL) (66.93.61.221)
> 
> 
> BIC() requires the attribute $nobs from the logLik object but the logLik of a
> glm(formula,family=binomial()) object does not include $nobs.  Adding
> attr(obj,'nobs') = value, seems to allow BIC() to work.
> 
> Reproducing the problem:
> library(nmle);
> BIC(logLik(glm(1~1,family=binomial())));

It is not clear to me that "nobs" is a well-defined concept for
arbitrary likelihood functions. In particular, binomial models are
tricky: Is "13 successes in 79 trials" one (binomial) observation or
79 (Bernoulli) ones?? 

So BIC may not be defined. In which sense is this a bug, anyway? The
BIC function is defined inside the nlme package which is not designed
to work with anything but continuous data.


-- 
   O__  ---- Peter Dalgaard             ?ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)                  FAX: (+45) 35327907



[Rd] BIC doesn't work for glm(family=binomial()) (PR#8208)
Peter Dalgaard