Re: [R] Log-likelihood function

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
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,                  ripley_at_stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-help_at_stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
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 https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.