Re: [R] Log-likelihood function

From: Prof Brian Ripley <>
Date: Wed, 02 May 2007 08:52:36 +0100 (BST)

I think you need to learn about deviances, which R does print.

Log-likelihoods are only defined up to additive constants. In this case the conventional constant differs if you view this as a Poisson or as a product-multinomial log-linear model, and R gives you the log-likelihood for a Poisson log-linear model (assuming you specified family=poisson). However, deviances and differences in log-likelihoods do not depend on which.

More details and worked examples can be found in MASS (the book, see the FAQ), including other ways to fit log-linear models in R.

On Tue, 1 May 2007, someone ashamed of his real name wrote:

> I've computed a loglinear model on a categorical dataset. I would like to
> test whether an interaction can be dropped by comparing the log-likelihoods
> from two models(the model with the interaction vs. the model without).
> Since R does not immediately print the log-likelihood when I use the "glm"
> function, I used SAS initially. After searching for an extracting function,
> I found one in R. But, the log-likelihood given by SAS is different from
> the one given by R. I'm not sure if the "logLik" function in R is giving me
> something I don't want. Or if I'm misinterpreting the SAS output. Can
> anyone help?

Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Wed 02 May 2007 - 08:08:26 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 02 May 2007 - 10:31:34 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.