[R] Log-likelihood function
Prof Brian Ripley
ripley at stats.ox.ac.uk
Wed May 2 09:52:36 CEST 2007
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
More information about the R-help
mailing list